// Requires: engine != null public Level(WorldStateManager worldManager) { this.worldManager = worldManager; size = worldManager.Size; mapObjects = new Dictionary <int, MapObjectComponent>(); objectPositions = new Dictionary <Vector3Int, Entity>(); worldManager.Engine.AddGroupListener(Group.createGroup().All(typeof(MapObjectComponent)), (entity) => { mapObjects.Add(entity.ID, entity.GetComponent <MapObjectComponent>()); objectPositions.Add(entity.GetComponent <MapObjectComponent>().Pos, entity); }, (entity) => { mapObjects.Remove(entity.ID); objectPositions.Remove(entity.GetComponent <MapObjectComponent>().Pos); }); pathFinder = new PathFinder(this); }
public HousingSystem() : base(Group.createGroup().All(typeof(NeedHousingComponent))) { houses = new List <Entity>(); }
public override void AddedToEngine() { Engine.AddGroupListener(Group.createGroup().All(typeof(HouseComponent)), AddHouse, RemoveHouse); Engine.AddGroupListener(Group.createGroup().All(typeof(ResidentComponent)), AddResident, RemoveResident); }
public override void AddedToEngine() { Engine.AddGroupListener(Group.createGroup().All(typeof(OwnedWorkersComponent)), AddOwner, RemoveOwner); }
public WorkerSystem() : base(Group.createGroup().All(typeof(WorkerComponent))) { }
public HiringSystem() : base(Group.createGroup().All(typeof(NotOwnedComponent))) { owners = new List <Entity>(); }
public NetSpawnSystem() : base(Group.createGroup().All(typeof(NetSpawnComponent))) { }
public RequestProcessingSystem() : base(Group.createGroup().All(typeof(ClientComponent))) { }
public TaskProcessingSystem() : base(Group.createGroup().All(typeof(TaskQueueComponent), typeof(OwnedWorkersComponent))) { }
public DeathSystem() : base(Group.createGroup().One(typeof(OreComponent), typeof(HealthComponent))) { }