chore: public -> protected

This commit is contained in:
2025-12-31 22:26:47 +01:00
parent 7ae808a23c
commit 47b487b0f1
2 changed files with 12 additions and 12 deletions

View File

@@ -38,7 +38,7 @@ public class GameRoom {
} }
public void addObject(GameObject gameObject) { public void addObject(GameObject gameObject) {
objects.addFirst(gameObject); objects.add(gameObject);
} }
public void addCollider(GameRoomPart collider) { public void addCollider(GameRoomPart collider) {
@@ -48,7 +48,7 @@ public class GameRoom {
public void setLeft(GameRoom left) { public void setLeft(GameRoom left) {
setLeft(left, true); setLeft(left, true);
} }
public void setLeft(GameRoom left, boolean addReference) { protected void setLeft(GameRoom left, boolean addReference) {
this.left = left; this.left = left;
if (addReference) { if (addReference) {
left.setRight(this, false); left.setRight(this, false);
@@ -57,7 +57,7 @@ public class GameRoom {
public void setRight(GameRoom right) { public void setRight(GameRoom right) {
setRight(right, true); setRight(right, true);
} }
public void setRight(GameRoom right, boolean addReference) { protected void setRight(GameRoom right, boolean addReference) {
this.right = right; this.right = right;
if (addReference) { if (addReference) {
right.setLeft(this, false); right.setLeft(this, false);
@@ -66,7 +66,7 @@ public class GameRoom {
public void setUp(GameRoom up) { public void setUp(GameRoom up) {
setUp(up, true); setUp(up, true);
} }
public void setUp(GameRoom up, boolean addReference) { protected void setUp(GameRoom up, boolean addReference) {
this.up = up; this.up = up;
if (addReference) { if (addReference) {
up.setDown(this, false); up.setDown(this, false);
@@ -75,7 +75,7 @@ public class GameRoom {
public void setDown(GameRoom down) { public void setDown(GameRoom down) {
setDown(down, true); setDown(down, true);
} }
public void setDown(GameRoom down, boolean addReference) { protected void setDown(GameRoom down, boolean addReference) {
this.down = down; this.down = down;
if (addReference) { if (addReference) {
down.setUp(this, false); down.setUp(this, false);

View File

@@ -15,7 +15,7 @@ import cz.jzitnik.utils.DependencyManager;
import cz.jzitnik.utils.events.EventManager; import cz.jzitnik.utils.events.EventManager;
public class GameMenuScene extends Scene { public class GameMenuScene extends Scene {
private static class GameMenuScreen extends Screen { private static class GameMenuAudioScreen extends Screen {
protected final SoundPlayer soundPlayer = new SoundPlayer(); protected final SoundPlayer soundPlayer = new SoundPlayer();
protected boolean play = true; protected boolean play = true;
@@ -47,18 +47,18 @@ public class GameMenuScene extends Scene {
@InjectDependency @InjectDependency
private EventManager eventManager; private EventManager eventManager;
private final GameMenuScreen gameMenuScreen; private final GameMenuAudioScreen gameMenuAudioScreen;
public ImageScene(String filePath, GameMenuScreen gameMenuScreen) { public ImageScene(String filePath, GameMenuAudioScreen gameMenuAudioScreen) {
super(filePath); super(filePath);
this.gameMenuScreen = gameMenuScreen; this.gameMenuAudioScreen = gameMenuAudioScreen;
} }
@Override @Override
public void handleKeyboardAction(KeyboardPressEvent event) { public void handleKeyboardAction(KeyboardPressEvent event) {
if (event.getKeyStroke().getKeyType() == KeyType.Enter) { if (event.getKeyStroke().getKeyType() == KeyType.Enter) {
gameMenuScreen.play = false; gameMenuAudioScreen.play = false;
gameMenuScreen.soundPlayer.stopCurrentSound(); gameMenuAudioScreen.soundPlayer.stopCurrentSound();
gameState.setScreen(null); gameState.setScreen(null);
eventManager.emitEvent(new FullRoomDraw(true)); eventManager.emitEvent(new FullRoomDraw(true));
} }
@@ -66,7 +66,7 @@ public class GameMenuScene extends Scene {
} }
public GameMenuScene(DependencyManager dependencyManager) { public GameMenuScene(DependencyManager dependencyManager) {
GameMenuScreen gameMenuScreen = new GameMenuScreen(); GameMenuAudioScreen gameMenuScreen = new GameMenuAudioScreen();
ImageScene basicImageScene = new ImageScene("menu.png", gameMenuScreen); ImageScene basicImageScene = new ImageScene("menu.png", gameMenuScreen);
super(new Screen[]{gameMenuScreen, basicImageScene}, new OnEndAction.Repeat()); super(new Screen[]{gameMenuScreen, basicImageScene}, new OnEndAction.Repeat());