Compare commits
	
		
			22 Commits
		
	
	
		
			7b82b20736
			...
			b_wilkenin
		
	
	| Author | SHA1 | Date | |
|---|---|---|---|
|  | 1f4ebdb630 | ||
|  | 1f5c8ba4a6 | ||
|  | 0cdd345ab5 | ||
|  | ba837d4016 | ||
|  | 28d9cb10e5 | ||
|  | 21553ec52e | ||
|  | 5f79e8e00c | ||
|  | 03adf45167 | ||
|  | 17c4fca078 | ||
|  | 16620a0a3b | ||
|  | 2028d936e3 | ||
|  | 21fc46f9c5 | ||
|  | dc52cf4f32 | ||
|  | c339f3fc9d | ||
|  | de0b2a4054 | ||
|  | 67e4c1e805 | ||
|  | 0a66d3cbfd | ||
|  | 30d129735c | ||
|  | 5f91ce0947 | ||
|  | fae747e504 | ||
|  | 64834e8bf1 | ||
|  | 8f08e83358 | 
							
								
								
									
										1
									
								
								.gitignore
									
									
									
									
										vendored
									
									
								
							
							
						
						| @@ -4,7 +4,6 @@ build | ||||
|  | ||||
| # VSC | ||||
| bin | ||||
| .vscode | ||||
|  | ||||
| # IntelliJ | ||||
| *.iml | ||||
|   | ||||
| @@ -1,18 +0,0 @@ | ||||
| <component name="ProjectRunConfigurationManager"> | ||||
|     <configuration default="false" name="MonopolyApp (Mac)" type="Application" factoryName="Application" | ||||
|                    singleton="false"> | ||||
|         <option name="MAIN_CLASS_NAME" value="pp.monopoly.client.MonopolyApp"/> | ||||
|         <module name="Projekte.monopoly.client.main"/> | ||||
|         <option name="VM_PARAMETERS" value="-XstartOnFirstThread"/> | ||||
|         <option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/> | ||||
|         <extension name="coverage"> | ||||
|             <pattern> | ||||
|                 <option name="PATTERN" value="pp.monopoly.client.*"/> | ||||
|                 <option name="ENABLED" value="true"/> | ||||
|             </pattern> | ||||
|         </extension> | ||||
|         <method v="2"> | ||||
|             <option name="Make" enabled="true"/> | ||||
|         </method> | ||||
|     </configuration> | ||||
| </component> | ||||
| @@ -1,18 +0,0 @@ | ||||
| <component name="ProjectRunConfigurationManager"> | ||||
|   <configuration default="false" name="MonopolyApp" type="Application" factoryName="Application" singleton="false" | ||||
|                  nameIsGenerated="true"> | ||||
|     <option name="MAIN_CLASS_NAME" value="pp.monopoly.client.MonopolyApp"/> | ||||
|     <module name="Projekte.monopoly.client.main"/> | ||||
|     <option name="VM_PARAMETERS" value="-Djava.util.logging.config.file=logging.properties"/> | ||||
|     <option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/> | ||||
|     <extension name="coverage"> | ||||
|       <pattern> | ||||
|         <option name="PATTERN" value="pp.monopoly.client.*"/> | ||||
|         <option name="ENABLED" value="true"/> | ||||
|       </pattern> | ||||
|     </extension> | ||||
|     <method v="2"> | ||||
|       <option name="Make" enabled="true"/> | ||||
|     </method> | ||||
|   </configuration> | ||||
| </component> | ||||
| @@ -1,17 +0,0 @@ | ||||
| <component name="ProjectRunConfigurationManager"> | ||||
|   <configuration default="false" name="MonopolyServer" type="Application" factoryName="Application" | ||||
|                  nameIsGenerated="true"> | ||||
|     <option name="MAIN_CLASS_NAME" value="pp.monopoly.server.MonopolyServer"/> | ||||
|     <module name="Projekte.monopoly.server.main"/> | ||||
|     <option name="WORKING_DIRECTORY" value="$MODULE_WORKING_DIR$"/> | ||||
|     <extension name="coverage"> | ||||
|       <pattern> | ||||
|         <option name="PATTERN" value="pp.monopoly.server.*"/> | ||||
|         <option name="ENABLED" value="true"/> | ||||
|       </pattern> | ||||
|     </extension> | ||||
|     <method v="2"> | ||||
|       <option name="Make" enabled="true"/> | ||||
|     </method> | ||||
|   </configuration> | ||||
| </component> | ||||
| @@ -9,7 +9,6 @@ dependencies { | ||||
|     implementation project(":battleship:model") | ||||
|  | ||||
|     implementation libs.jme3.desktop | ||||
|     implementation libs.jme3.effects | ||||
|  | ||||
|     runtimeOnly libs.jme3.awt.dialogs | ||||
|     runtimeOnly libs.jme3.plugins | ||||
|   | ||||
| @@ -9,7 +9,7 @@ | ||||
| # | ||||
| # Specifies the map used by the opponent in single mode. | ||||
| # Single mode is activated if this property is set. | ||||
| #map.opponent=maps/map2.json | ||||
| map.opponent=maps/map2.json | ||||
| # | ||||
| # Specifies the map used by the player in single mode. | ||||
| # The player must define their own map if this property is not set. | ||||
|   | ||||
							
								
								
									
										66
									
								
								Projekte/battleship/client/maps/map3.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,66 @@ | ||||
| { | ||||
|   "width": 10, | ||||
|   "height": 10, | ||||
|   "ships": [ | ||||
|     { | ||||
|       "length": 4, | ||||
|       "x": 15, | ||||
|       "y": 5, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 0, | ||||
|       "y": 9, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 2, | ||||
|       "y": 6, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 4, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 4, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 1, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										66
									
								
								Projekte/battleship/client/maps/map4.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,66 @@ | ||||
| { | ||||
|   "width": 10, | ||||
|   "height": 10, | ||||
|   "ships": [ | ||||
|     { | ||||
|       "length": 4, | ||||
|       "x": 0, | ||||
|       "y": 5, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 0, | ||||
|       "y": 9, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 2, | ||||
|       "y": 6, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 0, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 4, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 1, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										66
									
								
								Projekte/battleship/client/maps/map5.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,66 @@ | ||||
| { | ||||
|   "width": 10, | ||||
|   "height": 10, | ||||
|   "ships": [ | ||||
|     { | ||||
|       "length": 4, | ||||
|       "x": 0, | ||||
|       "y": 5, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 0, | ||||
|       "y": 9, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 0, | ||||
|       "y": 6, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 4, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 4, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 1, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										60
									
								
								Projekte/battleship/client/maps/map6.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,60 @@ | ||||
| { | ||||
|   "width": 10, | ||||
|   "height": 10, | ||||
|   "ships": [ | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 0, | ||||
|       "y": 9, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 2, | ||||
|       "y": 6, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 4, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 4, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 1, | ||||
|       "rot": "DOWN" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										66
									
								
								Projekte/battleship/client/maps/map7.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,66 @@ | ||||
| { | ||||
|   "width": 10, | ||||
|   "height": 10, | ||||
|   "ships": [ | ||||
|     { | ||||
|       "length": 4, | ||||
|       "x": 0, | ||||
|       "y": 9, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 4, | ||||
|       "y": 9, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 7, | ||||
|       "y": 9, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 0, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 2, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 4, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 6, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 7, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 8, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 9, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
							
								
								
									
										66
									
								
								Projekte/battleship/client/maps/map8.json
									
									
									
									
									
										Normal file
									
								
							
							
						
						| @@ -0,0 +1,66 @@ | ||||
| { | ||||
|   "width": 10, | ||||
|   "height": 10, | ||||
|   "ships": [ | ||||
|     { | ||||
|       "length": 4, | ||||
|       "x": 0, | ||||
|       "y": 9, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 0, | ||||
|       "y": 8, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 3, | ||||
|       "x": 0, | ||||
|       "y": 7, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 0, | ||||
|       "y": 6, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 0, | ||||
|       "y": 5, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 2, | ||||
|       "x": 0, | ||||
|       "y": 4, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 0, | ||||
|       "y": 3, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 0, | ||||
|       "y": 2, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 0, | ||||
|       "y": 1, | ||||
|       "rot": "RIGHT" | ||||
|     }, | ||||
|     { | ||||
|       "length": 1, | ||||
|       "x": 0, | ||||
|       "y": 0, | ||||
|       "rot": "RIGHT" | ||||
|     } | ||||
|   ] | ||||
| } | ||||
| @@ -22,7 +22,6 @@ import com.simsilica.lemur.GuiGlobals; | ||||
| import com.simsilica.lemur.style.BaseStyles; | ||||
| import pp.battleship.client.gui.BattleAppState; | ||||
| import pp.battleship.client.gui.EditorAppState; | ||||
| import pp.battleship.client.gui.GameMusic; | ||||
| import pp.battleship.client.gui.SeaAppState; | ||||
| import pp.battleship.game.client.BattleshipClient; | ||||
| import pp.battleship.game.client.ClientGameLogic; | ||||
| @@ -283,14 +282,15 @@ public class BattleshipApp extends SimpleApplication implements BattleshipClient | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Attaches the background music state and sets its initial enabled state. | ||||
|      * Attaches the music state and sets its initial enabled state. | ||||
|      */ | ||||
|     private void attachGameMusic() { | ||||
|         final GameMusic gameSound = new GameMusic(); | ||||
|         gameSound.setEnabled(GameMusic.enabledInPreferences()); | ||||
|         stateManager.attach(gameSound); | ||||
|         final GameMusic gameMusic = new GameMusic(); | ||||
|         gameMusic.setEnabled(GameMusic.enabledInPreferences()); | ||||
|         stateManager.attach(gameMusic); | ||||
|     } | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Updates the application state every frame. | ||||
|      * This method is called once per frame during the game loop. | ||||
|   | ||||
| @@ -1,4 +1,4 @@ | ||||
| package pp.battleship.client.gui; | ||||
| package pp.battleship.client; | ||||
| 
 | ||||
| import static pp.util.PreferencesUtils.getPreferences; | ||||
| 
 | ||||
| @@ -14,9 +14,6 @@ import com.jme3.asset.AssetNotFoundException; | ||||
| import com.jme3.audio.AudioData; | ||||
| import com.jme3.audio.AudioNode; | ||||
| 
 | ||||
| /** | ||||
|  * Handles the background music beeing played. Is able to start and stop the music. Set the Volume of the Audio. | ||||
|  */ | ||||
| public class GameMusic extends AbstractAppState{ | ||||
|     private static final Logger LOGGER = System.getLogger(GameMusic.class.getName()); | ||||
|     private static final Preferences PREFERENCES = getPreferences(GameMusic.class); | ||||
| @@ -34,10 +31,10 @@ public class GameMusic extends AbstractAppState{ | ||||
|         return PREFERENCES.getBoolean(ENABLED_PREF, true); | ||||
|     } | ||||
| 
 | ||||
|         /** | ||||
|     /** | ||||
|      * Checks if sound is enabled in the preferences. | ||||
|      * | ||||
|      * @return float to which the volume is set | ||||
|      * | ||||
|      */ | ||||
|     public static float volumeInPreferences() { | ||||
|         return PREFERENCES.getFloat(VOLUME_PREF, 0.5f); | ||||
| @@ -53,7 +50,7 @@ public class GameMusic extends AbstractAppState{ | ||||
|     @Override | ||||
|     public void initialize(AppStateManager stateManager, Application app) { | ||||
|         super.initialize(stateManager, app); | ||||
|         music = loadSound(app, "Sound/background.ogg"); | ||||
|         music = loadSound(app, "Sound/DasBootMenu.ogg"); | ||||
|         setVolume(volumeInPreferences()); | ||||
|         music.setLooping(true); | ||||
|         if (isEnabled() && music != null) { | ||||
| @@ -90,15 +87,11 @@ public class GameMusic extends AbstractAppState{ | ||||
|     @Override | ||||
|     public void setEnabled(boolean enabled) { | ||||
|         if (isEnabled() == enabled) return; | ||||
| 
 | ||||
|         if (music != null) { | ||||
|             if (enabled) { | ||||
|                 music.play(); | ||||
|             } else { | ||||
|                 music.stop(); | ||||
|             } | ||||
|         else if(!isEnabled() && enabled) { | ||||
|             if (music != null) music.play(); | ||||
|         } else if (isEnabled() && !enabled) { | ||||
|             if (music != null) music.stop(); | ||||
|         } | ||||
|      | ||||
|         super.setEnabled(enabled); | ||||
|         LOGGER.log(Level.INFO, "Sound enabled: {0}", enabled); //NON-NLS | ||||
|         PREFERENCES.putBoolean(ENABLED_PREF, enabled); | ||||
| @@ -111,10 +104,6 @@ public class GameMusic extends AbstractAppState{ | ||||
|         setEnabled(!isEnabled()); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * Sets the volume of music | ||||
|      * @param vol the volume to which the music should be set | ||||
|      */ | ||||
|     public void setVolume(float vol){ | ||||
|         music.setVolume(vol); | ||||
|         PREFERENCES.putFloat(VOLUME_PREF, vol); | ||||
| @@ -80,6 +80,7 @@ public class GameSound extends AbstractAppState implements GameEventListener { | ||||
|         splashSound = loadSound(app, "Sound/Effects/splash.wav"); //NON-NLS | ||||
|         explosionSound = loadSound(app, "Sound/Effects/explosion.wav"); //NON-NLS | ||||
|         shellFlyingSound = loadSound(app, "Sound/Effects/shell_flying.wav"); | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -147,6 +148,7 @@ public class GameSound extends AbstractAppState implements GameEventListener { | ||||
|             case SPLASH -> splash(); | ||||
|             case DESTROYED_SHIP -> shipDestroyed(); | ||||
|             case SHELL_FLYING -> shellFly(); | ||||
|  | ||||
|         } | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -7,22 +7,22 @@ | ||||
|  | ||||
| package pp.battleship.client; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| import java.util.prefs.Preferences; | ||||
|  | ||||
| import com.simsilica.lemur.Button; | ||||
| import com.simsilica.lemur.Checkbox; | ||||
| import com.simsilica.lemur.Label; | ||||
| import com.simsilica.lemur.style.ElementId; | ||||
|  | ||||
| import static pp.battleship.Resources.lookup; | ||||
| import pp.battleship.client.gui.GameMusic; | ||||
| import pp.dialog.Dialog; | ||||
| import pp.dialog.StateCheckboxModel; | ||||
| import pp.dialog.TextInputDialog; | ||||
| import pp.battleship.client.gui.VolumeSlider; | ||||
|  | ||||
| import pp.battleship.client.GameMusic; | ||||
| import pp.battleship.client.VolumeSlider; | ||||
|  | ||||
| import java.io.File; | ||||
| import java.io.IOException; | ||||
| import java.util.prefs.Preferences; | ||||
|  | ||||
| import static pp.battleship.Resources.lookup; | ||||
| import static pp.util.PreferencesUtils.getPreferences; | ||||
|  | ||||
| /** | ||||
| @@ -39,7 +39,7 @@ class Menu extends Dialog { | ||||
|     private final VolumeSlider slider; | ||||
|  | ||||
|     /** | ||||
|      * Constructs the Menu dialog for the Battleship application.+ | ||||
|      * Constructs the Menu dialog for the Battleship application. | ||||
|      * | ||||
|      * @param app the BattleshipApp instance | ||||
|      */ | ||||
| @@ -54,11 +54,14 @@ class Menu extends Dialog { | ||||
|  | ||||
|         addChild(slider); | ||||
|  | ||||
|         addChild(loadButton).addClickCommands(s -> ifTopDialog(this::loadDialog)); | ||||
|         addChild(saveButton).addClickCommands(s -> ifTopDialog(this::saveDialog)); | ||||
|         addChild(new Button(lookup("menu.return-to-game"))).addClickCommands(s -> ifTopDialog(this::close)); | ||||
|         addChild(new Button(lookup("menu.quit"))).addClickCommands(s -> ifTopDialog(app::closeApp)); | ||||
|          | ||||
|         addChild(loadButton) | ||||
|                 .addClickCommands(s -> ifTopDialog(this::loadDialog)); | ||||
|         addChild(saveButton) | ||||
|                 .addClickCommands(s -> ifTopDialog(this::saveDialog)); | ||||
|         addChild(new Button(lookup("menu.return-to-game"))) | ||||
|                 .addClickCommands(s -> ifTopDialog(this::close)); | ||||
|         addChild(new Button(lookup("menu.quit"))) | ||||
|                 .addClickCommands(s -> ifTopDialog(app::closeApp)); | ||||
|         update(); | ||||
|     } | ||||
|  | ||||
| @@ -71,11 +74,6 @@ class Menu extends Dialog { | ||||
|         saveButton.setEnabled(app.getGameLogic().maySaveMap()); | ||||
|     } | ||||
|  | ||||
|     @Override | ||||
|     public void update(float delta) { | ||||
|         slider.update(); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * As an escape action, this method closes the menu if it is the top dialog. | ||||
|      */ | ||||
| @@ -151,4 +149,13 @@ class Menu extends Dialog { | ||||
|     private void saveDialog() { | ||||
|         fileDialog(app.getGameLogic()::saveMap, lookup("menu.map.save")); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Updates the position of the volume control slider. | ||||
|      */ | ||||
|  | ||||
|     @Override | ||||
|     public void update(float delta) { | ||||
|         slider.update(); | ||||
|     } | ||||
| } | ||||
|   | ||||
| @@ -7,23 +7,23 @@ | ||||
|  | ||||
| package pp.battleship.client; | ||||
|  | ||||
| import java.lang.System.Logger; | ||||
| import java.lang.System.Logger.Level; | ||||
| import java.util.concurrent.ExecutionException; | ||||
| import java.util.concurrent.Future; | ||||
|  | ||||
| import com.simsilica.lemur.Button; | ||||
| import com.simsilica.lemur.Container; | ||||
| import com.simsilica.lemur.Label; | ||||
| import com.simsilica.lemur.TextField; | ||||
| import com.simsilica.lemur.component.SpringGridLayout; | ||||
|  | ||||
| import static pp.battleship.Resources.lookup; | ||||
| import pp.battleship.server.BattleshipServer; | ||||
| import pp.dialog.Dialog; | ||||
| import pp.dialog.DialogBuilder; | ||||
| import pp.dialog.SimpleDialog; | ||||
|  | ||||
| import java.lang.System.Logger; | ||||
| import java.lang.System.Logger.Level; | ||||
| import java.util.concurrent.ExecutionException; | ||||
| import java.util.concurrent.Future; | ||||
|  | ||||
| import static pp.battleship.Resources.lookup; | ||||
|  | ||||
| /** | ||||
|  * Represents a dialog for setting up a network connection in the Battleship game. | ||||
|  * Allows users to specify the host and port for connecting to a game server. | ||||
| @@ -31,7 +31,7 @@ import pp.dialog.SimpleDialog; | ||||
| class NetworkDialog extends SimpleDialog { | ||||
|     private static final Logger LOGGER = System.getLogger(NetworkDialog.class.getName()); | ||||
|     private static final String LOCALHOST = "localhost"; //NON-NLS | ||||
|     private static final String DEFAULT_PORT = "42069"; //NON-NLS | ||||
|     private static final String DEFAULT_PORT = "1234"; //NON-NLS | ||||
|     private final NetworkSupport network; | ||||
|     private final TextField host = new TextField(LOCALHOST); | ||||
|     private final TextField port = new TextField(DEFAULT_PORT); | ||||
|   | ||||
| @@ -1,21 +1,13 @@ | ||||
| package pp.battleship.client.gui; | ||||
| package pp.battleship.client; | ||||
| 
 | ||||
| import com.simsilica.lemur.Slider; | ||||
| 
 | ||||
| /** | ||||
|  * The VolumeSlider class represents the Volume Slider in the Menu. | ||||
|  * It extends the Slider class and provides functionalities for setting the music volume, | ||||
|  * with the help of the Slider in the GUI  | ||||
|  */ | ||||
| public class VolumeSlider extends Slider { | ||||
| 
 | ||||
|     private final GameMusic music; | ||||
| 
 | ||||
|     private double vol; | ||||
| 
 | ||||
|     /** | ||||
|      * Constructs the Volume Slider for the Menu dialog | ||||
|      * @param music the music instance | ||||
|      */ | ||||
|     public VolumeSlider(GameMusic music) { | ||||
|         super(); | ||||
|         this.music = music; | ||||
| @@ -23,14 +15,10 @@ public class VolumeSlider extends Slider { | ||||
|         getModel().setPercent(vol); | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * when triggered it updates the volume to the value set with the slider | ||||
|      */ | ||||
|     public void update() { | ||||
|         if (vol != getModel().getPercent()) { | ||||
|             vol = getModel().getPercent(); | ||||
|             music.setVolume( (float) vol); | ||||
|         } | ||||
|     } | ||||
|      | ||||
| } | ||||
| @@ -15,12 +15,10 @@ import com.jme3.scene.Geometry; | ||||
| import com.jme3.scene.Node; | ||||
| import com.jme3.scene.Spatial; | ||||
| import com.jme3.scene.shape.Sphere; | ||||
|  | ||||
| import pp.battleship.model.Battleship; | ||||
| import pp.battleship.model.Shell; | ||||
| import pp.battleship.model.Shot; | ||||
| import pp.util.Position; | ||||
|  | ||||
| import static com.jme3.material.Materials.UNSHADED; | ||||
|  | ||||
|  | ||||
| @@ -132,7 +130,7 @@ class MapViewSynchronizer extends ShipMapSynchronizer { | ||||
|         return view.getApp().getDraw().makeFatLine(x1, y1, x2, y2, SHIP_DEPTH, color, SHIP_LINE_WIDTH); | ||||
|     } | ||||
|  | ||||
|         /** | ||||
|     /** | ||||
|      * Creates and returns a Spatial representation of the given {@code Shell} object | ||||
|      * for 2D visualization in the game. The shell is represented as a circle. | ||||
|      * | ||||
| @@ -151,4 +149,5 @@ class MapViewSynchronizer extends ShipMapSynchronizer { | ||||
|         ellipse.addControl(new Shell2DControl(view, shell)); | ||||
|         return ellipse; | ||||
|     } | ||||
|  | ||||
| } | ||||
|   | ||||
| @@ -7,13 +7,10 @@ import com.jme3.material.Material; | ||||
| import com.jme3.math.ColorRGBA; | ||||
| import com.jme3.math.FastMath; | ||||
| import com.jme3.math.Vector3f; | ||||
| 
 | ||||
| import pp.battleship.client.BattleshipApp; | ||||
| 
 | ||||
| /** | ||||
|  * Factory class responsible for creating particle effects used in the game. | ||||
|  * This centralizes the creation of various types of particle emitters. | ||||
|  */ | ||||
| public class ParticleEffectFactory { | ||||
| public class ParticleCreator { | ||||
|     private static final int COUNT_FACTOR = 1; | ||||
|     private static final float COUNT_FACTOR_F = 1f; | ||||
|     private static final boolean POINT_SPRITE = true; | ||||
| @@ -21,7 +18,7 @@ public class ParticleEffectFactory { | ||||
| 
 | ||||
|     private final BattleshipApp app; | ||||
| 
 | ||||
|     ParticleEffectFactory(BattleshipApp app) { | ||||
|     ParticleCreator(BattleshipApp app) { | ||||
|         this.app = app; | ||||
|     } | ||||
| 
 | ||||
| @@ -30,7 +27,8 @@ public class ParticleEffectFactory { | ||||
|      * | ||||
|      * @return a configured flame particle emitter | ||||
|      */ | ||||
|     ParticleEmitter createFlame() { | ||||
| 
 | ||||
|      ParticleEmitter createFlame(){ | ||||
|         ParticleEmitter flame = new ParticleEmitter("Flame", EMITTER_TYPE, 32 * COUNT_FACTOR); | ||||
|         flame.setSelectRandomImage(true); | ||||
|         flame.setStartColor(new ColorRGBA(1f, 0.4f, 0.05f, (1f / COUNT_FACTOR_F))); | ||||
| @@ -125,9 +123,9 @@ public class ParticleEffectFactory { | ||||
|         spark.setFacingVelocity(true); | ||||
|         spark.setParticlesPerSec(0); | ||||
|         spark.setGravity(0, 5, 0); | ||||
|         spark.setLowLife(1.1f); | ||||
|         spark.setLowLife(0.5f); | ||||
|         spark.setHighLife(1.5f); | ||||
|         spark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 20, 0)); | ||||
|         spark.getParticleInfluencer().setInitialVelocity(new Vector3f(0, 8, 0)); // y20 | ||||
|         spark.getParticleInfluencer().setVelocityVariation(1); | ||||
|         spark.setImagesX(1); | ||||
|         spark.setImagesY(1); | ||||
| @@ -282,4 +280,5 @@ public class ParticleEffectFactory { | ||||
| 
 | ||||
|         return waterSplash; | ||||
|     } | ||||
| 
 | ||||
| } | ||||
| @@ -37,9 +37,9 @@ import static pp.util.FloatMath.PI; | ||||
| class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|     private static final String UNSHADED = "Common/MatDefs/Misc/Unshaded.j3md"; //NON-NLS | ||||
|     private static final String KING_GEORGE_V_MODEL = "Models/KingGeorgeV/KingGeorgeV.j3o"; //NON-NLS | ||||
|     private static final String BOAT_SMALL_MODEL = "Models/BoatSmall/12219_boat_v2_L2.j3o"; //NON-NLS | ||||
|     private static final String CV_MODEL = "Models/CV/CV.j3o"; //NON-NLS | ||||
|     private static final String BATTLE_MODEL = "Models/Battle/Battle.j3o"; //NON-NLS | ||||
|     private static final String SMALL_SHIP_MODEL = "Models/SmallShip/SmallShip.j3o"; //NON-NLS | ||||
|     private static final String U_BOAT_MODEL = "Models/WWII_ship_German_Type_II_U-boat_v2/WW2Uboat.j3o"; //NON-NLS | ||||
|     private static final String TUG_BOAT_MODEL = "Models/TugBoat/TugBoat.j3o"; //NON-NLS | ||||
|     private static final String LIGHTING = "Common/MatDefs/Light/Lighting.j3md"; | ||||
|     private static final String COLOR = "Color"; //NON-NLS | ||||
|     private static final String SHIP = "ship"; //NON-NLS | ||||
| @@ -50,7 +50,8 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|  | ||||
|     private final ShipMap map; | ||||
|     private final BattleshipApp app; | ||||
|     private final ParticleEffectFactory particleFactory; | ||||
|     private final ParticleCreator particlecreator; | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Constructs a {@code SeaSynchronizer} object with the specified application, root node, and ship map. | ||||
| @@ -63,7 +64,7 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|         super(app.getGameLogic().getOwnMap(), root); | ||||
|         this.app = app; | ||||
|         this.map = map; | ||||
|         this.particleFactory = new ParticleEffectFactory(app); | ||||
|         this.particlecreator = new ParticleCreator(app); | ||||
|         addExisting(); | ||||
|     } | ||||
|  | ||||
| @@ -90,7 +91,7 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|         Node shotNode = new Node("ShotNode"); | ||||
|         Geometry shotCylinder = createCylinder(shot); | ||||
|         shotNode.attachChild(shotCylinder); | ||||
|         ParticleEmitter waterSplash = particleFactory.createWaterSplash(); | ||||
|         ParticleEmitter waterSplash = particlecreator.createWaterSplash(); | ||||
|         waterSplash.setLocalTranslation(shot.getY() + 0.5f, 0f, shot.getX() + 0.5f); | ||||
|         shotNode.attachChild(waterSplash); | ||||
|         waterSplash.emitAllParticles(); | ||||
| @@ -103,45 +104,46 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|      * @param ship the ship to be sunk | ||||
|      */ | ||||
|     private void sinkAndRemoveShip(Battleship ship) { | ||||
|         Battleship wilkeningklaunichtmeinencode = ship; | ||||
|         final Node shipNode = (Node) getSpatial(wilkeningklaunichtmeinencode); | ||||
|         Battleship dasIstGelebteTeamarbeit = ship; | ||||
|         final Node shipNode = (Node) getSpatial(dasIstGelebteTeamarbeit); | ||||
|         if (shipNode == null) return; | ||||
|  | ||||
|         // Add sinking control to animate the sinking | ||||
|         shipNode.addControl(new SinkingControl(shipNode)); | ||||
|         shipNode.addControl(new SinkControl(shipNode)); | ||||
|  | ||||
|         // Add particle effects | ||||
|         ParticleEmitter bubbles = particleFactory.createWaterSplash(); | ||||
|         ParticleEmitter bubbles = particlecreator.createWaterSplash(); | ||||
|         bubbles.setLocalTranslation(shipNode.getLocalTranslation()); | ||||
|         shipNode.attachChild(bubbles); | ||||
|         bubbles.emitAllParticles(); | ||||
|     } | ||||
|  | ||||
|  | ||||
|  | ||||
|     /** | ||||
|      * Handles a hit by attaching its representation to the node that | ||||
|      * contains the ship model as a child so that it moves with the ship. | ||||
|      * | ||||
|      * @param shot a hit | ||||
|      * @return always null to prevent the representation from being attached to the items node as well | ||||
|      * @return always null to prevent the representation from being attached | ||||
|      * to the items node as well | ||||
|      */ | ||||
|     private Spatial handleHit(Shot shot) { | ||||
|         final Battleship ship = requireNonNull(map.findShipAt(shot), "Missing ship"); | ||||
|         final Node shipNode = requireNonNull((Node) getSpatial(ship), "Missing ship node"); | ||||
|  | ||||
|  | ||||
|  | ||||
|         // Create a new node specifically for the hit effects | ||||
|         Node hitEffectNode = new Node("HitEffectNode"); | ||||
|  | ||||
|         // Create particle effects | ||||
|         ParticleEmitter flame = particleFactory.createFlame(); | ||||
|         ParticleEmitter flash = particleFactory.createFlash(); | ||||
|         ParticleEmitter spark = particleFactory.createSpark(); | ||||
|         ParticleEmitter roundSpark = particleFactory.createRoundSpark(); | ||||
|         ParticleEmitter smokeTrail = particleFactory.createSmokeTrail(); | ||||
|         ParticleEmitter debris = particleFactory.createDebris(); | ||||
|         ParticleEmitter shockwave = particleFactory.createShockwave(); | ||||
|         ParticleEmitter movingSmoke = particleFactory.createMovingSmokeEmitter(); | ||||
|         ParticleEmitter flame = particlecreator.createFlame(); | ||||
|         ParticleEmitter flash = particlecreator.createFlash(); | ||||
|         ParticleEmitter spark = particlecreator.createSpark(); | ||||
|         ParticleEmitter roundSpark = particlecreator.createRoundSpark(); | ||||
|         ParticleEmitter smokeTrail = particlecreator.createSmokeTrail(); | ||||
|         ParticleEmitter debris = particlecreator.createDebris(); | ||||
|         ParticleEmitter shockwave = particlecreator.createShockwave(); | ||||
|         ParticleEmitter movingSmoke = particlecreator.createMovingSmokeEmitter(); | ||||
|  | ||||
|         // Attach all effects to the hitEffectNode | ||||
|         hitEffectNode.attachChild(flame); | ||||
| @@ -155,8 +157,8 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|  | ||||
|         // Set the local translation for the hit effect to the point of impact | ||||
|         hitEffectNode.setLocalTranslation(shot.getY() + 0.5f - shipNode.getLocalTranslation().x, | ||||
|                                           0.5f, // Adjust as needed for height above the ship | ||||
|                                           shot.getX() + 0.5f - shipNode.getLocalTranslation().z); | ||||
|                 0.5f, // Adjust as needed for height above the ship | ||||
|                 shot.getX() + 0.5f - shipNode.getLocalTranslation().z); | ||||
|  | ||||
|         // Attach the hitEffectNode to the shipNode so it moves with the ship | ||||
|         shipNode.attachChild(hitEffectNode); | ||||
| @@ -229,12 +231,18 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|      */ | ||||
|     private Spatial createShip(Battleship ship) { | ||||
|         switch (ship.getLength()) { | ||||
|             case 4: return createBattleship(ship); | ||||
|             case 3: return createCV(ship); | ||||
|             case 2: return createBattle(ship); | ||||
|             case 1: return createSmallship(ship); | ||||
|             default: return createBox(ship); | ||||
|             case 4: | ||||
|                 return createBattleship(ship); | ||||
|             case 3: | ||||
|                 return createLargeship(ship); | ||||
|             case 2: | ||||
|                return createMediumship(ship); | ||||
|             case 1: | ||||
|                return createSmallship(ship); | ||||
|             default: | ||||
|                 return createBox(ship); | ||||
|         } | ||||
|  | ||||
|     } | ||||
|  | ||||
|     /** | ||||
| @@ -284,20 +292,13 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|  | ||||
|         model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.scale(1.48f); | ||||
|         // model.scale(0.0007f); | ||||
|         model.setShadowMode(ShadowMode.CastAndReceive); | ||||
|  | ||||
|         return model; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a detailed 3D model to represent a small tug boat. | ||||
|      * | ||||
|      * @param ship the battleship to be represented | ||||
|      * @return the spatial representing a small tug boat | ||||
|      */ | ||||
|     private Spatial createSmallship(Battleship ship) { | ||||
|         final Spatial model = app.getAssetManager().loadModel(BOAT_SMALL_MODEL); | ||||
|         final Spatial model = app.getAssetManager().loadModel(SMALL_SHIP_MODEL); | ||||
|  | ||||
|         model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.scale(0.0005f); | ||||
| @@ -306,35 +307,21 @@ class SeaSynchronizer extends ShipMapSynchronizer { | ||||
|         return model; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a detailed 3D model to represent a "German WWII UBoat". | ||||
|      * | ||||
|      * @param ship the battleship to be represented | ||||
|      * @return the spatial representing the "German WWII UBoat" | ||||
|      */ | ||||
|     private Spatial createCV(Battleship ship) { | ||||
|         final Spatial model = app.getAssetManager().loadModel(CV_MODEL); | ||||
|     private Spatial createMediumship(Battleship ship) { | ||||
|         final Spatial model = app.getAssetManager().loadModel(U_BOAT_MODEL); | ||||
|  | ||||
|         model.rotate(0f, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.move(0f, 0.25f, 0f); | ||||
|         model.scale(0.85f); | ||||
|         model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.scale(0.27f); | ||||
|         model.setShadowMode(ShadowMode.CastAndReceive); | ||||
|  | ||||
|         return model; | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * Creates a detailed 3D model to represent a battleship. | ||||
|      * | ||||
|      * @param ship the battleship to be represented | ||||
|      * @return the spatial representing a battleship | ||||
|      */ | ||||
|     private Spatial createBattle(Battleship ship) { | ||||
|         final Spatial model = app.getAssetManager().loadModel(BATTLE_MODEL); | ||||
|     private Spatial createLargeship(Battleship ship) { | ||||
|         final Spatial model = app.getAssetManager().loadModel(TUG_BOAT_MODEL); | ||||
|  | ||||
|         model.rotate(-HALF_PI, calculateRotationAngle(ship.getRot()), 0f); | ||||
|         model.move(0f, -0.06f, 0f); | ||||
|         model.scale(0.27f); | ||||
|         model.scale(0.0004f); | ||||
|         model.setShadowMode(ShadowMode.CastAndReceive); | ||||
|  | ||||
|         return model; | ||||
|   | ||||
| @@ -42,14 +42,6 @@ public class Shell2DControl extends AbstractControl { | ||||
|         spatial.setLocalTranslation(viewPos.getX() + MapView.FIELD_SIZE / 2, viewPos.getY() + MapView.FIELD_SIZE / 2, 0); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * This method is called during the rendering phase, but it does not perform any | ||||
|      * operations in this implementation as the control only influences the spatial's | ||||
|      * transformation, not its rendering process. | ||||
|      * | ||||
|      * @param rm the RenderManager rendering the controlled Spatial (not null) | ||||
|      * @param vp the ViewPort being rendered (not null) | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlRender(RenderManager rm, ViewPort vp) { | ||||
|         // No rendering-specific behavior required for this control | ||||
|   | ||||
| @@ -43,14 +43,6 @@ public class ShellControl extends AbstractControl { | ||||
|         spatial.rotate(PI/2,0,0); | ||||
|     } | ||||
|  | ||||
|     /** | ||||
|      * This method is called during the rendering phase, but it does not perform any | ||||
|      * operations in this implementation as the control only influences the spatial's | ||||
|      * transformation, not its rendering process. | ||||
|      * | ||||
|      * @param rm the RenderManager rendering the controlled Spatial (not null) | ||||
|      * @param vp the ViewPort being rendered (not null) | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlRender(RenderManager rm, ViewPort vp) { | ||||
|         // No rendering-specific behavior required for this control | ||||
|   | ||||
| @@ -10,7 +10,7 @@ import com.jme3.scene.Node; | ||||
|  * Control that handles the sinking effect for destroyed ships. | ||||
|  * It will gradually move the ship downwards and then remove it from the scene. | ||||
|  */ | ||||
| class SinkingControl extends AbstractControl { | ||||
| class SinkControl extends AbstractControl { | ||||
|     private static final float SINK_DURATION = 5f;  // Duration of the sinking animation | ||||
|     private static final float SINK_SPEED = 0.1f;   // Speed at which the ship sinks | ||||
|     private float elapsedTime = 0; | ||||
| @@ -21,7 +21,7 @@ class SinkingControl extends AbstractControl { | ||||
|      * Constructs a {@code SinkingControl} object with the shipNode to be to be sunk | ||||
|      * @param shipNode the node to handeld | ||||
|      */ | ||||
|     public SinkingControl(Node shipNode) { | ||||
|     public SinkControl(Node shipNode) { | ||||
|         this.shipNode = shipNode; | ||||
|     } | ||||
| 
 | ||||
| @@ -46,16 +46,9 @@ class SinkingControl extends AbstractControl { | ||||
|         } | ||||
|     } | ||||
| 
 | ||||
|     /** | ||||
|      * This method is called during the rendering phase, but it does not perform any | ||||
|      * operations in this implementation as the control only influences the spatial's | ||||
|      * transformation, not its rendering process. | ||||
|      * | ||||
|      * @param rm the RenderManager rendering the controlled Spatial (not null) | ||||
|      * @param vp the ViewPort being rendered (not null) | ||||
|      */ | ||||
|     @Override | ||||
|     protected void controlRender(RenderManager rm, ViewPort vp) { | ||||
|         // No rendering-related code needed | ||||
|     } | ||||
| } | ||||
| 
 | ||||
| @@ -18,8 +18,8 @@ import pp.battleship.BattleshipConfig; | ||||
| import pp.battleship.game.server.Player; | ||||
| import pp.battleship.game.server.ServerGameLogic; | ||||
| import pp.battleship.game.server.ServerSender; | ||||
| import pp.battleship.message.client.AnimationFinishedMessage; | ||||
| import pp.battleship.message.client.ClientMessage; | ||||
| import pp.battleship.message.client.AnimationFinishedMessage; | ||||
| import pp.battleship.message.client.MapMessage; | ||||
| import pp.battleship.message.client.ShootMessage; | ||||
| import pp.battleship.message.server.EffectMessage; | ||||
| @@ -180,3 +180,4 @@ public class BattleshipServer implements MessageListener<HostedConnection>, Conn | ||||
|             LOGGER.log(Level.ERROR, "there is no connection with id={0}", id); //NON-NLS | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| @@ -15,3 +15,4 @@ record ReceivedMessage(ClientMessage message, int from) { | ||||
|         message.accept(interpreter, from); | ||||
|     } | ||||
| } | ||||
|  | ||||
|   | ||||
| Before Width: | Height: | Size: 35 KiB | 
| Before Width: | Height: | Size: 54 KiB | 
| Before Width: | Height: | Size: 9.3 KiB | 
| Before Width: | Height: | Size: 66 KiB | 
| Before Width: | Height: | Size: 3.2 KiB | 
| Before Width: | Height: | Size: 30 KiB | 
| Before Width: | Height: | Size: 10 KiB | 
| Before Width: | Height: | Size: 9.4 KiB | 
| Before Width: | Height: | Size: 264 KiB | 
| Before Width: | Height: | Size: 80 KiB | 
| Before Width: | Height: | Size: 91 KiB | 
| Before Width: | Height: | Size: 33 KiB | 
| Before Width: | Height: | Size: 98 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 78 B | 
| Before Width: | Height: | Size: 79 B | 
| Before Width: | Height: | Size: 96 KiB | 
| Before Width: | Height: | Size: 82 KiB | 
| Before Width: | Height: | Size: 670 KiB | 
| Before Width: | Height: | Size: 56 KiB After Width: | Height: | Size: 56 KiB | 
| Before Width: | Height: | Size: 166 KiB After Width: | Height: | Size: 166 KiB | 
| Before Width: | Height: | Size: 98 KiB After Width: | Height: | Size: 98 KiB | 
| After Width: | Height: | Size: 51 KiB | 
| After Width: | Height: | Size: 29 KiB | 
| After Width: | Height: | Size: 30 KiB | 
| After Width: | Height: | Size: 47 KiB | 
| Before Width: | Height: | Size: 168 KiB After Width: | Height: | Size: 168 KiB | 
| @@ -42,15 +42,9 @@ public class ModelExporter extends SimpleApplication { | ||||
|     @Override | ||||
|     public void simpleInitApp() { | ||||
|         export("Models/KingGeorgeV/King_George_V.obj", "KingGeorgeV.j3o"); //NON-NLS | ||||
|         export("Models/BoatSmall/12219_boat_v2_L2.obj", "BoatSmall.j3o"); //NON-NLS | ||||
|         export("Models/Battle/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.obj", "Battle.j3o"); //NON-NLS | ||||
|         export("Models/CV/essex_scb-125_generic.obj", "CV.j3o"); //NON-NLS | ||||
|         export("Models/Figures/Würfel_blau.obj", "Würfel_blau.j30"); | ||||
|         export("Models/Figures/Würfel_gelb.obj", "Würfel_gelb.j30"); | ||||
|         export("Models/Figures/Würfel_grün.obj", "Würfel_grün.j30"); | ||||
|         export("Models/Figures/Würfel_rosa.obj", "Würfel_rosa.j30"); | ||||
|         export("Models/Figures/Würfel_rot.obj", "Würfel_rot.j30"); | ||||
|         export("Models/Figures/Würfel_schwarz.obj", "Würfel_schwarz.j30"); | ||||
|         export("Models/SmallShip/12219_boat_v2_L2.obj", "SmallShip.j3o"); //NON-NLS | ||||
|         export("Models/WWII_ship_German_Type_II_U-boat_v2/14084_WWII_Ship_German_Type_II_U-boat_v2_L1.obj", "WW2Uboat.j3o"); //NON-NLS | ||||
|         export("Models/TugBoat/12218_tugboat_v1_L2.obj", "TugBoat.j3o"); //NON-NLS | ||||
|         stop(); | ||||
|     } | ||||
|  | ||||
|   | ||||
| Before Width: | Height: | Size: 35 KiB | 
| Before Width: | Height: | Size: 54 KiB | 
| Before Width: | Height: | Size: 9.3 KiB | 
| Before Width: | Height: | Size: 66 KiB | 
| Before Width: | Height: | Size: 3.2 KiB | 
| Before Width: | Height: | Size: 30 KiB | 
| Before Width: | Height: | Size: 10 KiB | 
| Before Width: | Height: | Size: 9.4 KiB | 
| Before Width: | Height: | Size: 264 KiB | 
| Before Width: | Height: | Size: 80 KiB | 
| Before Width: | Height: | Size: 91 KiB | 
| Before Width: | Height: | Size: 33 KiB |