Skip to content

Commit

Permalink
Fixed some coding issues
Browse files Browse the repository at this point in the history
  • Loading branch information
tonihele committed Jul 5, 2024
1 parent c45f5ba commit 0221603
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@
*/
public abstract class RoomTraineeControl extends AbstractRoomObjectControl<EntityId> {

public RoomTraineeControl(KwdFile kwdFile, IRoomController parent, IObjectsController objectsController, IGameTimer gameTimer) {
protected RoomTraineeControl(KwdFile kwdFile, IRoomController parent, IObjectsController objectsController, IGameTimer gameTimer) {
super(kwdFile, parent, objectsController, gameTimer);
}

Expand Down
18 changes: 10 additions & 8 deletions src/toniarts/openkeeper/game/task/TaskManager.java
Original file line number Diff line number Diff line change
Expand Up @@ -656,27 +656,29 @@ private static Integer getShortestDistance(Point currentPosition, Point... coord

private AbstractTask getRoomTask(ObjectType objectType, Point target, EntityId targetEntity, ICreatureController creature, IRoomController room) {
switch (objectType) {
case GOLD: {
case GOLD -> {
return new CarryGoldToTreasuryTask(navigationService, mapController, target, creature.getOwnerId(), room, gameWorldController);
}
case LAIR: {
case LAIR -> {
return new ClaimLair(navigationService, mapController, target, creature.getOwnerId(), room, this);
}
case RESEARCHER: {
case RESEARCHER -> {
return new Research(navigationService, mapController, target, creature.getOwnerId(), room, this, playerControllers.get(creature.getOwnerId()).getResearchControl(), objectsController);
}
case PRISONER: {
case PRISONER -> {
return new CarryEnemyCreatureToPrison(navigationService, mapController, target, creature.getOwnerId(), room, this, creaturesController.createController(targetEntity));
}
case SPECIAL:
case SPELL_BOOK: {
case SPECIAL, SPELL_BOOK -> {
return new CarryObjectToStorageTask(navigationService, mapController, target, creature.getOwnerId(), room, this, objectsController.createController(targetEntity));
}
case TRAINEE: {
case TRAINEE -> {
return new Train(navigationService, mapController, target, creature.getOwnerId(), room, this, gameWorldController, gameSettings, playerControllers.get(creature.getOwnerId()));
}
default -> {
logger.log(Level.DEBUG, "No task defined for " + objectType);
return null;
}
}
return null;
}

protected void removeRoomTask(AbstractCapacityCriticalRoomTask task) {
Expand Down

0 comments on commit 0221603

Please sign in to comment.