Massively refactored everything related to entity inventory management We are no longer recalculating mass by iterating over the entire inventory any time anything changes, for example Gear is explicitly associated with hardpoints in the entity code This did introduce some bugs, will clean those up tomorrow
27 lines
765 B
C#
27 lines
765 B
C#
using System;
|
|
using System.Collections;
|
|
using System.Collections.Generic;
|
|
using Unity.Mathematics;
|
|
using static Unity.Mathematics.math;
|
|
using float2 = Unity.Mathematics.float2;
|
|
|
|
public class OrbitalEntity : Entity
|
|
{
|
|
public Guid OrbitData;
|
|
|
|
public OrbitalEntity(GameContext context, Guid hull, IEnumerable<Guid> gear, IEnumerable<Guid> cargo, Guid orbit, Guid zone, Guid corporation) : base(context, hull, gear, cargo, zone, corporation)
|
|
{
|
|
OrbitData = orbit;
|
|
}
|
|
|
|
public override void Update(float delta)
|
|
{
|
|
if (OrbitData != Guid.Empty)
|
|
{
|
|
Position = Context.GetOrbitPosition(OrbitData);
|
|
Velocity = Context.GetOrbitVelocity(OrbitData);
|
|
}
|
|
|
|
base.Update(delta);
|
|
}
|
|
}
|