Exemplo n.º 1
0
 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));
 }
Exemplo n.º 2
0
    public void ReplaceDungeonSettingModels(DungeonSettingModels newValue)
    {
        var index     = GameComponentsLookup.DungeonSettingModels;
        var component = CreateComponent <DungeonSettingModelsComponent>(index);

        component.value = newValue;
        ReplaceComponent(index, component);
    }
Exemplo n.º 3
0
    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);
    }
Exemplo n.º 4
0
    public void ReplaceDungeonSettingModels(DungeonSettingModels newValue)
    {
        var entity = dungeonSettingModelsEntity;

        if (entity == null)
        {
            entity = SetDungeonSettingModels(newValue);
        }
        else
        {
            entity.ReplaceDungeonSettingModels(newValue);
        }
    }