summaryrefslogtreecommitdiffstats
path: root/src/MapScene.java
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--src/MapScene.java27
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) {