コード例 #1
0
        private bool canPlacePiece(Vector2 pos, Block piece, float deg)
        {
            Vector2 dimensions = piece.getWidthHeight(deg);

            if (pos.x < 0 || pos.y < 0 || pos.x + dimensions.x > level.getWidth() || pos.y + dimensions.y > level.getHeight())
            {
                return(false);
            }
            level.removeBlock(piece);
            return(level.canSet((int)pos.x, (int)pos.y, piece, deg));
        }