public MapGeneratorSystem(Contexts contexts) : base(contexts.game) { _context = contexts.game; _settingModels = _context.dungeonSettingModels.value; _activeTiles = _context.GetGroup(GameMatcher.AllOf(GameMatcher.Tile, GameMatcher.Poolable).NoneOf(GameMatcher.Reusable)); _reusableTiles = _context.GetGroup(GameMatcher.AllOf(GameMatcher.Tile, GameMatcher.Poolable, GameMatcher.Reusable)); }
public void ReplaceDungeonSettingModels(DungeonSettingModels newValue) { var index = GameComponentsLookup.DungeonSettingModels; var component = CreateComponent <DungeonSettingModelsComponent>(index); component.value = newValue; ReplaceComponent(index, component); }
public GameEntity SetDungeonSettingModels(DungeonSettingModels newValue) { if (hasDungeonSettingModels) { throw new Entitas.EntitasException("Could not set DungeonSettingModels!\n" + this + " already has an entity with DungeonSettingModelsComponent!", "You should check if the context already has a dungeonSettingModelsEntity before setting it or use context.ReplaceDungeonSettingModels()."); } var entity = CreateEntity(); entity.AddDungeonSettingModels(newValue); return(entity); }
public void ReplaceDungeonSettingModels(DungeonSettingModels newValue) { var entity = dungeonSettingModelsEntity; if (entity == null) { entity = SetDungeonSettingModels(newValue); } else { entity.ReplaceDungeonSettingModels(newValue); } }