diff options
author | Nao Pross <naopross@thearcway.org> | 2018-11-19 10:27:15 +0100 |
---|---|---|
committer | Nao Pross <naopross@thearcway.org> | 2018-11-19 10:27:15 +0100 |
commit | 7a7007571699eb57bc96cef4cd053a5bd50468b3 (patch) | |
tree | 14b879b399417a59a340c6fda9daf4719a3dbebf /src/MapScene.java | |
parent | Add Actor.SkillSet, remove useless members in various strucutres (diff) | |
download | Subconscious-java-7a7007571699eb57bc96cef4cd053a5bd50468b3.tar.gz Subconscious-java-7a7007571699eb57bc96cef4cd053a5bd50468b3.zip |
Update Scene class (and some derivates) to be abstract
Diffstat (limited to 'src/MapScene.java')
-rw-r--r-- | src/MapScene.java | 27 |
1 files changed, 13 insertions, 14 deletions
diff --git a/src/MapScene.java b/src/MapScene.java index 785698f..af86431 100644 --- a/src/MapScene.java +++ b/src/MapScene.java @@ -29,20 +29,25 @@ import java.io.IOException; import com.google.gson.Gson; -public class MapScene extends Scene implements ActionListener { +public abstract class MapScene extends Scene implements ActionListener { protected Map map; + protected int panX = 0; protected int panY = 0; + protected boolean panning = false; protected double zoom = 1; + protected int mouseX; protected int mouseY; + protected boolean zooming = false; + protected int maxSize; protected AffineTransform tx = new AffineTransform(); - public MapScene(JFrame frame, Sub sub) { - super(frame, sub); + public MapScene(JFrame frame) { + super(frame); //this.map = new Map(new Dimension(10, 10)); } @@ -56,7 +61,10 @@ public class MapScene extends Scene implements ActionListener { } // TODO: negate if condition and return - if (this.map != null) { + if (this.map == null) { + return; + } + Graphics2D g = (Graphics2D) this.buffer.getDrawGraphics(); //clear g.setColor(Palette.BLACK); @@ -169,18 +177,9 @@ public class MapScene extends Scene implements ActionListener { g.dispose(); this.buffer.show(); - } - } - - // TODO: make abstract - protected void absoluteRender(Graphics2D g) { - } - // TODO: remove this overridden method and leave abstract - @Override - protected void update(int deltaTime) { - } + protected abstract void absoluteRender(Graphics2D g); @Override public void keyPressed(KeyEvent e) { |