Moved switches to their own package inside materials
This commit is contained in:
parent
97bc20059c
commit
e3c76fa9d3
@ -12,6 +12,8 @@ import com.droidquest.devices.ContactSensor;
|
|||||||
import com.droidquest.devices.SmallChip;
|
import com.droidquest.devices.SmallChip;
|
||||||
import com.droidquest.items.*;
|
import com.droidquest.items.*;
|
||||||
import com.droidquest.materials.*;
|
import com.droidquest.materials.*;
|
||||||
|
import com.droidquest.materials.switches.Switch;
|
||||||
|
import com.droidquest.materials.switches.Switch1;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -15,6 +15,9 @@ import com.droidquest.devices.StormShield;
|
|||||||
import com.droidquest.items.Button;
|
import com.droidquest.items.Button;
|
||||||
import com.droidquest.items.*;
|
import com.droidquest.items.*;
|
||||||
import com.droidquest.materials.*;
|
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.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -10,6 +10,10 @@ import com.droidquest.decorations.Graphix;
|
|||||||
import com.droidquest.devices.SmallChip;
|
import com.droidquest.devices.SmallChip;
|
||||||
import com.droidquest.items.*;
|
import com.droidquest.items.*;
|
||||||
import com.droidquest.materials.*;
|
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.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -10,6 +10,7 @@ import com.droidquest.decorations.Arrow;
|
|||||||
import com.droidquest.decorations.Graphix;
|
import com.droidquest.decorations.Graphix;
|
||||||
import com.droidquest.items.*;
|
import com.droidquest.items.*;
|
||||||
import com.droidquest.materials.*;
|
import com.droidquest.materials.*;
|
||||||
|
import com.droidquest.materials.switches.Switch;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -11,6 +11,7 @@ import com.droidquest.decorations.Graphix;
|
|||||||
import com.droidquest.devices.DirectionalSensor;
|
import com.droidquest.devices.DirectionalSensor;
|
||||||
import com.droidquest.items.*;
|
import com.droidquest.items.*;
|
||||||
import com.droidquest.materials.*;
|
import com.droidquest.materials.*;
|
||||||
|
import com.droidquest.materials.switches.Switch;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -8,6 +8,7 @@ import com.droidquest.decorations.Arrow;
|
|||||||
import com.droidquest.devices.*;
|
import com.droidquest.devices.*;
|
||||||
import com.droidquest.items.*;
|
import com.droidquest.items.*;
|
||||||
import com.droidquest.materials.*;
|
import com.droidquest.materials.*;
|
||||||
|
import com.droidquest.materials.switches.MazeLock;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -9,6 +9,7 @@ import com.droidquest.decorations.Arrow;
|
|||||||
import com.droidquest.devices.*;
|
import com.droidquest.devices.*;
|
||||||
import com.droidquest.items.*;
|
import com.droidquest.items.*;
|
||||||
import com.droidquest.materials.*;
|
import com.droidquest.materials.*;
|
||||||
|
import com.droidquest.materials.switches.MazeLock;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -11,7 +11,7 @@ import com.droidquest.items.*;
|
|||||||
import com.droidquest.materials.Material;
|
import com.droidquest.materials.Material;
|
||||||
import com.droidquest.materials.PanicButton;
|
import com.droidquest.materials.PanicButton;
|
||||||
import com.droidquest.materials.Portal;
|
import com.droidquest.materials.Portal;
|
||||||
import com.droidquest.materials.Switch;
|
import com.droidquest.materials.switches.Switch;
|
||||||
|
|
||||||
import java.awt.*;
|
import java.awt.*;
|
||||||
|
|
||||||
|
@ -1,9 +1,10 @@
|
|||||||
package com.droidquest.items;
|
package com.droidquest.materials.switches;
|
||||||
|
|
||||||
import com.droidquest.Room;
|
import com.droidquest.Room;
|
||||||
import com.droidquest.decorations.Arrow;
|
import com.droidquest.decorations.Arrow;
|
||||||
|
import com.droidquest.items.Item;
|
||||||
import com.droidquest.materials.ElevatorOutPortal;
|
import com.droidquest.materials.ElevatorOutPortal;
|
||||||
import com.droidquest.materials.Switch;
|
import com.droidquest.materials.Material;
|
||||||
|
|
||||||
public class ElevatorSwitch extends Switch {
|
public class ElevatorSwitch extends Switch {
|
||||||
private int animationState = 0;
|
private int animationState = 0;
|
||||||
@ -45,7 +46,7 @@ public class ElevatorSwitch extends Switch {
|
|||||||
animationState++;
|
animationState++;
|
||||||
break;
|
break;
|
||||||
case 3:
|
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++) {
|
for (int a = 0; a < room.arrows.size(); a++) {
|
||||||
Arrow arrow = room.arrows.elementAt(a);
|
Arrow arrow = room.arrows.elementAt(a);
|
||||||
arrow.direction = Arrow.DIR_UP;
|
arrow.direction = Arrow.DIR_UP;
|
@ -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 {
|
public class MazeLock extends Switch {
|
||||||
@ -12,15 +13,15 @@ public class MazeLock extends Switch {
|
|||||||
|
|
||||||
public void TouchedByItem(Item item) {
|
public void TouchedByItem(Item item) {
|
||||||
if (paintbrush == null) {
|
if (paintbrush == null) {
|
||||||
paintbrush = level.paintbrush;
|
paintbrush = Material.level.paintbrush;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (!value) {
|
if (!value) {
|
||||||
level.paintbrush = null;
|
Material.level.paintbrush = null;
|
||||||
value = true;
|
value = true;
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
level.paintbrush = paintbrush;
|
Material.level.paintbrush = paintbrush;
|
||||||
value = false;
|
value = false;
|
||||||
}
|
}
|
||||||
}
|
}
|
@ -1,7 +1,8 @@
|
|||||||
package com.droidquest.materials;
|
package com.droidquest.materials.switches;
|
||||||
|
|
||||||
import com.droidquest.Room;
|
import com.droidquest.Room;
|
||||||
import com.droidquest.items.Item;
|
import com.droidquest.items.Item;
|
||||||
|
import com.droidquest.materials.Material;
|
||||||
|
|
||||||
import javax.swing.*;
|
import javax.swing.*;
|
||||||
import java.awt.*;
|
import java.awt.*;
|
@ -1,7 +1,8 @@
|
|||||||
package com.droidquest.materials;
|
package com.droidquest.materials.switches;
|
||||||
|
|
||||||
import com.droidquest.items.Item;
|
import com.droidquest.items.Item;
|
||||||
import com.droidquest.items.Train;
|
import com.droidquest.items.Train;
|
||||||
|
import com.droidquest.materials.Material;
|
||||||
|
|
||||||
public class Switch1 extends Switch {
|
public class Switch1 extends Switch {
|
||||||
private transient Train train;
|
private transient Train train;
|
||||||
@ -12,8 +13,8 @@ public class Switch1 extends Switch {
|
|||||||
|
|
||||||
public void TouchedByItem(Item item) {
|
public void TouchedByItem(Item item) {
|
||||||
if (train == null) {
|
if (train == null) {
|
||||||
for (int a = 0; a < level.items.size(); a++) {
|
for (int a = 0; a < Material.level.items.size(); a++) {
|
||||||
Item t = level.items.elementAt(a);
|
Item t = Material.level.items.elementAt(a);
|
||||||
if (t.getClass().toString().endsWith("Train")) {
|
if (t.getClass().toString().endsWith("Train")) {
|
||||||
train = (Train) t;
|
train = (Train) t;
|
||||||
}
|
}
|
@ -1,7 +1,7 @@
|
|||||||
package com.droidquest.items;
|
package com.droidquest.materials.switches;
|
||||||
|
|
||||||
import com.droidquest.Room;
|
import com.droidquest.Room;
|
||||||
import com.droidquest.materials.Switch;
|
import com.droidquest.items.Item;
|
||||||
|
|
||||||
public class Switch4A extends Switch {
|
public class Switch4A extends Switch {
|
||||||
int count = 0;
|
int count = 0;
|
@ -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.Material;
|
||||||
import com.droidquest.materials.Switch;
|
|
||||||
|
|
||||||
public class Switch4B extends Switch {
|
public class Switch4B extends Switch {
|
||||||
private transient Switch4A sw = null;
|
private transient Switch4A sw = null;
|
||||||
@ -12,8 +12,8 @@ public class Switch4B extends Switch {
|
|||||||
|
|
||||||
public void TouchedByItem(Item item) {
|
public void TouchedByItem(Item item) {
|
||||||
if (sw == null) {
|
if (sw == null) {
|
||||||
for (int a = 0; a < level.materials.size(); a++) {
|
for (int a = 0; a < Material.level.materials.size(); a++) {
|
||||||
Material mat = level.materials.elementAt(a);
|
Material mat = Material.level.materials.elementAt(a);
|
||||||
if (mat instanceof Switch4A) {
|
if (mat instanceof Switch4A) {
|
||||||
sw = (Switch4A) mat;
|
sw = (Switch4A) mat;
|
||||||
}
|
}
|
@ -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.Material;
|
||||||
import com.droidquest.materials.Switch;
|
|
||||||
|
|
||||||
public class Switch4C extends Switch {
|
public class Switch4C extends Switch {
|
||||||
private transient Switch4A sw = null;
|
private transient Switch4A sw = null;
|
||||||
@ -12,8 +12,8 @@ public class Switch4C extends Switch {
|
|||||||
|
|
||||||
public void TouchedByItem(Item item) {
|
public void TouchedByItem(Item item) {
|
||||||
if (sw == null) {
|
if (sw == null) {
|
||||||
for (int a = 0; a < level.materials.size(); a++) {
|
for (int a = 0; a < Material.level.materials.size(); a++) {
|
||||||
Material mat = level.materials.elementAt(a);
|
Material mat = Material.level.materials.elementAt(a);
|
||||||
if (mat instanceof Switch4A) {
|
if (mat instanceof Switch4A) {
|
||||||
sw = (Switch4A) mat;
|
sw = (Switch4A) mat;
|
||||||
}
|
}
|
@ -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.Material;
|
||||||
import com.droidquest.materials.Switch;
|
|
||||||
|
|
||||||
public class Switch4D extends Switch {
|
public class Switch4D extends Switch {
|
||||||
private transient Switch4A sw = null;
|
private transient Switch4A sw = null;
|
||||||
@ -12,8 +12,8 @@ public class Switch4D extends Switch {
|
|||||||
|
|
||||||
public void TouchedByItem(Item item) {
|
public void TouchedByItem(Item item) {
|
||||||
if (sw == null) {
|
if (sw == null) {
|
||||||
for (int a = 0; a < level.materials.size(); a++) {
|
for (int a = 0; a < Material.level.materials.size(); a++) {
|
||||||
Material mat = level.materials.elementAt(a);
|
Material mat = Material.level.materials.elementAt(a);
|
||||||
if (mat instanceof Switch4A) {
|
if (mat instanceof Switch4A) {
|
||||||
sw = (Switch4A) mat;
|
sw = (Switch4A) mat;
|
||||||
}
|
}
|
@ -1,4 +1,4 @@
|
|||||||
package com.droidquest.materials;
|
package com.droidquest.materials.switches;
|
||||||
|
|
||||||
import com.droidquest.items.Item;
|
import com.droidquest.items.Item;
|
||||||
|
|
||||||
@ -11,7 +11,7 @@ public class SwitchA extends Switch {
|
|||||||
// something like that.
|
// something like that.
|
||||||
|
|
||||||
public SwitchA() {
|
public SwitchA() {
|
||||||
super(Switch.ROT_LEFT);
|
super(ROT_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TouchedByItem(Item item) {
|
public void TouchedByItem(Item item) {
|
@ -1,8 +1,9 @@
|
|||||||
package com.droidquest.materials;
|
package com.droidquest.materials.switches;
|
||||||
|
|
||||||
import com.droidquest.decorations.TextBox;
|
import com.droidquest.decorations.TextBox;
|
||||||
import com.droidquest.items.Item;
|
import com.droidquest.items.Item;
|
||||||
import com.droidquest.items.Sentry;
|
import com.droidquest.items.Sentry;
|
||||||
|
import com.droidquest.materials.Material;
|
||||||
|
|
||||||
public class SwitchB extends Switch {
|
public class SwitchB extends Switch {
|
||||||
private transient SwitchA switchA = null;
|
private transient SwitchA switchA = null;
|
||||||
@ -10,7 +11,7 @@ public class SwitchB extends Switch {
|
|||||||
private transient Sentry sentry = null;
|
private transient Sentry sentry = null;
|
||||||
|
|
||||||
public SwitchB() {
|
public SwitchB() {
|
||||||
super(Switch.ROT_LEFT);
|
super(ROT_LEFT);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void TouchedByItem(Item item) {
|
public void TouchedByItem(Item item) {
|
Loading…
Reference in New Issue
Block a user