public bool MoveCard(int cardGameId, PossibleCardPlace newPlace) { try { PossibleCardPlace oldPlace = m_cardGameIdToPlaceMapping[cardGameId]; CardInGame cardInGame = m_cardGameIdToCardInGameMapping[cardGameId]; Cards[oldPlace].Remove(cardInGame); m_cardGameIdToPlaceMapping[cardGameId] = newPlace; Cards[newPlace].AddLast(cardInGame); return(true); } catch (Exception) { return(false); } }
/// <param name="cardGameId">CardInGame Identifier</param> /// <param name="place">The place where the card is if the player owns it</param> /// <returns>Whether the players owns the card</returns> public bool DoesPlayerOwnCard(int cardGameId, out PossibleCardPlace place) { return(m_cardGameIdToPlaceMapping.TryGetValue(cardGameId, out place)); }