Пример #1
0
        // 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);
 }
Пример #4
0
 public override void AddedToEngine()
 {
     Engine.AddGroupListener(Group.createGroup().All(typeof(OwnedWorkersComponent)), AddOwner, RemoveOwner);
 }
Пример #5
0
 public WorkerSystem() : base(Group.createGroup().All(typeof(WorkerComponent)))
 {
 }
Пример #6
0
 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)))
 {
 }
Пример #10
0
 public DeathSystem() : base(Group.createGroup().One(typeof(OreComponent), typeof(HealthComponent)))
 {
 }