Newer
Older
* ----------------------------------------------------------------------------------
* "THE BEER-WARE LICENSE" (Revision 42):
* <martinv@students.zcu.cz> wrote this file. As long as you retain this notice you
* can do whatever you want with this stuff. If we meet some day, and you think
* this stuff is worth it, you can buy me a beer in return. Martin Vítek
* ----------------------------------------------------------------------------------
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
*/
package cz.zcu.martinv.MyRobocodeRobots;
import java.util.Objects;
import robocode.ScannedRobotEvent;
/**
*
* @author martin.vitek
*/
public class EnemyRobotStatus
{
private String name;
private double bearing;
private double distance;
private double energy;
private double heading;
private double velocity;
/**
*
* @param name
* @param bearing
* @param distance
* @param energy
* @param heading
* @param velocity
*/
public EnemyRobotStatus(String name, double bearing, double distance, double energy, double heading, double velocity)
{
this.name = name;
this.bearing = bearing;
this.distance = distance;
this.energy = energy;
this.heading = heading;
this.velocity = velocity;
}
public EnemyRobotStatus(ScannedRobotEvent e)
{
this.name = e.getName();
this.bearing = e.getBearing();
this.distance = e.getDistance();
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
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
this.heading = e.getHeading();
this.velocity = e.getVelocity();
}
@Override
public boolean equals(Object obj)
{
if (this == obj)
{
return true;
}
if (obj == null)
{
return false;
}
if (getClass() != obj.getClass())
{
return false;
}
final EnemyRobotStatus other = (EnemyRobotStatus) obj;
if (!Objects.equals(this.name, other.name))
{
return false;
}
return true;
}
public String getName()
{
return name;
}
public void setName(String name)
{
this.name = name;
}
public double getBearing()
{
return bearing;
}
public void setBearing(double bearing)
{
this.bearing = bearing;
}
public double getDistance()
{
return distance;
}
public void setDistance(double distance)
{
this.distance = distance;
}
public double getEnergy()
{
return energy;
}
public void setEnergy(double energy)
{
this.energy = energy;
}
public double getHeading()
{
return heading;
}
public void setHeading(double heading)
{
this.heading = heading;
}
public double getVelocity()
{
return velocity;
}
public void setVelocity(double velocity)
{
this.velocity = velocity;
}
}