Browse Source

Moved switches to their own package inside materials

tags/2.7
cognitivegears 5 years ago
parent
commit
e3c76fa9d3

+ 2
- 0
src/com/droidquest/levels/RO2.java View File

@@ -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.*;


+ 3
- 0
src/com/droidquest/levels/RO3.java View File

@@ -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.*;


+ 4
- 0
src/com/droidquest/levels/RO4.java View File

@@ -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.*;


+ 1
- 0
src/com/droidquest/levels/RO5.java View File

@@ -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.*;


+ 1
- 0
src/com/droidquest/levels/RO6.java View File

@@ -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.*;


+ 1
- 0
src/com/droidquest/levels/ROLab.java View File

@@ -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.*;


+ 1
- 0
src/com/droidquest/levels/ROTut3.java View File

@@ -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.*;


+ 1
- 1
src/com/droidquest/levels/ROTutF.java View File

@@ -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.*;


src/com/droidquest/items/ElevatorSwitch.java → src/com/droidquest/materials/switches/ElevatorSwitch.java View File

@@ -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;

src/com/droidquest/items/MazeLock.java → src/com/droidquest/materials/switches/MazeLock.java View File

@@ -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;
}
}

src/com/droidquest/materials/Switch.java → src/com/droidquest/materials/switches/Switch.java View File

@@ -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.*;

src/com/droidquest/materials/Switch1.java → src/com/droidquest/materials/switches/Switch1.java View File

@@ -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;
}

src/com/droidquest/items/Switch4A.java → src/com/droidquest/materials/switches/Switch4A.java View File

@@ -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;

src/com/droidquest/items/Switch4B.java → src/com/droidquest/materials/switches/Switch4B.java View File

@@ -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;
}

src/com/droidquest/items/Switch4C.java → src/com/droidquest/materials/switches/Switch4C.java View File

@@ -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;
}

src/com/droidquest/items/Switch4D.java → src/com/droidquest/materials/switches/Switch4D.java View File

@@ -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;
}

src/com/droidquest/materials/SwitchA.java → src/com/droidquest/materials/switches/SwitchA.java View File

@@ -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) {

src/com/droidquest/materials/SwitchB.java → src/com/droidquest/materials/switches/SwitchB.java View File

@@ -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) {

Loading…
Cancel
Save