Esempio n. 1
0
        private List <List <GridSpace> > MakePiece()
        {
            BlockColor color = BlockColor.Background;

            switch (_type)
            {
            case FuzaPieceType.TBlock:
            case FuzaPieceType.LinePiece:
            case FuzaPieceType.SquareBlock:
                color = BlockColor.BlockColor1;
                break;

            case FuzaPieceType.LBlock:
            case FuzaPieceType.Squiggly:
                color = BlockColor.BlockColor2;
                break;

            case FuzaPieceType.ReverseLBlock:
            case FuzaPieceType.ReverseSquiggly:
                color = BlockColor.BlockColor3;
                break;

            default:
                break;
            }
            var piece = new List <List <GridSpace> >();

            for (int y = 0; y < PIECE_SIZE; y++)
            {
                piece.Add(new List <GridSpace>());
                for (int x = 0; x < PIECE_SIZE; x++)
                {
                    piece[y].Add(new GridSpace());
                }
            }
            foreach (Coordinate fuza in _blocks)
            {
                int xFromCenter = PIECE_SIZE / 2 + fuza.xPos;
                int yFromCenter = PIECE_SIZE / 2 + fuza.yPos;
                piece[yFromCenter][xFromCenter] = new GridSpace(color);
            }
            return(piece);
        }
Esempio n. 2
0
 public GridSpace(GridSpace original)
 {
     Color             = original.Color;
     IsLockedDownBlock = original.IsLockedDownBlock;
 }