reformat code
This commit is contained in:
parent
6e9a53dd72
commit
aa3bdfde55
src/fr/enssat/BoulderDash
Game.java
bridges
controllers
BoulderAndDiamondController.javaGameController.javaGameKeyController.javaLevelEditorController.javaLevelEditorKeyController.javaNavigationBetweenViewController.javaRockfordUpdateController.java
exceptions
helpers
AudioLoadHelper.javaLevelLoadHelper.javaLevelRemoveHelper.javaLevelSaveHelper.javaLevelSelectorHelper.javaModelConvertHelper.java
models
BoulderModel.javaBrickWallModel.javaCursorModel.javaDiamondModel.javaDirtModel.javaDisplayableElementModel.javaDoorModel.javaEmptyModel.javaExpandingWallModel.javaGameInformationModel.javaLevelModel.javaMagicWallModel.javaRockfordModel.javaSteelWallModel.java
views
@ -7,7 +7,7 @@ import javax.swing.*;
|
||||
|
||||
/**
|
||||
* Game
|
||||
*
|
||||
* <p>
|
||||
* Spawns the game.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -8,7 +8,7 @@ import javazoom.jl.player.FactoryRegistry;
|
||||
|
||||
/**
|
||||
* SoundJLayerBridge
|
||||
*
|
||||
* <p>
|
||||
* Sound bridge to the JLayer library.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -7,7 +7,7 @@ import fr.enssat.BoulderDash.helpers.AudioLoadHelper;
|
||||
|
||||
/**
|
||||
* ElementPositionUpdateHelper
|
||||
*
|
||||
* <p>
|
||||
* Updates position of all elements displayed on the map, according to their
|
||||
* next potential position. Each object has a weight, which is used to compare
|
||||
* their power to destroy in the food chain. Sorry for that Darwinism.
|
||||
|
@ -12,7 +12,7 @@ import java.awt.event.ActionListener;
|
||||
|
||||
/**
|
||||
* GameController
|
||||
*
|
||||
* <p>
|
||||
* This system creates the view.
|
||||
* The game loop is also handled there.
|
||||
*
|
||||
@ -103,6 +103,7 @@ public class GameController implements ActionListener {
|
||||
|
||||
/**
|
||||
* Return the game view
|
||||
*
|
||||
* @return gameView
|
||||
*/
|
||||
public GameView getGameView() {
|
||||
@ -111,6 +112,7 @@ public class GameController implements ActionListener {
|
||||
|
||||
/**
|
||||
* Set the gameView
|
||||
*
|
||||
* @param gameView
|
||||
*/
|
||||
public void setGameView(GameView gameView) {
|
||||
|
@ -12,7 +12,7 @@ import java.awt.event.KeyListener;
|
||||
|
||||
/**
|
||||
* GameKeyController
|
||||
*
|
||||
* <p>
|
||||
* Manages the key events controller.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
@ -21,6 +21,7 @@ import java.awt.event.KeyListener;
|
||||
public class GameKeyController implements KeyListener {
|
||||
private LevelModel levelModel;
|
||||
private RockfordUpdateController updatePosRockford;
|
||||
|
||||
/**
|
||||
* Class constructor
|
||||
*
|
||||
|
@ -15,7 +15,7 @@ import javax.swing.*;
|
||||
|
||||
/**
|
||||
* LevelEditorController
|
||||
*
|
||||
* <p>
|
||||
* Manages the level editor controller.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -9,7 +9,7 @@ import java.awt.event.KeyListener;
|
||||
|
||||
/**
|
||||
* LevelEditorKeyController
|
||||
*
|
||||
* <p>
|
||||
* Manages the key events controller.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -13,7 +13,6 @@ import fr.enssat.BoulderDash.controllers.GameController;
|
||||
* Controller to navigate between the different views
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
*
|
||||
*/
|
||||
public class NavigationBetweenViewController implements ActionListener {
|
||||
private LevelEditorController levelEditorController;
|
||||
|
@ -4,7 +4,7 @@ import fr.enssat.BoulderDash.models.LevelModel;
|
||||
|
||||
/**
|
||||
* ElementPositionUpdateHelper
|
||||
*
|
||||
* <p>
|
||||
* Updates position of all elements displayed on the map, according to their
|
||||
* next potential position. Each object has a weight, which is used to compare
|
||||
* their power to destroy in the food chain. Sorry for that Darwinism.
|
||||
|
@ -3,7 +3,7 @@ package fr.enssat.BoulderDash.exceptions;
|
||||
|
||||
/**
|
||||
* LevelConstraintNotRespectedException
|
||||
*
|
||||
* <p>
|
||||
* Raises an 'LevelConstraintNotRespectedException' exception.
|
||||
* Given the exception message.
|
||||
*
|
||||
|
@ -3,7 +3,7 @@ package fr.enssat.BoulderDash.exceptions;
|
||||
|
||||
/**
|
||||
* ModelNotReadyException
|
||||
*
|
||||
* <p>
|
||||
* Raises an 'ModelNotReadyException' exception.
|
||||
* Given the exception message.
|
||||
*
|
||||
|
@ -3,7 +3,7 @@ package fr.enssat.BoulderDash.exceptions;
|
||||
|
||||
/**
|
||||
* UnknownModelException
|
||||
*
|
||||
* <p>
|
||||
* Raises an 'UnknownSpriteException' exception.
|
||||
* Given the exception message.
|
||||
*
|
||||
|
@ -8,7 +8,7 @@ import java.util.HashMap;
|
||||
|
||||
/**
|
||||
* AudioLoadHelper
|
||||
*
|
||||
* <p>
|
||||
* Manages audio
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -36,7 +36,7 @@ import java.util.Locale;
|
||||
|
||||
/**
|
||||
* LevelLoadHelper
|
||||
*
|
||||
* <p>
|
||||
* Proceeds level load routine
|
||||
* Able to deserialize level data from storage, and format it to
|
||||
* internal representation To be used as a data factory from level
|
||||
@ -459,6 +459,7 @@ public class LevelLoadHelper {
|
||||
|
||||
/**
|
||||
* Gets the number of Diamonds to catch
|
||||
*
|
||||
* @return number of Diamonds to catch
|
||||
*/
|
||||
public int getDiamondsToCatch() {
|
||||
@ -467,6 +468,7 @@ public class LevelLoadHelper {
|
||||
|
||||
/**
|
||||
* Sets the number of Diamonds to catch
|
||||
*
|
||||
* @param diamondsToCatch
|
||||
*/
|
||||
public void setDiamondsToCatch(int diamondsToCatch) {
|
||||
|
@ -5,7 +5,7 @@ import java.io.File;
|
||||
|
||||
/**
|
||||
* LevelRemoveHelper
|
||||
*
|
||||
* <p>
|
||||
* Proceeds level save routine
|
||||
* Able to iterate on internal representation of a map and serialize it to XML
|
||||
*
|
||||
|
@ -23,7 +23,7 @@ import fr.enssat.BoulderDash.models.DirtModel;
|
||||
|
||||
/**
|
||||
* LevelSaveHelper
|
||||
*
|
||||
* <p>
|
||||
* Proceeds level save routine
|
||||
* Able to iterate on internal representation of a map and serialize it to XML
|
||||
*
|
||||
|
@ -10,7 +10,7 @@ import java.util.List;
|
||||
|
||||
/**
|
||||
* LevelSelectorHelper
|
||||
*
|
||||
* <p>
|
||||
* Level selector helper
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
@ -48,7 +48,8 @@ public class LevelSelectorHelper {
|
||||
if (availableLevels.length > 0) {
|
||||
menuLevelList.setChoiceValue(availableLevels[0]);
|
||||
menuLevelList.setSelectedIndex(0);
|
||||
};
|
||||
}
|
||||
;
|
||||
|
||||
menuLevelList.addActionListener(menuLevelList);
|
||||
|
||||
|
@ -16,7 +16,7 @@ import fr.enssat.BoulderDash.models.SteelWallModel;
|
||||
|
||||
/**
|
||||
* ModelConvertHelper
|
||||
*
|
||||
* <p>
|
||||
* Provides model conversion services.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -5,7 +5,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* BoulderModel
|
||||
*
|
||||
* <p>
|
||||
* Represents the boulders.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -5,7 +5,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* BrickWallModel
|
||||
*
|
||||
* <p>
|
||||
* Represents the brick wall in the game.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -5,7 +5,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* CursorModel
|
||||
*
|
||||
* <p>
|
||||
* Represents the field cursor pointer.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -8,7 +8,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* DiamondModel
|
||||
*
|
||||
* <p>
|
||||
* Represents a diamond in the game.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -5,7 +5,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* DirtModel
|
||||
*
|
||||
* <p>
|
||||
* Represents the dirt in the game.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -8,7 +8,7 @@ import java.io.IOException;
|
||||
|
||||
/**
|
||||
* DisplayableElementModel
|
||||
*
|
||||
* <p>
|
||||
* Represents a abstract displayable element
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
@ -296,7 +296,9 @@ public abstract class DisplayableElementModel {
|
||||
|
||||
/**
|
||||
* Function to update the sprites
|
||||
*
|
||||
* @param currentTimeMillis Current time in milliseconds
|
||||
*/
|
||||
public void update(long currentTimeMillis) {}
|
||||
public void update(long currentTimeMillis) {
|
||||
}
|
||||
}
|
||||
|
@ -5,7 +5,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* DoorModel
|
||||
*
|
||||
* <p>
|
||||
* Represents escape door.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -5,7 +5,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* EmptyModel
|
||||
*
|
||||
* <p>
|
||||
* Represents "nothing".
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -5,7 +5,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* ExpandingWallModel
|
||||
*
|
||||
* <p>
|
||||
* Represents a ExpandingWall in the game.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -9,7 +9,6 @@ import java.util.Observable;
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
* @since 2015-06-19
|
||||
*
|
||||
*/
|
||||
public class GameInformationModel extends Observable {
|
||||
private int score;
|
||||
|
@ -22,7 +22,7 @@ import java.util.Observable;
|
||||
|
||||
/**
|
||||
* LevelModel
|
||||
*
|
||||
* <p>
|
||||
* Levels are loaded from XML file. The view knows the model, the controller is
|
||||
* going to modify the model in function of the game panel. The model notifies
|
||||
* the view when there are changes on it.
|
||||
|
@ -8,7 +8,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* MagicWallModel
|
||||
*
|
||||
* <p>
|
||||
* Represents the magic wall.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -8,7 +8,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* RockfordModel
|
||||
*
|
||||
* <p>
|
||||
* Represents the hero of the game.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -5,7 +5,7 @@ import fr.enssat.BoulderDash.models.DisplayableElementModel;
|
||||
|
||||
/**
|
||||
* SteelWallModel
|
||||
*
|
||||
* <p>
|
||||
* Represents the steelWall
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -11,7 +11,7 @@ import fr.enssat.BoulderDash.views.LevelEditorView;
|
||||
|
||||
/**
|
||||
* AssetsLevelEditorComponent
|
||||
*
|
||||
* <p>
|
||||
* Information panel element.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -11,7 +11,7 @@ import java.awt.*;
|
||||
|
||||
/**
|
||||
* GameFieldView
|
||||
*
|
||||
* <p>
|
||||
* Game field view for the game itself.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -14,7 +14,7 @@ import fr.enssat.BoulderDash.views.InformationPanel;
|
||||
|
||||
/**
|
||||
* GameView
|
||||
*
|
||||
* <p>
|
||||
* Specifies the game view itself.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -10,16 +10,15 @@ import java.util.Observer;
|
||||
|
||||
/**
|
||||
* FieldView
|
||||
*
|
||||
* <p>
|
||||
* FieldView, created by controller; we notice that we don't need to make
|
||||
* levelModel observable; Because of the sprites we have to refresh the game
|
||||
* windows very often so don't need of observers/observable mechanism
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
* @since 2015-06-19
|
||||
*
|
||||
* <p>
|
||||
* This view is basically drawing into the Frame the levelModel.
|
||||
*
|
||||
*/
|
||||
public abstract class GroundView extends JPanel implements Observer {
|
||||
protected LevelModel levelModel;
|
||||
|
@ -11,7 +11,7 @@ import fr.enssat.BoulderDash.models.LevelModel;
|
||||
|
||||
/**
|
||||
* InformationPanel
|
||||
*
|
||||
* <p>
|
||||
* Information panel element.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -8,7 +8,7 @@ import fr.enssat.BoulderDash.models.LevelModel;
|
||||
|
||||
/**
|
||||
* LevelEditorFieldView
|
||||
*
|
||||
* <p>
|
||||
* Game field view for the level editor.
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -16,7 +16,7 @@ import fr.enssat.BoulderDash.views.MenuLevelSelector;
|
||||
|
||||
/**
|
||||
* LevelEditorView
|
||||
*
|
||||
* <p>
|
||||
* Specifies the level editor view.
|
||||
*
|
||||
* @author Colin Leverger <me@colinleverger.fr>
|
||||
|
@ -10,7 +10,7 @@ import javax.swing.JPanel;
|
||||
|
||||
/**
|
||||
* MenuImage
|
||||
*
|
||||
* <p>
|
||||
* Specifies the menu image
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -8,7 +8,7 @@ import fr.enssat.BoulderDash.views.LevelEditorView;
|
||||
|
||||
/**
|
||||
* MenuLevelSelector
|
||||
*
|
||||
* <p>
|
||||
* Specifies the menu level selector
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
@ -12,7 +12,7 @@ import fr.enssat.BoulderDash.controllers.NavigationBetweenViewController;
|
||||
|
||||
/**
|
||||
* MenuView
|
||||
*
|
||||
* <p>
|
||||
* Menu view
|
||||
*
|
||||
* @author Valerian Saliou <valerian@valeriansaliou.name>
|
||||
|
Loading…
x
Reference in New Issue
Block a user