diff --git a/src/com/droidquest/levels/RO2.java b/src/com/droidquest/levels/RO2.java index 398d43b..b31c8cb 100644 --- a/src/com/droidquest/levels/RO2.java +++ b/src/com/droidquest/levels/RO2.java @@ -12,6 +12,8 @@ import com.droidquest.devices.ContactSensor; import com.droidquest.devices.SmallChip; import com.droidquest.items.*; import com.droidquest.materials.*; +import com.droidquest.materials.switches.Switch; +import com.droidquest.materials.switches.Switch1; import java.awt.*; diff --git a/src/com/droidquest/levels/RO3.java b/src/com/droidquest/levels/RO3.java index 4dc581c..f695ecf 100644 --- a/src/com/droidquest/levels/RO3.java +++ b/src/com/droidquest/levels/RO3.java @@ -15,6 +15,9 @@ import com.droidquest.devices.StormShield; import com.droidquest.items.Button; import com.droidquest.items.*; import com.droidquest.materials.*; +import com.droidquest.materials.switches.ElevatorSwitch; +import com.droidquest.materials.switches.SwitchA; +import com.droidquest.materials.switches.SwitchB; import java.awt.*; diff --git a/src/com/droidquest/levels/RO4.java b/src/com/droidquest/levels/RO4.java index 5549fe8..f3baf7e 100644 --- a/src/com/droidquest/levels/RO4.java +++ b/src/com/droidquest/levels/RO4.java @@ -10,6 +10,10 @@ import com.droidquest.decorations.Graphix; import com.droidquest.devices.SmallChip; import com.droidquest.items.*; import com.droidquest.materials.*; +import com.droidquest.materials.switches.Switch4A; +import com.droidquest.materials.switches.Switch4B; +import com.droidquest.materials.switches.Switch4C; +import com.droidquest.materials.switches.Switch4D; import java.awt.*; diff --git a/src/com/droidquest/levels/RO5.java b/src/com/droidquest/levels/RO5.java index 64f10a4..5a2510d 100644 --- a/src/com/droidquest/levels/RO5.java +++ b/src/com/droidquest/levels/RO5.java @@ -10,6 +10,7 @@ import com.droidquest.decorations.Arrow; import com.droidquest.decorations.Graphix; import com.droidquest.items.*; import com.droidquest.materials.*; +import com.droidquest.materials.switches.Switch; import java.awt.*; diff --git a/src/com/droidquest/levels/RO6.java b/src/com/droidquest/levels/RO6.java index a10c45d..cc299b6 100644 --- a/src/com/droidquest/levels/RO6.java +++ b/src/com/droidquest/levels/RO6.java @@ -11,6 +11,7 @@ import com.droidquest.decorations.Graphix; import com.droidquest.devices.DirectionalSensor; import com.droidquest.items.*; import com.droidquest.materials.*; +import com.droidquest.materials.switches.Switch; import java.awt.*; diff --git a/src/com/droidquest/levels/ROLab.java b/src/com/droidquest/levels/ROLab.java index 8b55468..4f4e3e3 100644 --- a/src/com/droidquest/levels/ROLab.java +++ b/src/com/droidquest/levels/ROLab.java @@ -8,6 +8,7 @@ import com.droidquest.decorations.Arrow; import com.droidquest.devices.*; import com.droidquest.items.*; import com.droidquest.materials.*; +import com.droidquest.materials.switches.MazeLock; import java.awt.*; diff --git a/src/com/droidquest/levels/ROTut3.java b/src/com/droidquest/levels/ROTut3.java index 69bee15..9573c8b 100644 --- a/src/com/droidquest/levels/ROTut3.java +++ b/src/com/droidquest/levels/ROTut3.java @@ -9,6 +9,7 @@ import com.droidquest.decorations.Arrow; import com.droidquest.devices.*; import com.droidquest.items.*; import com.droidquest.materials.*; +import com.droidquest.materials.switches.MazeLock; import java.awt.*; diff --git a/src/com/droidquest/levels/ROTutF.java b/src/com/droidquest/levels/ROTutF.java index bc3812b..f398636 100644 --- a/src/com/droidquest/levels/ROTutF.java +++ b/src/com/droidquest/levels/ROTutF.java @@ -11,7 +11,7 @@ import com.droidquest.items.*; import com.droidquest.materials.Material; import com.droidquest.materials.PanicButton; import com.droidquest.materials.Portal; -import com.droidquest.materials.Switch; +import com.droidquest.materials.switches.Switch; import java.awt.*; diff --git a/src/com/droidquest/items/ElevatorSwitch.java b/src/com/droidquest/materials/switches/ElevatorSwitch.java similarity index 91% rename from src/com/droidquest/items/ElevatorSwitch.java rename to src/com/droidquest/materials/switches/ElevatorSwitch.java index 2ca5219..b96325a 100644 --- a/src/com/droidquest/items/ElevatorSwitch.java +++ b/src/com/droidquest/materials/switches/ElevatorSwitch.java @@ -1,9 +1,10 @@ -package com.droidquest.items; +package com.droidquest.materials.switches; import com.droidquest.Room; import com.droidquest.decorations.Arrow; +import com.droidquest.items.Item; import com.droidquest.materials.ElevatorOutPortal; -import com.droidquest.materials.Switch; +import com.droidquest.materials.Material; public class ElevatorSwitch extends Switch { private int animationState = 0; @@ -45,7 +46,7 @@ public class ElevatorSwitch extends Switch { animationState++; break; case 3: - if (ElevatorOutPortal.outRoom == level.rooms.elementAt(11)) { + if (ElevatorOutPortal.outRoom == Material.level.rooms.elementAt(11)) { for (int a = 0; a < room.arrows.size(); a++) { Arrow arrow = room.arrows.elementAt(a); arrow.direction = Arrow.DIR_UP; diff --git a/src/com/droidquest/items/MazeLock.java b/src/com/droidquest/materials/switches/MazeLock.java similarity index 57% rename from src/com/droidquest/items/MazeLock.java rename to src/com/droidquest/materials/switches/MazeLock.java index 0f98f79..c47d922 100644 --- a/src/com/droidquest/items/MazeLock.java +++ b/src/com/droidquest/materials/switches/MazeLock.java @@ -1,6 +1,7 @@ -package com.droidquest.items; +package com.droidquest.materials.switches; -import com.droidquest.materials.Switch; +import com.droidquest.items.Item; +import com.droidquest.materials.Material; public class MazeLock extends Switch { @@ -12,15 +13,15 @@ public class MazeLock extends Switch { public void TouchedByItem(Item item) { if (paintbrush == null) { - paintbrush = level.paintbrush; + paintbrush = Material.level.paintbrush; } if (!value) { - level.paintbrush = null; + Material.level.paintbrush = null; value = true; } else { - level.paintbrush = paintbrush; + Material.level.paintbrush = paintbrush; value = false; } } diff --git a/src/com/droidquest/materials/Switch.java b/src/com/droidquest/materials/switches/Switch.java similarity index 98% rename from src/com/droidquest/materials/Switch.java rename to src/com/droidquest/materials/switches/Switch.java index 50a53e3..8c647dc 100644 --- a/src/com/droidquest/materials/Switch.java +++ b/src/com/droidquest/materials/switches/Switch.java @@ -1,7 +1,8 @@ -package com.droidquest.materials; +package com.droidquest.materials.switches; import com.droidquest.Room; import com.droidquest.items.Item; +import com.droidquest.materials.Material; import javax.swing.*; import java.awt.*; diff --git a/src/com/droidquest/materials/Switch1.java b/src/com/droidquest/materials/switches/Switch1.java similarity index 74% rename from src/com/droidquest/materials/Switch1.java rename to src/com/droidquest/materials/switches/Switch1.java index abb1e0b..7807e29 100644 --- a/src/com/droidquest/materials/Switch1.java +++ b/src/com/droidquest/materials/switches/Switch1.java @@ -1,7 +1,8 @@ -package com.droidquest.materials; +package com.droidquest.materials.switches; import com.droidquest.items.Item; import com.droidquest.items.Train; +import com.droidquest.materials.Material; public class Switch1 extends Switch { private transient Train train; @@ -12,8 +13,8 @@ public class Switch1 extends Switch { public void TouchedByItem(Item item) { if (train == null) { - for (int a = 0; a < level.items.size(); a++) { - Item t = level.items.elementAt(a); + for (int a = 0; a < Material.level.items.size(); a++) { + Item t = Material.level.items.elementAt(a); if (t.getClass().toString().endsWith("Train")) { train = (Train) t; } diff --git a/src/com/droidquest/items/Switch4A.java b/src/com/droidquest/materials/switches/Switch4A.java similarity index 98% rename from src/com/droidquest/items/Switch4A.java rename to src/com/droidquest/materials/switches/Switch4A.java index 686c35d..81d400b 100644 --- a/src/com/droidquest/items/Switch4A.java +++ b/src/com/droidquest/materials/switches/Switch4A.java @@ -1,7 +1,7 @@ -package com.droidquest.items; +package com.droidquest.materials.switches; import com.droidquest.Room; -import com.droidquest.materials.Switch; +import com.droidquest.items.Item; public class Switch4A extends Switch { int count = 0; diff --git a/src/com/droidquest/items/Switch4B.java b/src/com/droidquest/materials/switches/Switch4B.java similarity index 70% rename from src/com/droidquest/items/Switch4B.java rename to src/com/droidquest/materials/switches/Switch4B.java index 5b9e2e0..f8a6acf 100644 --- a/src/com/droidquest/items/Switch4B.java +++ b/src/com/droidquest/materials/switches/Switch4B.java @@ -1,7 +1,7 @@ -package com.droidquest.items; +package com.droidquest.materials.switches; +import com.droidquest.items.Item; import com.droidquest.materials.Material; -import com.droidquest.materials.Switch; public class Switch4B extends Switch { private transient Switch4A sw = null; @@ -12,8 +12,8 @@ public class Switch4B extends Switch { public void TouchedByItem(Item item) { if (sw == null) { - for (int a = 0; a < level.materials.size(); a++) { - Material mat = level.materials.elementAt(a); + for (int a = 0; a < Material.level.materials.size(); a++) { + Material mat = Material.level.materials.elementAt(a); if (mat instanceof Switch4A) { sw = (Switch4A) mat; } diff --git a/src/com/droidquest/items/Switch4C.java b/src/com/droidquest/materials/switches/Switch4C.java similarity index 69% rename from src/com/droidquest/items/Switch4C.java rename to src/com/droidquest/materials/switches/Switch4C.java index 4c0d222..b2efb6b 100644 --- a/src/com/droidquest/items/Switch4C.java +++ b/src/com/droidquest/materials/switches/Switch4C.java @@ -1,7 +1,7 @@ -package com.droidquest.items; +package com.droidquest.materials.switches; +import com.droidquest.items.Item; import com.droidquest.materials.Material; -import com.droidquest.materials.Switch; public class Switch4C extends Switch { private transient Switch4A sw = null; @@ -12,8 +12,8 @@ public class Switch4C extends Switch { public void TouchedByItem(Item item) { if (sw == null) { - for (int a = 0; a < level.materials.size(); a++) { - Material mat = level.materials.elementAt(a); + for (int a = 0; a < Material.level.materials.size(); a++) { + Material mat = Material.level.materials.elementAt(a); if (mat instanceof Switch4A) { sw = (Switch4A) mat; } diff --git a/src/com/droidquest/items/Switch4D.java b/src/com/droidquest/materials/switches/Switch4D.java similarity index 70% rename from src/com/droidquest/items/Switch4D.java rename to src/com/droidquest/materials/switches/Switch4D.java index 4d64f40..4f60bf4 100644 --- a/src/com/droidquest/items/Switch4D.java +++ b/src/com/droidquest/materials/switches/Switch4D.java @@ -1,7 +1,7 @@ -package com.droidquest.items; +package com.droidquest.materials.switches; +import com.droidquest.items.Item; import com.droidquest.materials.Material; -import com.droidquest.materials.Switch; public class Switch4D extends Switch { private transient Switch4A sw = null; @@ -12,8 +12,8 @@ public class Switch4D extends Switch { public void TouchedByItem(Item item) { if (sw == null) { - for (int a = 0; a < level.materials.size(); a++) { - Material mat = level.materials.elementAt(a); + for (int a = 0; a < Material.level.materials.size(); a++) { + Material mat = Material.level.materials.elementAt(a); if (mat instanceof Switch4A) { sw = (Switch4A) mat; } diff --git a/src/com/droidquest/materials/SwitchA.java b/src/com/droidquest/materials/switches/SwitchA.java similarity index 89% rename from src/com/droidquest/materials/SwitchA.java rename to src/com/droidquest/materials/switches/SwitchA.java index 99243ea..7c8fddd 100644 --- a/src/com/droidquest/materials/SwitchA.java +++ b/src/com/droidquest/materials/switches/SwitchA.java @@ -1,4 +1,4 @@ -package com.droidquest.materials; +package com.droidquest.materials.switches; import com.droidquest.items.Item; @@ -11,7 +11,7 @@ public class SwitchA extends Switch { // something like that. public SwitchA() { - super(Switch.ROT_LEFT); + super(ROT_LEFT); } public void TouchedByItem(Item item) { diff --git a/src/com/droidquest/materials/SwitchB.java b/src/com/droidquest/materials/switches/SwitchB.java similarity index 93% rename from src/com/droidquest/materials/SwitchB.java rename to src/com/droidquest/materials/switches/SwitchB.java index 9529b81..28cc052 100644 --- a/src/com/droidquest/materials/SwitchB.java +++ b/src/com/droidquest/materials/switches/SwitchB.java @@ -1,8 +1,9 @@ -package com.droidquest.materials; +package com.droidquest.materials.switches; import com.droidquest.decorations.TextBox; import com.droidquest.items.Item; import com.droidquest.items.Sentry; +import com.droidquest.materials.Material; public class SwitchB extends Switch { private transient SwitchA switchA = null; @@ -10,7 +11,7 @@ public class SwitchB extends Switch { private transient Sentry sentry = null; public SwitchB() { - super(Switch.ROT_LEFT); + super(ROT_LEFT); } public void TouchedByItem(Item item) {