-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathCollidableRect.java
More file actions
executable file
·81 lines (81 loc) · 2.14 KB
/
Copy pathCollidableRect.java
File metadata and controls
executable file
·81 lines (81 loc) · 2.14 KB
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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
/**
* An abstract class that sets and returns respective x and y coordinates.
*/
public abstract class CollidableRect
{
/*
*****************************************************************************************************************************************************
***** INSTANCE VARIABLES ****************************************************************************************************************************
*****************************************************************************************************************************************************
*/
private double _x1, _y1, _x2, _y2;
/*
*****************************************************************************************************************************************************
***** PROTECTED METHODS *****************************************************************************************************************************
*****************************************************************************************************************************************************
*/
/**
* Sets the given parameter to be the first x-value.
* @param x1 first x value
*/
protected void setX1(double x1)
{
_x1 = x1;
}
/**
* Sets the given parameter to be the first y-value.
* @param y1 first y value
*/
protected void setY1(double y1)
{
_y1 = y1;
}
/**
* Sets the given parameter to be the second x value
* @param x2 second x value
*/
protected void setX2(double x2)
{
_x2 = x2;
}
/**
* Sets the given parameter to be the second y value.
* @param y2 second y value
*/
protected void setY2(double y2)
{
_y2 = y2;
}
/**
* Gets the first x value.
* @return first x value
*/
protected double getX1()
{
return _x1;
}
/**
* Gets the first y value.
* @return first y value
*/
protected double getY1()
{
return _y1;
}
/**
* Gets the second x value.
* @return second x value
*/
protected double getX2()
{
return _x2;
}
/**
* Gets the second y value.
* @return second y value
*/
protected double getY2()
{
return _y2;
}
}