public Table(CardGame game, int numberOfPlayers, int width, int height) { this.Game = game; this.CurrentPlayer = 0; this.NextPlayer = 1; this.Width = width; this.Height = height; this.Players = new Player[numberOfPlayers]; switch (numberOfPlayers) { case 2: Players[0] = new Player(this.Game, "Vasya", Alignment.Bottom); Players[1] = new Player(this.Game, "Petya", Alignment.Top); break; case 3: Players[0] = new Player(this.Game, "Vasya", Alignment.Bottom); Players[1] = new Player(this.Game, "Petya", Alignment.Lift); Players[2] = new Player(this.Game, "Fedya", Alignment.Right); break; case 4: Players[0] = new Player(this.Game, "Vasya", Alignment.Bottom); Players[1] = new Player(this.Game, "Petya", Alignment.Lift); Players[2] = new Player(this.Game, "Fedya", Alignment.Top); Players[3] = new Player(this.Game, "Grisha", Alignment.Right); break; default: break; } this.CardDeck = new List<Card>(); this.TableDeck = new List<Card>(); this.OutDeck = new List<Card>(); }
public Player(CardGame game) { this.Game = game; Name = ""; Score = 0; Status = false; CurrentBet = 0; MaxBet = 0; CardDeck = new List<Card>(); Difficulty = CardsGL.Difficulty.Easy; }
public Player(CardGame game, string aName, Alignment alignment) { this.Game = game; Name = aName; Score = 0; Status = false; CurrentBet = 0; MaxBet = 0; Alignment = alignment; CardDeck = new List<Card>(); Difficulty = CardsGL.Difficulty.Easy; }
static void Main() { using (var game = new CardGame()) game.Run(); }