public GameBoard(Difficulty difficulty, IGameBoardEvents gameBoardEvents, bool twoStageCreate) { this.GameBoardEvents = gameBoardEvents; this.PlayPiles = new List <Card> [NumPlayPiles]; for (int i = 0; i < GameBoard.NumPlayPiles; i++) { this.PlayPiles[i] = new List <Card>(); } this.DrawPiles = new List <List <Card> >(NumDrawPiles); this.DiscardPile = new List <Card>(Deck.DeckSize); this.SavedMoves = new Stack <Move>(); this.Score = StartScore; this.Difficulty = difficulty; this.NumMoves = 0; this.ElapsedSeconds = 0; Deck = Deck.Create(difficulty); if (!twoStageCreate) { ShuffleAndCreateTableau(); } }
public GameBoard(string xml, IGameBoardEvents gameBoardEvents) { this.GameBoardEvents = gameBoardEvents; this.SavedMoves = new Stack <Move>(); using (StringReader sr = new StringReader(xml)) { using (XmlReader xr = XmlReader.Create(sr)) { GameBoardReaderV1.ReadXml(xr, this); } } if (GameBoardEvents != null) { GameBoardEvents.TableauLoaded(this); } }
public GameBoard(Difficulty difficulty, IGameBoardEvents gameBoardEvents, bool twoStageCreate) { this.GameBoardEvents = gameBoardEvents; this.PlayPiles = new List<Card>[NumPlayPiles]; for (int i = 0; i < GameBoard.NumPlayPiles; i++) this.PlayPiles[i] = new List<Card>(); this.DrawPiles = new List<List<Card>>(NumDrawPiles); this.DiscardPile = new List<Card>(Deck.DeckSize); this.SavedMoves = new Stack<Move>(); this.Score = StartScore; this.Difficulty = difficulty; this.NumMoves = 0; this.ElapsedSeconds = 0; Deck = Deck.Create(difficulty); if (!twoStageCreate) ShuffleAndCreateTableau(); }
public GameBoard(string xml, IGameBoardEvents gameBoardEvents) { this.GameBoardEvents = gameBoardEvents; this.SavedMoves = new Stack<Move>(); using (StringReader sr = new StringReader(xml)) { using (XmlReader xr = XmlReader.Create(sr)) { GameBoardReaderV1.ReadXml(xr, this); } } if (GameBoardEvents != null) GameBoardEvents.TableauLoaded(this); }
public GameBoard(Difficulty difficulty, IGameBoardEvents gameBoardEvents) : this(difficulty, gameBoardEvents, false) { }