private GameMember GetMember(Cell cell, ChampSelectAction current, Dictionary <int, Trade> tradesByCell) { Trade trade; tradesByCell.TryGetValue(cell.CellId, out trade); var member = new GameMember(cell, current, trade); if (cell.CellId == draftData.ChampSelectState.MyCellId) { state.Me = member; } draftMembers[member.Id] = cell; return(member); }
public GameMember(Cell cell, ChampSelectAction current, Trade trade) : this(cell.CellId) { Name = cell.Name; Role = cell.AssignedPosition; if (current?.ActorCellId == cell.CellId && (current.Type == ChampSelectActionType.BAN || current.ChampionId != 0)) { Champion = current.ChampionId; } else if (cell.ChampionId != 0) { Champion = cell.ChampionId; } else { Intent = true; Champion = cell.ChampionPickIntent; } Spell1 = cell.Spell1Id; Spell2 = cell.Spell2Id; Active = cell.CellId == current?.ActorCellId; switch (trade?.State) { case TBDTradeState.INVALID: Trade = TradeState.INVALID; break; case TBDTradeState.BUSY: Trade = TradeState.BUSY; break; case TBDTradeState.AVAILABLE: Trade = TradeState.POSSIBLE; break; case TBDTradeState.SENT: Trade = TradeState.SENT; break; case TBDTradeState.RECEIVED: Trade = TradeState.RECEIVED; break; } }