File tree Expand file tree Collapse file tree
engine/src/main/battlecode Expand file tree Collapse file tree Original file line number Diff line number Diff line change @@ -62,6 +62,24 @@ public interface RobotController {
6262 */
6363 Team getBackstabbingTeam ();
6464
65+ /**
66+ * Returns the number of active cat traps for the team.
67+ *
68+ * @return the number of active cat traps this team has.
69+ *
70+ * @battlecode.doc.costlymethod
71+ */
72+ int getNumberCatTraps ();
73+
74+ /**
75+ * Returns the number of active rat traps for the team.
76+ *
77+ * @return the number of active rat traps this team has.
78+ *
79+ * @battlecode.doc.costlymethod
80+ */
81+ int getNumberRatTraps ();
82+
6583 // *********************************
6684 // ****** UNIT QUERY METHODS *******
6785 // *********************************
Original file line number Diff line number Diff line change @@ -165,6 +165,16 @@ public int getDirt() {
165165 return this .gameWorld .getTeamInfo ().getDirt (getTeam ());
166166 }
167167
168+ @ Override
169+ public int getNumberCatTraps (){
170+ return this .gameWorld .getTrapCount (TrapType .CAT_TRAP , this .getTeam ());
171+ }
172+
173+ @ Override
174+ public int getNumberRatTraps (){
175+ return this .gameWorld .getTrapCount (TrapType .RAT_TRAP , this .getTeam ());
176+ }
177+
168178 @ Override
169179 public UnitType getType () {
170180 return this .robot .getType ();
You can’t perform that action at this time.
0 commit comments