Exemple #1
0
    public void ReplaceBattleConfig(BigBattle.BattleConfig newValue)
    {
        var index     = ServerComponentsLookup.BattleConfig;
        var component = (BigBattle.BattleConfigComponent)CreateComponent(index, typeof(BigBattle.BattleConfigComponent));

        component.value = newValue;
        ReplaceComponent(index, component);
    }
Exemple #2
0
    public ServerEntity SetBattleConfig(BigBattle.BattleConfig newValue)
    {
        if (hasBattleConfig)
        {
            throw new Entitas.EntitasException("Could not set BattleConfig!\n" + this + " already has an entity with BigBattle.BattleConfigComponent!",
                                               "You should check if the context already has a battleConfigEntity before setting it or use context.ReplaceBattleConfig().");
        }
        var entity = CreateEntity();

        entity.AddBattleConfig(newValue);
        return(entity);
    }
Exemple #3
0
    public void ReplaceBattleConfig(BigBattle.BattleConfig newValue)
    {
        var entity = battleConfigEntity;

        if (entity == null)
        {
            entity = SetBattleConfig(newValue);
        }
        else
        {
            entity.ReplaceBattleConfig(newValue);
        }
    }