class Bomb implements Cloneable Comparable Bomb public Point m_pos pub

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
class Bomb implements Cloneable, Comparable<Bomb>
{
public Point m_pos;
public int m_radius;
public int m_timer;
public Bomb (Point _pos, int _damage, int _time) {
m_pos = _pos;
m_radius = _damage;
m_timer = _time;
}
public Bomb clone() {
Bomb copy = new Bomb(m_pos, m_radius, m_timer);
return copy;
}
public int compareTo(Bomb _b) {
Bomb bomb = _b;
if (m_timer != bomb.m_timer) return m_timer - bomb.m_timer;
else return m_radius - bomb.m_radius;
}
}