Inventory Refactoring

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
This commit is contained in:
hyperion51 2020-06-05 04:16:33 +01:00
commit 43f33546a3
22 changed files with 689 additions and 670 deletions

View file

@ -10,8 +10,6 @@ using static Unity.Mathematics.math;
[MessagePackObject]
public class Ship : Entity
{
[Key("hardpoints")]
public List<Hardpoint> Hardpoints = new List<Hardpoint>();
// [Key("bindings")] public Dictionary<KeyCode,Guid> Bindings = new Dictionary<KeyCode,Guid>();
//[IgnoreMember] public int HullHardpointCount;
@ -19,7 +17,7 @@ public class Ship : Entity
// [IgnoreMember] public Dictionary<Targetable, float> Contacts = new Dictionary<Targetable, float>();
// [IgnoreMember] public Targetable Target;
public Ship(GameContext context, Guid hull, IEnumerable<Guid> items, IEnumerable<Guid> cargo, Guid zone, Guid corporation) : base(context, hull, items, cargo, zone, corporation)
public Ship(GameContext context, Guid hull, IEnumerable<Guid> gear, IEnumerable<Guid> cargo, Guid zone, Guid corporation) : base(context, hull, gear, cargo, zone, corporation)
{
}