Beispiel #1
0
        protected bool Build(Vector2 position)
        {
            int x = (int)position.x;
            int y = (int)position.y;

            ITile tile = board[x, y];

            if (possibleMoves[x, y])
            {
                // generate block or roof
                tile.Height++;
                if (board is Board)
                {
                    if (tile.Height == Height.ROOF)
                    {
                        Roof.GenerateRoof(x, y, board as Board, (int)tile.Height - 1);
                    }
                    else
                    {
                        Block.GenerateBlock(x, y, board as Board, (int)tile.Height - 1);
                    }
                }
                return(true);
            }
            return(false);
        }