void CreateEntityPlayer(EntitiesPool pool) { var playerEntity = _context.CreateEntity(); playerEntity.AddComponent(new Player()); playerEntity.AddComponent(new EntityLinkComponent() { LinkToEntity = _context.Find(PoolMatcher.Inventory).First() }); }
void CreateEntityInventory(EntitiesPool pool) { var inventoryEntity = _context.CreateEntity(); var allGuns = pool.Find(PoolMatcher.Guns); inventoryEntity.AddComponent(new Inventory()); inventoryEntity.AddComponent(new EntityLinkComponent() { LinksToEntity = new List <Entity>(allGuns) }); }
void CreateEntitiesGuns(EntitiesPool pool) { var gunEntity = _context.CreateEntity(); gunEntity.AddComponent(new Gun()); gunEntity.AddComponent(new ComponentLinkToSilencer() { LinkToEntity = _context.Find(PoolMatcher.Silencer).First() }); gunEntity.AddComponent(new ComponentLinkToRearSight() { LinkToEntity = _context.Find(PoolMatcher.RealSight).First() }); //почти аналогичный код для второго оружия }
void CreateEntityRearSight(EntitiesPool pool) { var realSightComponent = new RearSight(); pool.CreateEntityAndAddComponent(realSightComponent, _countEntity); }
void CreateEntitySilencer(EntitiesPool pool) { var silencerComponent = new Silencer(); pool.CreateEntityAndAddComponent(silencerComponent, _countEntity); }