summaryrefslogtreecommitdiff
path: root/NET/worlds/scape/TwoWayPortal.java
blob: ac07aacff7f64b05637238df907ddcda951eab8c (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
/*    */ package NET.worlds.scape;
/*    */ 
/*    */ import java.io.IOException;
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ 
/*    */ public class TwoWayPortal
/*    */   extends Portal
/*    */ {
/*    */   public TwoWayPortal(String targetRoom, float llx, float lly, float llz, float urx, float ury, float urz)
/*    */   {
/* 29 */     super(llx, lly, llz, urx, ury, urz);
/* 30 */     setFarSideInfo(null, targetRoom, null);
/*    */   }
/*    */   
/*    */ 
/*    */ 
/*    */ 
/* 36 */   private static Object classCookie = new Object();
/*    */   
/*    */   public TwoWayPortal() {}
/*    */   
/* 40 */   public void saveState(Saver s) throws IOException { s.saveVersion(0, classCookie);
/* 41 */     super.saveState(s);
/*    */   }
/*    */   
/*    */   public void restoreState(Restorer r) throws IOException, TooNewException
/*    */   {
/* 46 */     int vers = r.restoreVersion(classCookie);
/* 47 */     switch (vers) {
/*    */     case 0: 
/* 49 */       super.restoreState(r);
/* 50 */       break;
/*    */     default: 
/* 52 */       throw new TooNewException();
/*    */     }
/*    */     
/*    */   }
/*    */   
/*    */ 
/*    */   public void detach()
/*    */     throws ClassCastException
/*    */   {
/* 61 */     super.detach();
/* 62 */     Portal p = farSide();
/* 63 */     if (p != null) {
/* 64 */       p.detach();
/*    */     }
/*    */   }
/*    */   
/*    */ 
/*    */   public void reset(boolean showmessage)
/*    */   {
/* 71 */     super.reset(showmessage);
/*    */     
/* 73 */     if (farSideRoom() != null)
/*    */     {
/* 75 */       Portal p = farSide();
/* 76 */       if (p != null) {
/* 77 */         if (p.isActive()) {
/* 78 */           return;
/*    */         }
/*    */         
/* 81 */         p.detach();
/* 82 */         bidisconnect();
/*    */       }
/*    */       
/* 85 */       Point3Temp left = getWorldPosition();
/* 86 */       Point3Temp right = getFarCorner();
/* 87 */       p = new Portal(right.x, right.y, left.z, left.x, left.y, right.z);
/* 88 */       farSideRoom().add(p);
/*    */       
/* 90 */       biconnect(p);
/*    */     }
/*    */   }
/*    */ }


/* Location:              C:\Program Files (x86)\Worlds Inc\WorldsPlayer - Win7\lib\worlds.jar!\NET\worlds\scape\TwoWayPortal.class
 * Java compiler version: 6 (50.0)
 * JD-Core Version:       0.7.1
 */