Esempio n. 1
0
        public Board(Lst <Lst <Option <Shapes> > > cells)
        {
            if (!cells.ForAll(row => row.Length() == cells.Length()) || cells.Length() > Dimension.MaxBoardDimension)
            {
                throw new ArgumentOutOfRangeException("Invalid board");
            }

            Cells         = cells;
            NextMoveShape = CalculateNextMoveShape();
            Status        = CalculateGameStatus();

            GetWinner().Iter(w =>
            {
                Status = GameStatus.Over;
                Winner = Some(w);
            });
        }