Exemplo n.º 1
0
    public void ReplaceBattleReport(BigBattle.BattleReport newValue)
    {
        var index     = ServerComponentsLookup.BattleReport;
        var component = (BigBattle.BattleReportComponent)CreateComponent(index, typeof(BigBattle.BattleReportComponent));

        component.value = newValue;
        ReplaceComponent(index, component);
    }
Exemplo n.º 2
0
    public void AddBattleReport(BigBattle.BattleReport newValue)
    {
        var index     = ClientComponentsLookup.BattleReport;
        var component = (BigBattle.BattleReportComponent)CreateComponent(index, typeof(BigBattle.BattleReportComponent));

        component.value = newValue;
        AddComponent(index, component);
    }
Exemplo n.º 3
0
    public ServerEntity SetBattleReport(BigBattle.BattleReport newValue)
    {
        if (hasBattleReport)
        {
            throw new Entitas.EntitasException("Could not set BattleReport!\n" + this + " already has an entity with BigBattle.BattleReportComponent!",
                                               "You should check if the context already has a battleReportEntity before setting it or use context.ReplaceBattleReport().");
        }
        var entity = CreateEntity();

        entity.AddBattleReport(newValue);
        return(entity);
    }
Exemplo n.º 4
0
    public void ReplaceBattleReport(BigBattle.BattleReport newValue)
    {
        var entity = battleReportEntity;

        if (entity == null)
        {
            entity = SetBattleReport(newValue);
        }
        else
        {
            entity.ReplaceBattleReport(newValue);
        }
    }