Example #1
0
        public override BlockUnit[] AfterRotateBlockUnits()
        {
            BlockUnit[] tBlockUnits = new BlockUnit[4];
            tBlockUnits[0] = new BlockUnit(base.BlockSet[0].X, base.BlockSet[0].Y, base.BlockSet[0].BlockBackgroundType);
            switch (base.RotationState)
            {
            case 1:
            {
                tBlockUnits[1] = new BlockUnit(base.BlockSet[0].X, base.BlockSet[0].Y + BlockBackground.Size, base.BlockSet[0].BlockBackgroundType);
                tBlockUnits[2] = new BlockUnit(base.BlockSet[0].X - BlockBackground.Size, base.BlockSet[0].Y - BlockBackground.Size, base.BlockSet[0].BlockBackgroundType);
                tBlockUnits[3] = new BlockUnit(base.BlockSet[0].X - BlockBackground.Size, base.BlockSet[0].Y, base.BlockSet[0].BlockBackgroundType);
                break;
            }

            case 2:
            {
                tBlockUnits[1] = new BlockUnit(base.BlockSet[0].X + BlockBackground.Size, base.BlockSet[0].Y, base.BlockSet[0].BlockBackgroundType);
                tBlockUnits[2] = new BlockUnit(base.BlockSet[0].X - BlockBackground.Size, base.BlockSet[0].Y + BlockBackground.Size, base.BlockSet[0].BlockBackgroundType);
                tBlockUnits[3] = new BlockUnit(base.BlockSet[0].X, base.BlockSet[0].Y + BlockBackground.Size, base.BlockSet[0].BlockBackgroundType);
                break;
            }

            default: break;
            }
            return(tBlockUnits);
        }
Example #2
0
 public override BlockUnit[] AfterRotateBlockUnits()
 {
     BlockUnit[] tBlockUnits = new BlockUnit[4];
     if (base.RotationState == 1)
     {
         tBlockUnits[0] = new BlockUnit(base.BlockSet[0].X, base.BlockSet[0].Y, base.BlockSet[0].BlockBackgroundType);
         tBlockUnits[1] = new BlockUnit(base.BlockSet[0].X + BlockBackground.Size, base.BlockSet[0].Y, base.BlockSet[0].BlockBackgroundType);
         tBlockUnits[2] = new BlockUnit(base.BlockSet[0].X + 2 * BlockBackground.Size, base.BlockSet[0].Y, base.BlockSet[0].BlockBackgroundType);
         tBlockUnits[3] = new BlockUnit(base.BlockSet[0].X + 3 * BlockBackground.Size, base.BlockSet[0].Y, base.BlockSet[0].BlockBackgroundType);
     }
     else
     {
         tBlockUnits[0] = new BlockUnit(base.BlockSet[0].X, base.BlockSet[0].Y, base.BlockSet[0].BlockBackgroundType);
         tBlockUnits[1] = new BlockUnit(base.BlockSet[0].X, base.BlockSet[0].Y + BlockBackground.Size, base.BlockSet[0].BlockBackgroundType);
         tBlockUnits[2] = new BlockUnit(base.BlockSet[0].X, base.BlockSet[0].Y + 2 * BlockBackground.Size, base.BlockSet[0].BlockBackgroundType);
         tBlockUnits[3] = new BlockUnit(base.BlockSet[0].X, base.BlockSet[0].Y + 3 * BlockBackground.Size, base.BlockSet[0].BlockBackgroundType);
     }
     return(tBlockUnits);
 }