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); }
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); }
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); }
public void ReplaceBattleReport(BigBattle.BattleReport newValue) { var entity = battleReportEntity; if (entity == null) { entity = SetBattleReport(newValue); } else { entity.ReplaceBattleReport(newValue); } }