Commit d6ecdfb8 authored by Myriam Begel's avatar Myriam Begel

Merge branch 'master' of gitlab.crans.org:genie_logiciel_2015/the_dungeon_project

parents 1d0f0b51 9ec466dc
...@@ -15,8 +15,8 @@ import java.util.HashMap; ...@@ -15,8 +15,8 @@ import java.util.HashMap;
* It implements the singleton pattern * It implements the singleton pattern
*/ */
public abstract class GraphicsMasterAbstraction { public abstract class GraphicsMasterAbstraction {
// Indicates whether the gui has already been launched (so that it is not launched again if GraphicsMaster is // Indicates whether the GUI has already been launched (so that it is not launched again if GraphicsMaster is
// instanciated a second time by mistake) // instantiated a second time by mistake)
protected FrameAbstraction mainFrame; protected FrameAbstraction mainFrame;
public FrameKeyListenerAbstraction mainFrameKeyListener; public FrameKeyListenerAbstraction mainFrameKeyListener;
protected boolean guiLaunched = false; protected boolean guiLaunched = false;
...@@ -38,21 +38,11 @@ public abstract class GraphicsMasterAbstraction { ...@@ -38,21 +38,11 @@ public abstract class GraphicsMasterAbstraction {
public final static GraphicsMasterAbstraction getInstance() { public final static GraphicsMasterAbstraction getInstance() {
return thisGraphicsMaster; return thisGraphicsMaster;
} }
//private GraphicsMaster() {
// mapGUIStatesToGUIPanel.put(GUIStates.UNINITIALISED, new UnitialisedGUIPanel(this));
// mapGUIStatesToGUIPanel.put(GUIStates.MAIN_MENU_PANEL, new MainMenuTermPanel(this));
// mapGUIStatesToGUIPanel.put(GUIStates.GAME_PANEL, new GamePanel(this));
//}
/** /**
* This method launches the GUI (the name is quite self-explanatory :)) * This method launches the GUI (the name is quite self-explanatory :))
*/ */
public abstract void launchGUI();// { public abstract void launchGUI();// {
// if(guiLaunched == false) {
// launchSwingApplication();
// guiLaunched = true;
// }
//}
/**############################################## /**##############################################
* The following section defines the methods that will be called when a key is pressed/released/types in the * The following section defines the methods that will be called when a key is pressed/released/types in the
......
...@@ -7,10 +7,10 @@ import graphics.ingame_input_listener.Input; ...@@ -7,10 +7,10 @@ import graphics.ingame_input_listener.Input;
*/ */
public interface PanelAbstraction { public interface PanelAbstraction {
public abstract void keyPressedHandler(Input e); void keyPressedHandler(Input e);
public abstract void keyReleasedHandler(Input e); void keyReleasedHandler(Input e);
public abstract void keyTypedHandler(Input e); void keyTypedHandler(Input e);
public void initialise(); void initialise();
public void finalise(); void finalise();
public void repaint(); void repaint();
} }
...@@ -2,11 +2,11 @@ package graphics.guiSkeleton.EntityDisplayer; ...@@ -2,11 +2,11 @@ package graphics.guiSkeleton.EntityDisplayer;
import core.gamestate.Entity; import core.gamestate.Entity;
import graphics.guiSkeleton.PositionedSprite; import graphics.guiSkeleton.MapManagement.PositionedSprite;
import java.io.Serializable; import java.io.Serializable;
import graphics.guiSkeleton.GraphicsMap; import graphics.guiSkeleton.MapManagement.GraphicsMap;
/** /**
......
...@@ -3,10 +3,10 @@ package graphics.guiSkeleton.EntityDisplayer.EntityDisplayerBank; ...@@ -3,10 +3,10 @@ package graphics.guiSkeleton.EntityDisplayer.EntityDisplayerBank;
import assets.UsedForLoadingSprites; import assets.UsedForLoadingSprites;
import core.gamestate.Action; import core.gamestate.Action;
import core.gamestate.Entity; import core.gamestate.Entity;
import graphics.guiSkeleton.GraphicsMap; import graphics.guiSkeleton.MapManagement.GraphicsMap;
import graphics.guiSkeleton.EntityDisplayer.EntityDisplayer; import graphics.guiSkeleton.EntityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.GraphicsMapPoint; import graphics.guiSkeleton.MapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.PositionedSprite; import graphics.guiSkeleton.MapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.Sprite; import graphics.guiSkeleton.sprites.Sprite;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
......
package graphics.guiSkeleton.EntityDisplayer.EntityDisplayerBank; package graphics.guiSkeleton.EntityDisplayer.EntityDisplayerBank;
import core.gamestate.Entity; import core.gamestate.Entity;
import graphics.guiSkeleton.GraphicsMap; import graphics.guiSkeleton.MapManagement.GraphicsMap;
import graphics.guiSkeleton.EntityDisplayer.EntityDisplayer; import graphics.guiSkeleton.EntityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.GraphicsMapPoint; import graphics.guiSkeleton.MapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.PositionedSprite; import graphics.guiSkeleton.MapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.Sprite; import graphics.guiSkeleton.sprites.Sprite;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
......
...@@ -3,10 +3,10 @@ package graphics.guiSkeleton.EntityDisplayer.EntityDisplayerBank; ...@@ -3,10 +3,10 @@ package graphics.guiSkeleton.EntityDisplayer.EntityDisplayerBank;
import assets.UsedForLoadingSprites; import assets.UsedForLoadingSprites;
import core.gamestate.Entity; import core.gamestate.Entity;
import core.gamestate.Action; import core.gamestate.Action;
import graphics.guiSkeleton.GraphicsMap; import graphics.guiSkeleton.MapManagement.GraphicsMap;
import graphics.guiSkeleton.EntityDisplayer.EntityDisplayer; import graphics.guiSkeleton.EntityDisplayer.EntityDisplayer;
import graphics.guiSkeleton.GraphicsMapPoint; import graphics.guiSkeleton.MapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.PositionedSprite; import graphics.guiSkeleton.MapManagement.PositionedSprite;
import graphics.guiSkeleton.sprites.Sprite; import graphics.guiSkeleton.sprites.Sprite;
import javax.imageio.ImageIO; import javax.imageio.ImageIO;
......
package graphics.guiSkeleton.EntityDisplayer; package graphics.guiSkeleton.EntityDisplayer;
import core.gamestate.Being; import core.gamestate.Being;
import graphics.guiSkeleton.GraphicsMap; import graphics.guiSkeleton.MapManagement.GraphicsMap;
import graphics.guiSkeleton.GraphicsMapPoint; import graphics.guiSkeleton.MapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.PositionedSprite; import graphics.guiSkeleton.MapManagement.PositionedSprite;
import graphics.guiSkeleton.SpriteStorage; import graphics.guiSkeleton.SpriteStorage;
import graphics.guiSkeleton.sprites.Sprite; import graphics.guiSkeleton.sprites.Sprite;
......
...@@ -4,13 +4,13 @@ import core.gamestate.Being; ...@@ -4,13 +4,13 @@ import core.gamestate.Being;
import core.gamestate.Entity; import core.gamestate.Entity;
import core.relayer.Relayer; import core.relayer.Relayer;
import core.zone.Zone; import core.zone.Zone;
import graphics.guiSkeleton.MapDrawer; import graphics.guiSkeleton.MapManagement.*;
import graphics.guiSkeleton.*; import graphics.guiSkeleton.*;
import graphics.guiSkeleton.CoreProcesses.GameContent; import graphics.guiSkeleton.CoreProcesses.GameContent;
import graphics.guiSkeleton.CoreProcesses.GameContentMapChangeListener; import graphics.guiSkeleton.CoreProcesses.GameContentMapChangeListener;
import graphics.guiSkeleton.GraphicsMap;
import graphics.guiSkeleton.DummyForTest.*; import graphics.guiSkeleton.DummyForTest.*;
import graphics.guiSkeleton.EntityDisplayer.HealthBarDisplayer; import graphics.guiSkeleton.EntityDisplayer.HealthBarDisplayer;
import graphics.guiSkeleton.inputManagement.InputInterpreter;
import graphics.ingame_input_listener.Input; import graphics.ingame_input_listener.Input;
import javax.swing.*; import javax.swing.*;
......
...@@ -3,6 +3,7 @@ package graphics.guiSkeleton; ...@@ -3,6 +3,7 @@ package graphics.guiSkeleton;
import graphics.graphical_abstraction.GraphicsMasterAbstraction; import graphics.graphical_abstraction.GraphicsMasterAbstraction;
import graphics.graphical_abstraction.PanelAbstraction; import graphics.graphical_abstraction.PanelAbstraction;
import graphics.guiSkeleton.GUIPanel.*; import graphics.guiSkeleton.GUIPanel.*;
import graphics.guiSkeleton.inputManagement.MainFrameKeyListener;
import ingame_programming.IGPpanel; import ingame_programming.IGPpanel;
import javax.swing.*; import javax.swing.*;
...@@ -20,7 +21,7 @@ import javax.swing.*; ...@@ -20,7 +21,7 @@ import javax.swing.*;
*/ */
public class GraphicsMaster extends GraphicsMasterAbstraction { public class GraphicsMaster extends GraphicsMasterAbstraction {
// Indicates whether the gui has already been launched (so that it is not launched again if GraphicsMaster is // Indicates whether the gui has already been launched (so that it is not launched again if GraphicsMaster is
// instanciated a second time by mistake) // instantiated a second time by mistake)
/** Singleton pattern implementation **/ /** Singleton pattern implementation **/
//private static GraphicsMaster thisGraphicsMaster //private static GraphicsMaster thisGraphicsMaster
...@@ -39,7 +40,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction { ...@@ -39,7 +40,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
mapGUIStatesToGUIPanel.put(GUIStates.IGP_PANEL, new IGPpanel(this)); mapGUIStatesToGUIPanel.put(GUIStates.IGP_PANEL, new IGPpanel(this));
} }
public static void build() { public static void build() {
thisGraphicsMaster = new GraphicsMaster(); thisGraphicsMaster = new GraphicsMaster();
thisGraphicsMaster.mainFrameKeyListener = new MainFrameKeyListener((GraphicsMaster)thisGraphicsMaster); thisGraphicsMaster.mainFrameKeyListener = new MainFrameKeyListener((GraphicsMaster)thisGraphicsMaster);
...@@ -72,36 +72,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction { ...@@ -72,36 +72,6 @@ public class GraphicsMaster extends GraphicsMasterAbstraction {
}); });
} }
/**##############################################
* The following section defines the methods that will be called when a key is pressed/released/types in the
* mainFrame (that is, in all the application). These KeyEvents are sent to the corresponding functions defined
* in the GUIPanel currently displayed in the mainFrame (according to guiState).
*/
/**
* This method defines what to do when a key is pressed in the mainFrame
* @param e: the KeyEvent that was recorded by the mainFrame
*/
//public final void keyPressedHandler(KeyEvent e) {
// mapGUIStatesToGUIPanel.get(guiState).keyPressedHandler(e);
//}
/**
* This method defines what to do when a key is released in the mainFrame
* @param e: the KeyEvent that was recorded by the mainFrame
*/
//public final void keyReleasedHandler(KeyEvent e) {
// //mapGUIStatesToGUIPanel.get(guiState).keyReleasedHandler(e);
//}
/**
* This method defines what to do when a key is typed in the mainFrame
* @param e: the KeyEvent that was recorded by the mainFrame
*/
//public final void keyTypedHandler(KeyEvent e) {
// //mapGUIStatesToGUIPanel.get(guiState).keyTypedHandler(e);
//}
/**###################################################### /**######################################################
* The following section contains methods used to change the state of the GUI. The state of the gui is basically * The following section contains methods used to change the state of the GUI. The state of the gui is basically
* the panel that is currently displayed in mainFrame. * the panel that is currently displayed in mainFrame.
......
package graphics.guiSkeleton; package graphics.guiSkeleton.MapManagement;
import graphics.guiSkeleton.TileSpriteLinker.TileSprite; import graphics.guiSkeleton.TileSpriteLinker.TileSprite;
import map_generation.tiles.Tile; import map_generation.tiles.Tile;
......
package graphics.guiSkeleton; package graphics.guiSkeleton.MapManagement;
import graphics.guiSkeleton.MapManagement.GraphicsMapPoint;
/** /**
* Created by dupriez on 14/11/15. * Created by dupriez on 14/11/15.
......
package graphics.guiSkeleton; package graphics.guiSkeleton.MapManagement;
import graphics.guiSkeleton.MapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.TileSpriteLinker.TileSprite; import graphics.guiSkeleton.TileSpriteLinker.TileSprite;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
......
package graphics.guiSkeleton; package graphics.guiSkeleton.MapManagement;
/** /**
* Created by dupriez on 14/11/15. * Created by dupriez on 14/11/15.
......
package graphics.guiSkeleton; package graphics.guiSkeleton.MapManagement;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
......
package graphics.guiSkeleton; package graphics.guiSkeleton.MapManagement;
import graphics.guiSkeleton.sprites.Sprite; import graphics.guiSkeleton.sprites.Sprite;
......
package graphics.guiSkeleton; package graphics.guiSkeleton;
import graphics.guiSkeleton.MapManagement.GraphicsMap;
import graphics.guiSkeleton.MapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.TileSpriteLinker.TileSprite; import graphics.guiSkeleton.TileSpriteLinker.TileSprite;
import java.awt.*; import java.awt.*;
......
package graphics.guiSkeleton; package graphics.guiSkeleton.inputManagement;
import core.zone.Direction; import core.zone.Direction;
import core.relayer.*; import core.relayer.*;
...@@ -19,7 +19,6 @@ public class InputInterpreter { ...@@ -19,7 +19,6 @@ public class InputInterpreter {
MyRelayer = r; MyRelayer = r;
direction=Direction.NONE; direction=Direction.NONE;
moveThread = new MoveThread(MyRelayer); moveThread = new MoveThread(MyRelayer);
} }
private void move(){ private void move(){
...@@ -27,7 +26,6 @@ public class InputInterpreter { ...@@ -27,7 +26,6 @@ public class InputInterpreter {
/*starts a thread to move*/ /*starts a thread to move*/
moveThread.start(); moveThread.start();
} }
moveThread.setDirection(direction); moveThread.setDirection(direction);
if(direction == Direction.NONE) if(direction == Direction.NONE)
return; return;
...@@ -55,7 +53,6 @@ public class InputInterpreter { ...@@ -55,7 +53,6 @@ public class InputInterpreter {
direction=direction.remove(Direction.LEFT); direction=direction.remove(Direction.LEFT);
move(); move();
} }
public void setMoveYTop(boolean bool) { public void setMoveYTop(boolean bool) {
if(bool) if(bool)
direction=direction.add(Direction.UP); direction=direction.add(Direction.UP);
...@@ -75,5 +72,4 @@ public class InputInterpreter { ...@@ -75,5 +72,4 @@ public class InputInterpreter {
public void setSpellCast(int num_spell) { public void setSpellCast(int num_spell) {
//System.out.println("SPELLL !!"); //System.out.println("SPELLL !!");
} }
}
} \ No newline at end of file
package graphics.guiSkeleton; package graphics.guiSkeleton.inputManagement;
import graphics.graphical_abstraction.FrameKeyListenerAbstraction; import graphics.graphical_abstraction.FrameKeyListenerAbstraction;
import graphics.guiSkeleton.GraphicsMaster;
import graphics.ingame_input_listener.InputConfiguration; import graphics.ingame_input_listener.InputConfiguration;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
......
package graphics.ingame_input_listener; package graphics.ingame_input_listener;
//import com.sun.xml.internal.bind.v2.TODO;
import java.awt.event.KeyEvent; import java.awt.event.KeyEvent;
/** /**
...@@ -168,7 +167,6 @@ public class InputConfiguration { ...@@ -168,7 +167,6 @@ public class InputConfiguration {
return; return;
default: default:
throw new IllegalStateException("Unknown input"+ input); throw new IllegalStateException("Unknown input"+ input);
} }
} }
......
package graphics.termSkeleton; package graphics.termSkeleton;
import graphics.guiSkeleton.GraphicsMap;
import graphics.guiSkeleton.TileSpriteLinker.TileSprite; import graphics.guiSkeleton.TileSpriteLinker.TileSprite;
import graphics.guiSkeleton.TileSpriteLinker.TileSpriteLinker;
import map_generation.map.Map; import map_generation.map.Map;
import java.awt.image.BufferedImage;
/** /**
* Created by Colin on 21/11/15. * Created by Colin on 21/11/15.
......
package graphics.termSkeleton; package graphics.termSkeleton;
import graphics.guiSkeleton.GraphicsMapPoint; import graphics.guiSkeleton.MapManagement.GraphicsMapPoint;
import graphics.guiSkeleton.sprites.Sprite; import graphics.guiSkeleton.sprites.Sprite;
import java.awt.image.BufferedImage; import java.awt.image.BufferedImage;
......
package graphics.termSkeleton.termPanel; package graphics.termSkeleton.termPanel;
import core.gamestate.Being;
import core.gamestate.Entity; import core.gamestate.Entity;
import core.relayer.Relayer; import core.relayer.Relayer;
import graphics.guiSkeleton.CoreProcesses.GameContent; import graphics.guiSkeleton.CoreProcesses.GameContent;
import graphics.guiSkeleton.CoreProcesses.GameContentMapChangeListener; import graphics.guiSkeleton.CoreProcesses.GameContentMapChangeListener;
import graphics.guiSkeleton.DummyForTest.DummyLocalCore; import graphics.guiSkeleton.DummyForTest.DummyLocalCore;
import graphics.guiSkeleton.EntityDisplayer.HealthBarDisplayer;
import graphics.guiSkeleton.*; import graphics.guiSkeleton.*;
import graphics.guiSkeleton.inputManagement.InputInterpreter;
import graphics.ingame_input_listener.Input; import graphics.ingame_input_listener.Input;
import graphics.termSkeleton.*; import graphics.termSkeleton.*;
import javax.swing.*;
import java.awt.*;
/** /**
* Created by dupriez on 10/11/15. * Created by dupriez on 10/11/15.
* *
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment