-
Notifications
You must be signed in to change notification settings - Fork 317
Expand file tree
/
Copy path_Robot.java
More file actions
149 lines (135 loc) · 3.6 KB
/
Copy path_Robot.java
File metadata and controls
149 lines (135 loc) · 3.6 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
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
139
140
141
142
143
144
145
146
147
148
149
/*
* Copyright (c) 2001-2025 Mathew A. Nelson and Robocode contributors
* All rights reserved. This program and the accompanying materials
* are made available under the terms of the Eclipse Public License v1.0
* which accompanies this distribution, and is available at
* https://robocode.sourceforge.io/license/epl-v10.html
*/
package robocode;
/**
* This class is used by the system, as well as being a placeholder for all deprecated
* (meaning, you should not use them) calls for {@link Robot}.
* <p>
* You should create a {@link Robot} instead.
*
* @see Robot
* @see JuniorRobot
* @see AdvancedRobot
* @see TeamRobot
* @see RateControlRobot
*
* @author Mathew A. Nelson (original)
* @author Flemming N. Larsen (contributor)
* @author Pavel Savara (contributor)
*/
public abstract class _Robot extends _RobotBase {
private String robotImageName;
private String gunImageName;
private String radarImageName;
_Robot() {}
/**
* @return 5 - {@link robocode.Robot#getGunHeat() getGunHeat()}.
* @deprecated Use {@link Robot#getGunHeat() getGunHeat()} instead.
*/
@Deprecated
public double getGunCharge() {
if (peer != null) {
return 5 - peer.getGunHeat();
}
uninitializedException();
return 0; // never called
}
/**
* @return the robot's current life/energy.
* @deprecated Use {@link Robot#getEnergy() getEnergy()} instead.
*/
@Deprecated
public double getLife() {
if (peer != null) {
return peer.getEnergy();
}
uninitializedException();
return 0; // never called
}
/**
* @return the number of rounds in the current battle
* @deprecated Use {@link Robot#getNumRounds() getNumRounds()} instead.
*/
@Deprecated
public int getNumBattles() {
if (peer != null) {
return peer.getNumRounds();
}
uninitializedException();
return 0; // never called
}
/**
* @return the current round number of the battle (zero indexed).
* @deprecated Use {@link Robot#getRoundNum() getRoundNum()} instead.
*/
@Deprecated
public int getBattleNum() {
if (peer != null) {
return peer.getRoundNum();
}
uninitializedException();
return 0; // never called
}
/**
* This call has moved to {@link AdvancedRobot}, and will no longer function in
* the {@link Robot} class.
*
* @param interruptible {@code true} if the event handler should be
* interrupted if new events of the same priority occurs; {@code false}
* otherwise
*/
public void setInterruptible(boolean interruptible) {}
/**
* @return the name of the gun image
* @deprecated This call is not used.
*/
@Deprecated
public String getGunImageName() {
return gunImageName;
}
/**
* @param newGunImageName the name of the new gun image
* @deprecated This call is not used.
*/
@Deprecated
public void setGunImageName(String newGunImageName) {
gunImageName = newGunImageName;
}
/**
* @param newRadarImageName the name of the new radar image
* @deprecated This call is not used.
*/
@Deprecated
public void setRadarImageName(String newRadarImageName) {
radarImageName = newRadarImageName;
}
/**
* @param newRobotImageName the name of the new robot body image
* @deprecated This call is not used.
*/
@Deprecated
public void setRobotImageName(String newRobotImageName) {
robotImageName = newRobotImageName;
}
/**
* @return the name of the radar image
* @deprecated This call is not used.
*/
@Deprecated
public String getRadarImageName() {
return radarImageName;
}
/**
* @return the name of the robot image
* @deprecated This call is not used.
*/
@Deprecated
public String getRobotImageName() {
return robotImageName;
}
}