/// <summary> /// 在画板上绘制方块 /// </summary> /// <param name="pGraphics"></param> public void Draw(Graphics pGraphics) { if (!this.IsNull) { pGraphics.DrawImage(BlockBackground.GetBackground(this.BlockBackgroundType) as Image, X, Y, BlockBackground.Size, BlockBackground.Size); } }
public ZReserveBlock(int pX, int pY) : base(pX, pY) { base.BlockSet = new BlockUnit[4]; BlockBackground.BlockBackgroundType tBackgroundType = BlockBackground.GetRandomBackground(); //pX,pY作为第一个方块单元的左上角坐标 base.BlockSet[0] = new BlockUnit(pX, pY, tBackgroundType); base.BlockSet[1] = new BlockUnit(pX + BlockBackground.Size, pY, tBackgroundType); base.BlockSet[2] = new BlockUnit(pX - BlockBackground.Size, pY + BlockBackground.Size, tBackgroundType); base.BlockSet[3] = new BlockUnit(pX, pY + BlockBackground.Size, tBackgroundType); }