示例#1
0
        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();
            }
        }
示例#2
0
        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);
            }
        }
示例#3
0
        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();
        }
示例#4
0
        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);
        }
示例#5
0
 public GameBoard(Difficulty difficulty, IGameBoardEvents gameBoardEvents)
     : this(difficulty, gameBoardEvents, false)
 {
 }
示例#6
0
 public GameBoard(Difficulty difficulty, IGameBoardEvents gameBoardEvents)
     : this(difficulty, gameBoardEvents, false)
 {
 }