Skip to content

Commit 6218dc8

Browse files
committed
Revert "Merge pull request #254 from UQcsse3200/team-7-sprint-3"
This reverts commit 0ada62c, reversing changes made to 200e4af.
1 parent 0ada62c commit 6218dc8

28 files changed

+175
-554
lines changed
-1.88 MB
Binary file not shown.
-2.85 MB
Binary file not shown.
-1.96 MB
Binary file not shown.
767 Bytes
Loading
-107 KB
Loading
903 KB
Loading
74.7 KB
Loading

source/core/src/main/com/csse3200/game/GdxGame.java

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -163,8 +163,6 @@ private Screen newScreen(ScreenType screenType, boolean isContinue, String saveF
163163
return new BookScreen(this, BookPage.ENEMY_PAGE);
164164
case TOWER_BOOK:
165165
return new BookScreen(this, BookPage.TOWER_PAGE);
166-
case ACHIEVEMENT_BOOK:
167-
return new BookScreen(this, BookPage.ACHIEVEMENT_PAGE);
168166
case HERO_BOOK:
169167
return new BookScreen(this, BookPage.HERO_PAGE);
170168
default:
@@ -174,7 +172,7 @@ private Screen newScreen(ScreenType screenType, boolean isContinue, String saveF
174172

175173
public enum ScreenType {
176174
MAIN_MENU, MAIN_GAME, SETTINGS, SAVE_SELECTION, OPENING_CUTSCENE, VICTORY, DEFEAT,
177-
MAP_SELECTION, BOOK, CURRENCY_BOOK, ENEMY_BOOK, TOWER_BOOK, ACHIEVEMENT_BOOK, UPGRADES, HERO_BOOK
175+
MAP_SELECTION, BOOK, CURRENCY_BOOK, ENEMY_BOOK, TOWER_BOOK, UPGRADES, HERO_BOOK
178176
}
179177

180178
public void setOpeningCutsceneWithBackground(int backgroundIndex) {

source/core/src/main/com/csse3200/game/components/PlayerScoreComponent.java

Lines changed: 0 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,6 @@
22

33
import org.slf4j.Logger;
44
import org.slf4j.LoggerFactory;
5-
import com.csse3200.game.services.ServiceLocator;
65

76
/**
87
* Holds the player's points and notifies the HUD on change.
@@ -27,17 +26,6 @@ public void addPoints(int points) {
2726
int oldScore = totalScore;
2827
totalScore += points;
2928
logger.info("Added {} points to player score: {} -> {}", points, oldScore, totalScore);
30-
31-
// 更新GameScoreService的缓存
32-
try {
33-
var scoreService = ServiceLocator.getGameScoreService();
34-
if (scoreService != null && scoreService.isGameInProgress()) {
35-
scoreService.setCurrentScore(totalScore);
36-
}
37-
} catch (Exception e) {
38-
logger.debug("Could not update GameScoreService cache: {}", e.getMessage());
39-
}
40-
4129
if (entity != null) {
4230
entity.getEvents().trigger("updateScore", totalScore);
4331
}

source/core/src/main/com/csse3200/game/components/book/BookComponent.java

Lines changed: 0 additions & 66 deletions
Original file line numberDiff line numberDiff line change
@@ -3,8 +3,6 @@
33
import com.csse3200.game.components.deck.*;
44
import com.csse3200.game.entities.configs.*;
55
import com.csse3200.game.files.FileLoader;
6-
import com.csse3200.game.services.AchievementService;
7-
import com.csse3200.game.services.ServiceLocator;
86
import org.slf4j.Logger;
97
import org.slf4j.LoggerFactory;
108

@@ -179,70 +177,6 @@ private static List<DeckComponent> createDecks() {
179177
}
180178
}
181179

182-
/**
183-
* A book component containing achievement decks.
184-
*/
185-
public static class AchievementBookComponent extends BookComponent {
186-
/** Constructs an achievement book component with all achievements. */
187-
public AchievementBookComponent() {
188-
super("ACHIEVEMENTS", createDecks());
189-
}
190-
191-
/**
192-
* Creates a list of achievement deck components.
193-
*
194-
* @return a list of {@link DeckComponent} for all achievements
195-
*/
196-
private static List<DeckComponent> createDecks() {
197-
List<DeckComponent> decks = new ArrayList<>();
198-
199-
// Get achievement service
200-
AchievementService achievementService = ServiceLocator.getAchievementService();
201-
202-
// Achievement definitions with descriptions and images
203-
addAchievement(decks, achievementService,
204-
AchievementService.TOUGH_SURVIVOR,
205-
"Tough Survivor",
206-
"Survive with minimal damage and prove your resilience.",
207-
"images/tough survivor.jpg");
208-
209-
addAchievement(decks, achievementService,
210-
AchievementService.SPEED_RUNNER,
211-
"Speed Runner",
212-
"Complete the level in record time.",
213-
"images/speed runner.jpg");
214-
215-
addAchievement(decks, achievementService,
216-
AchievementService.SLAYER,
217-
"Slayer",
218-
"Defeat a massive number of enemies.",
219-
"images/slayer.jpg");
220-
221-
addAchievement(decks, achievementService,
222-
AchievementService.PERFECT_CLEAR,
223-
"Perfect Clear",
224-
"Complete a level without taking any damage.",
225-
"images/perfect clear.jpg");
226-
227-
addAchievement(decks, achievementService,
228-
AchievementService.PARTICIPATION,
229-
"Participation",
230-
"Join the game and start your journey.",
231-
"images/participation.jpg");
232-
233-
return decks;
234-
}
235-
236-
/**
237-
* Helper method to add an achievement deck to the list.
238-
*/
239-
private static void addAchievement(List<DeckComponent> decks, AchievementService service,
240-
String achievementId, String name, String description, String image) {
241-
boolean locked = service == null || !service.isUnlocked(achievementId);
242-
decks.add(new AchievementBookDeckComponent(name, description, image, locked));
243-
}
244-
}
245-
246180
public static class HeroBookComponent extends BookComponent {
247181
public HeroBookComponent() {
248182
super("HEROES", createDecks());

0 commit comments

Comments
 (0)