Skip to content

Commit

Permalink
Added enum of turrets for turret selection screen
Browse files Browse the repository at this point in the history
  • Loading branch information
Hasakev committed Sep 10, 2023
1 parent fba86b6 commit a2af71f
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
27 changes: 27 additions & 0 deletions source/core/src/main/com/csse3200/game/screens/TowerType.java
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
package com.csse3200.game.screens;

public enum TowerType {
WEAPON("images/towers/turret01.atlas", "Weapon Tower"),
TNT("images/towers/TNTTower.atlas", "TNT Tower"),
DROID("images/towers/DroidTower.atlas", "Droid Tower"),
WALL("images/towers/wallTower.png", "Wall Tower"),
FIRE("images/towers/fire_tower_atlas.atlas", "Fire Tower"),
STUN("images/towers/stun_tower.atlas", "Stun Tower"),
ECONOMY("images/economy/econ-tower.atlas", "Income Tower");

private final String imagePath;
private final String towerName;

TowerType(String imagePath, String towerName) {
this.imagePath = imagePath;
this.towerName = towerName;
}

public String getImagePath() {
return imagePath;
}

public String getTowerName() {
return towerName;
}
}
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,8 @@
import com.csse3200.game.physics.PhysicsService;
import com.csse3200.game.services.ResourceService;
import com.csse3200.game.services.ServiceLocator;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;

import java.util.*;

Expand All @@ -29,6 +31,7 @@ public class TurretSelectionScreen extends ScreenAdapter {
private GdxGame game;

private Set<String> selectedTurrets = new HashSet<>();
private static final Logger logger = LoggerFactory.getLogger(MainMenuScreen.class);

public TurretSelectionScreen(GdxGame game) {
this.game = game;
Expand Down Expand Up @@ -63,9 +66,12 @@ public void clicked(InputEvent event, float x, float y) {
// Turret is already selected, unselect it
selectedTurrets.remove(turret);
// You can also change the button appearance to indicate unselection
//logger.info(selectedTurrets.toString());
} else {
// Turret is not selected, select it
selectedTurrets.add(turret);
//logger.info(selectedTurrets.toString());

// You can change the button appearance to indicate selection
}
}
Expand Down

0 comments on commit a2af71f

Please sign in to comment.