private IEnumerable <bool> E_DrawPiace(DrawPosInfo drawPos_1, DrawPosInfo drawPos_2, int frameMax) { foreach (DDScene scene in DDSceneUtils.Create(frameMax)) { double scRate = DDUtils.SCurve(scene.Rate); double x = GameConsts.FIELD_L + DDUtils.AToBRate(drawPos_1.X, drawPos_2.X, scRate); double y = GameConsts.FIELD_T + DDUtils.AToBRate(drawPos_1.Y, drawPos_2.Y, scRate); double rot = DDUtils.AToBRate(drawPos_1.Rot, drawPos_2.Rot, scRate); DDDraw.DrawBegin(this.Picture, x, y); DDDraw.DrawRotate(rot); DDDraw.DrawEnd(); yield return(true); } }
public DrawPieceTask(int x1, int y1, int x2, int y2, bool doRot) { this.Picture = PieceTable[x1, y1].ToPicture(); const double INTERVAL = 30.0; this.DrawPos_01 = new DrawPosInfo() { X = x1 * PIECE_XY_STEP + PIECE_WH / 2, Y = y1 * PIECE_XY_STEP + PIECE_WH / 2, Rot = 0.0, }; this.DrawPos_02 = new DrawPosInfo() { X = x1 * PIECE_XY_STEP + PIECE_WH / 2 + (x1 - 1) * INTERVAL, Y = y1 * PIECE_XY_STEP + PIECE_WH / 2 + (y1 - 1) * INTERVAL, Rot = 0.0, }; this.DrawPos_03 = new DrawPosInfo() { X = x2 * PIECE_XY_STEP + PIECE_WH / 2 + (x2 - 1) * INTERVAL, Y = y2 * PIECE_XY_STEP + PIECE_WH / 2 + (y2 - 1) * INTERVAL, Rot = 0.0, }; this.DrawPos_04 = new DrawPosInfo() { X = x2 * PIECE_XY_STEP + PIECE_WH / 2 + (x2 - 1) * INTERVAL, Y = y2 * PIECE_XY_STEP + PIECE_WH / 2 + (y2 - 1) * INTERVAL, Rot = doRot ? Math.PI / 2 : 0.0, }; this.DrawPos_05 = new DrawPosInfo() { X = x2 * PIECE_XY_STEP + PIECE_WH / 2, Y = y2 * PIECE_XY_STEP + PIECE_WH / 2, Rot = doRot ? Math.PI / 2 : 0.0, }; }