Skip to content

Commit 51ab171

Browse files
Droppping the prints
1 parent e7401d7 commit 51ab171

File tree

3 files changed

+19
-16
lines changed

3 files changed

+19
-16
lines changed

java/src/s2/Mopper.java

+6-6
Original file line numberDiff line numberDiff line change
@@ -14,11 +14,11 @@ public Mopper(RobotController handler) throws GameActionException {
1414
}
1515

1616
public void run() throws GameActionException {
17-
System.out.println("Starting mopper logic...");
17+
// System.out.println("Starting mopper logic...");
1818

1919
MapInfo currentTile = rc.senseMapInfo(rc.getLocation());
2020
if (currentTile.getPaint() != null && currentTile.getPaint().isEnemy() && rc.canAttack(rc.getLocation())) {
21-
System.out.println("Attacking enemy paint under itself.OVERRIDE.########################################");
21+
// System.out.println("Attacking enemy paint under itself.OVERRIDE.########################################");
2222
rc.attack(rc.getLocation(), false); // Use primary paint color
2323
return; // Exit this turn after attacking the square under itself
2424
}
@@ -63,9 +63,9 @@ public void run() throws GameActionException {
6363
} else {
6464
// Handle invalid swing or cooldown
6565
if (!rc.canMopSwing(bestDirection)) {
66-
System.out.println("Mop swing skipped: Can't swing in direction " + bestDirection);
66+
// System.out.println("Mop swing skipped: Can't swing in direction " + bestDirection);
6767
} else {
68-
System.out.println("Mop swing skipped: Action cooldown not expired.");
68+
// System.out.println("Mop swing skipped: Action cooldown not expired.");
6969
}
7070
// Pass onto the else block or fallback
7171
}
@@ -74,7 +74,7 @@ public void run() throws GameActionException {
7474

7575
if (bestDirection != null) {
7676
if (rc.isActionReady()) { // Check if the robot is ready to act
77-
System.out.println("Clearing enemy paint in direction: " + bestDirection);
77+
// System.out.println("Clearing enemy paint in direction: " + bestDirection);
7878

7979
// Declare and reset targetLoc
8080
MapLocation targetLoc = null;
@@ -87,7 +87,7 @@ public void run() throws GameActionException {
8787
rc.attack(targetLoc, false); // Use primary paint color to clear the tile
8888
}
8989
} else {
90-
System.out.println("Attack skipped: Action cooldown not expired.");
90+
// System.out.println("Attack skipped: Action cooldown not expired.");
9191
}
9292
} else {
9393
pathing_engine.Move();

java/src/s2/Splasher.java

+3
Original file line numberDiff line numberDiff line change
@@ -6,9 +6,12 @@
66
public class Splasher implements GenericRobotContoller {
77
RobotController rc;
88
Pathing pathing_engine;
9+
TowerEngager towerEngager;
10+
911
public Splasher(RobotController handler) throws GameActionException{
1012
rc = handler;
1113
pathing_engine = new Pathing(handler);
14+
towerEngager = new TowerEngager(rc);
1215
}
1316

1417
public void run() throws GameActionException{

java/src/s2/TowerEngager.java

+10-10
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ public boolean engageEnemyTower() throws GameActionException {
3838
if (robot != null && robot.getTeam() != rc.getTeam()) {
3939
int currentDistance = rc.getLocation().distanceSquaredTo(mapInfo.getMapLocation());
4040
if (currentDistance < minDistance) {
41-
System.out.println("We found something Boss! A tower?");
41+
// System.out.println("We found something Boss! A tower?");
4242
minDistance = currentDistance; // Update the minimum distance
4343
enemyTowerLocation = mapInfo.getMapLocation(); // Update the closest tower
4444
}
@@ -58,11 +58,11 @@ public boolean engageEnemyTower() throws GameActionException {
5858
return false; // Exit the function if no enemy tower is found
5959
}
6060

61-
System.out.println("Enemy tower detected at: " + enemyTowerLocation);
61+
// System.out.println("Enemy tower detected at: " + enemyTowerLocation);
6262

6363
// Check if the enemy tower is already a ruin
6464
if (enemyLocations.contains(enemyTowerLocation) && rc.senseRobotAtLocation(enemyTowerLocation) == null) {
65-
System.out.println("Enemy tower has been destroyed (turned into a ruin).");
65+
// System.out.println("Enemy tower has been destroyed (turned into a ruin).");
6666
enemyLocations.remove(enemyTowerLocation); // Remove the tower's location from the HashSet
6767
return false; // Exit as there is no active enemy tower at this location
6868
}
@@ -76,10 +76,10 @@ public boolean engageEnemyTower() throws GameActionException {
7676

7777
// Move one step towards the enemy tower if possible
7878
// Check if the robot is outside the tower's attack range but can still see it
79-
System.out.println("Debug Before Cooldown Check: Movement=" + rc.getMovementCooldownTurns() + ", Action=" + rc.getActionCooldownTurns());
79+
// System.out.println("Debug Before Cooldown Check: Movement=" + rc.getMovementCooldownTurns() + ", Action=" + rc.getActionCooldownTurns());
8080
if (rc.getMovementCooldownTurns() > 0 || rc.getActionCooldownTurns() > 0) { //IMPORTANT RUNNING WITH 0 IS OPTIMAL BUT SHOUDL TWEAK LATER
81-
System.out.println("Movement cooldown: " + rc.getMovementCooldownTurns());
82-
System.out.println("Cooldowns too high, skipping engagement. Action cooldown is:" + rc.getActionCooldownTurns());
81+
// System.out.println("Movement cooldown: " + rc.getMovementCooldownTurns());
82+
// System.out.println("Cooldowns too high, skipping engagement. Action cooldown is:" + rc.getActionCooldownTurns());
8383
return true;
8484
}
8585

@@ -89,13 +89,13 @@ public boolean engageEnemyTower() throws GameActionException {
8989
rc.getMovementCooldownTurns() == 0 && rc.getActionCooldownTurns() == 0) {
9090
if (rc.canMove(towardsTower)) {
9191
rc.move(towardsTower);
92-
System.out.println("Moved towards enemy tower at: " + enemyTowerLocation);
92+
// System.out.println("Moved towards enemy tower at: " + enemyTowerLocation);
9393

9494
//Attacking sequence added here:
9595
// Attack the tower after moving closer
9696
if (rc.canAttack(enemyTowerLocation)) {
9797
rc.attack(enemyTowerLocation); // Attack the tower
98-
System.out.println("Attacked enemy tower after moving closer: " + enemyTowerLocation);
98+
// System.out.println("Attacked enemy tower after moving closer: " + enemyTowerLocation);
9999
}
100100

101101
return true; // Exit after taking one step
@@ -111,11 +111,11 @@ public boolean engageEnemyTower() throws GameActionException {
111111

112112
if (rc.canAttack(enemyTowerLocation)) {
113113
rc.attack(enemyTowerLocation); // Attack the tower
114-
System.out.println("Attacked enemy tower before retreating: " + enemyTowerLocation);
114+
// System.out.println("Attacked enemy tower before retreating: " + enemyTowerLocation);
115115
}
116116

117117
rc.move(awayFromTower);
118-
System.out.println("Moved away from enemy tower to avoid attack.");
118+
// System.out.println("Moved away from enemy tower to avoid attack.");
119119
return true; // Move away from the tower successfully
120120
}
121121
}

0 commit comments

Comments
 (0)