Exemplo n.º 1
0
    public void ReplaceGameStatus(EnmGameStatus newValue)
    {
        var index     = GameComponentsLookup.GameStatus;
        var component = CreateComponent <GameStatusComponent>(index);

        component.Value = newValue;
        ReplaceComponent(index, component);
    }
Exemplo n.º 2
0
    public void AddNewGameStatus(EnmGameStatus newValue)
    {
        var index     = GameComponentsLookup.NewGameStatus;
        var component = CreateComponent <NewGameStatusComponent>(index);

        component.Value = newValue;
        AddComponent(index, component);
    }
Exemplo n.º 3
0
    public GameEntity SetGameStatus(EnmGameStatus newValue)
    {
        if (hasGameStatus)
        {
            throw new Entitas.EntitasException("Could not set GameStatus!\n" + this + " already has an entity with GameStatusComponent!",
                                               "You should check if the context already has a gameStatusEntity before setting it or use context.ReplaceGameStatus().");
        }
        var entity = CreateEntity();

        entity.AddGameStatus(newValue);
        return(entity);
    }
Exemplo n.º 4
0
    public void ReplaceGameStatus(EnmGameStatus newValue)
    {
        var entity = gameStatusEntity;

        if (entity == null)
        {
            entity = SetGameStatus(newValue);
        }
        else
        {
            entity.ReplaceGameStatus(newValue);
        }
    }