public void SetTrick(ITrick trick) { _trick = trick; _playedIndex = 0; _offset = -400; if (!IsTrickSet) { Table.PlayedCards = new AndroidCard[trick.Count()]; IsTrickSet = true; } var score = trick.TrickValue(); var winner = trick.TheWinnerPlayer(); _roundStats[0].Text = "Trick Score: " + score.ToString(); _roundStats[1].Text = "Round Winner: " + winner.Name; foreach (var cardPlayerPair in _trick) { var card = cardPlayerPair.Item2; if (card == null) { continue; } var cardtexture = Table.GameContent.TextureDict[card]; var trickCard = new AndroidCard(cardtexture, card) { Position = new Vector2((Table.ScreenWidth / 2 + _offset), Table.ScreenHeight / 4.0f) }; _offset += 150; trickCard.State = StateType.Playing; trickCard.IsTrick = true; Table.PlayedCards[_playedIndex++] = trickCard; } }
public void SetTrick(ITrick trick) { _trick = trick; _playedIndex = 0; _offset = -400; if (!IsTrickSet) { Table.PlayedCards = new AndroidCard[trick.Count()]; IsTrickSet = true; } if (!LeaderboardSet) { SetScoreboard(); LeaderboardSet = true; } foreach (var cardPlayerPair in _trick) { var card = cardPlayerPair.Item2; if (card == null) { continue; } var cardtexture = Table.GameContent.TextureDict[card]; var trickCard = new AndroidCard(cardtexture, card) { Position = new Vector2((Table.ScreenWidth / 2 + _offset), Table.ScreenHeight / 4.0f) }; _offset += 150; trickCard.State = StateType.Playing; trickCard.IsTrick = true; var player = cardPlayerPair.Item1; _leaderboardpanel[_playedIndex].PlayerName = player.Name; _leaderboardpanel[_playedIndex].Text = "Card Played: "; _leaderboardpanel[_playedIndex].Card = trickCard; Table.PlayedCards[_playedIndex++] = trickCard; } }