Explorar el Código

Moved switches to their own package inside materials

tags/2.7
cognitivegears hace 5 años
padre
commit
e3c76fa9d3
Se han modificado 18 ficheros con 49 adiciones y 31 borrados
  1. +2
    -0
      src/com/droidquest/levels/RO2.java
  2. +3
    -0
      src/com/droidquest/levels/RO3.java
  3. +4
    -0
      src/com/droidquest/levels/RO4.java
  4. +1
    -0
      src/com/droidquest/levels/RO5.java
  5. +1
    -0
      src/com/droidquest/levels/RO6.java
  6. +1
    -0
      src/com/droidquest/levels/ROLab.java
  7. +1
    -0
      src/com/droidquest/levels/ROTut3.java
  8. +1
    -1
      src/com/droidquest/levels/ROTutF.java
  9. +4
    -3
      src/com/droidquest/materials/switches/ElevatorSwitch.java
  10. +6
    -5
      src/com/droidquest/materials/switches/MazeLock.java
  11. +2
    -1
      src/com/droidquest/materials/switches/Switch.java
  12. +4
    -3
      src/com/droidquest/materials/switches/Switch1.java
  13. +2
    -2
      src/com/droidquest/materials/switches/Switch4A.java
  14. +4
    -4
      src/com/droidquest/materials/switches/Switch4B.java
  15. +4
    -4
      src/com/droidquest/materials/switches/Switch4C.java
  16. +4
    -4
      src/com/droidquest/materials/switches/Switch4D.java
  17. +2
    -2
      src/com/droidquest/materials/switches/SwitchA.java
  18. +3
    -2
      src/com/droidquest/materials/switches/SwitchB.java

+ 2
- 0
src/com/droidquest/levels/RO2.java Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

@@ -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 Ver fichero

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

Cargando…
Cancelar
Guardar