-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathShape.java
58 lines (37 loc) · 1.69 KB
/
Shape.java
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
package org.vkedco.mobappdev.draw_touch_drive_00001;
public class Shape {
protected float mStartX = 0f;
protected float mStartY = 0f;
protected float mCurrentX = 30f; // current x coordinate of ChessPiece
protected float mCurrentY = 30f; // current y coordinate of ChessPiece
protected float mActionDownX; // x coordinate of ChessPiece of an action down
protected float mActionDownY; // y coordinate of ChessPiece of an action down
protected float mActionMoveOffsetX; // x coordinate of a move action
protected float mActionMoveOffsetY; // y coordinate of a move action
public Shape(float x, float y) {
mStartX = x;
mStartY = y;
mCurrentX = x;
mCurrentY = y;
}
public float getStartX() { return mCurrentX; }
public float getStartY() { return mCurrentY; }
public void setStartX(float x) { mStartX = x; }
public void setStartY(float y) { mStartY = y; }
public float getCurrentX() { return mCurrentX; }
public float getCurrentY() { return mCurrentY; }
public void setCurrentX(float x) { mCurrentX = x; }
public void setCurrentY(float y) { mCurrentY = y; }
public void setActionMoveOffsetX(float x) { mActionMoveOffsetX = x; }
public void setActionMoveOffsetY(float y) { mActionMoveOffsetY = y; }
public float getActionMoveOffsetX() { return mActionMoveOffsetX; }
public float getActionMoveOffsetY() { return mActionMoveOffsetY; }
public void setActionDownX(float x) { mActionDownX = x; }
public void setActionDownY(float y) { mActionDownY = y; }
public float getActionDownX() { return mActionDownX; }
public float getActionDownY() { return mActionDownY; }
public void restoreStartPosition() {
mCurrentX = mStartX;
mCurrentY = mStartY;
}
}