示例#1
0
        public GamePageData(BoardPlacementData boardPlacementData, int currTimeSec, int currTimeMin, int currTimeHour, int turnCount, Board playerBoard, Board aiBoard, Ai ai)
        {
            if (boardPlacementData == null)
            {
                throw new ArgumentException("boardPlacementData cannot be null");
            }
            else if (currTimeSec < 0 || currTimeMin < 0 || currTimeHour < 0)
            {
                throw new ArgumentException("Один из счетчиков времени отрицательный, все они должны быть положительными");
            }
            else if (turnCount < 0)
            {
                throw new ArgumentException("число оборотов не может быть отрицательным");
            }
            else if (playerBoard == null || aiBoard == null)
            {
                throw new ArgumentException("Обе платы не");
            }
            else if (ai == null)
            {
                throw new ArgumentException("the ai cannot be null");
            }

            this.boardPlacementData = boardPlacementData;
            this.currTimeHour       = currTimeHour;
            this.currTimeMin        = currTimeMin;
            this.currTimeSec        = currTimeSec;
            this.turnCount          = turnCount;
            this.playerBoard        = playerBoard;
            this.aiBoard            = aiBoard;
            this.ai = ai;
        }
示例#2
0
        public GamePageData(BoardPlacementData boardPlacementData, int currTimeSec, int currTimeMin, int currTimeHour, int turnCount, Board playerBoard, Board aiBoard, Ai ai)
        {
            /* Verify nullity and negativity of parameters */
            if (boardPlacementData == null)
            {
                throw new ArgumentException("boardPlacementData cannot be null");
            }
            else if (currTimeSec < 0 || currTimeMin < 0 || currTimeHour < 0)
            {
                throw new ArgumentException("One of the time counter is negative, they should all be positive");
            }
            else if (turnCount < 0)
            {
                throw new ArgumentException("the number of turns cannot be negative");
            }
            else if (playerBoard == null || aiBoard == null)
            {
                throw new ArgumentException("Both boards should not be null");
            }
            else if (ai == null)
            {
                throw new ArgumentException("the ai cannot be null");
            }

            this.boardPlacementData = boardPlacementData;
            this.currTimeHour       = currTimeHour;
            this.currTimeMin        = currTimeMin;
            this.currTimeSec        = currTimeSec;
            this.turnCount          = turnCount;
            this.playerBoard        = playerBoard;
            this.aiBoard            = aiBoard;
            this.ai = ai;
        }