public FightQueueListItem GetQueueInfo() { var result = new FightQueueListItem() { FightId = this._fightId.ToString(), Type = this.Type, Creator = this.Creator, Blue = TeamBlue.Select(p => p.Value.Name).ToList(), Red = TeamRed.Select(p => p.Value.Name).ToList(), Timeout = this.Timeout, TeamSize = this.TeamSize, Sanguinary = this.Sanguinary, }; return(result); }
public Fight AddFight(FightQueueListItem newFightInfo) { var newFightId = Guid.NewGuid(); var newFight = new Fight(this, newFightId, newFightInfo.Creator, newFightInfo.Type, newFightInfo.TeamSize, newFightInfo.Timeout, newFightInfo.Sanguinary); var success = Fights.TryAdd(newFight.FightId, newFight); if (success) { // Log.DebugFormat("new fight: creator {0}, type {1}, teamSize {2}, red: {3}, blue: {4}", newFight.Value.Creator, newFight.Value.Type.ToString(), newFight.Value.TeamSize, newFight.Value. return(Fights[newFightId]); } else { return(null); } }