Entity Persistence Refactoring
Entities refactored to enable robust persistence Entities detect stale data references and reload behaviors
This commit is contained in:
parent
87acc75b96
commit
6aeb2ae280
29 changed files with 299 additions and 202 deletions
|
|
@ -519,10 +519,10 @@ public class StrategyGameManager : MonoBehaviour
|
|||
|
||||
if (args[0] == "ship")
|
||||
{
|
||||
var entity = new Ship(_context, hull, gear, Enumerable.Empty<ItemInstance>());
|
||||
var entity = new Ship(_context, hull.ID, gear.Select(i=>i.ID), Enumerable.Empty<Guid>());
|
||||
_context.Cache.Add(entity);
|
||||
_context.ZoneEntities[_populatedZone][entity.ID] = entity;
|
||||
_context.Agents.Add(new AgentController(_context, _populatedZone, entity));
|
||||
_context.Agents.Add(new AgentController(_context, _populatedZone, entity.ID));
|
||||
var zoneShip = Instantiate(ZoneShipPrefab, ZoneRoot);
|
||||
zoneShip.Label.text = $"Ship {_zoneShips.Count}";
|
||||
_zoneShips[entity] = zoneShip;
|
||||
|
|
|
|||
Loading…
Reference in a new issue