Example #1
0
 public void tryFillInExtraneousExternal(WorldMap.CrossExit EX, Exit ox, Room linkFrom) {
   if (EX == null) return;
   Room linkTo = CMLib.map().getRoom(EX.destRoomID);
   if ((linkTo != null) && (linkTo.getGridParent() != null)) linkTo = linkTo.getGridParent();
   if ((linkTo != null) && (linkFrom.rawDoors()[EX.dir] != linkTo)) {
     if (ox == null) ox = CMClass.getExit("Open");
     linkFrom.rawDoors()[EX.dir] = linkTo;
     linkFrom.setRawExit(EX.dir, ox);
   }
 }
Example #2
0
 protected void linkRoom(Room room, Room loc, int dirCode, Exit o, Exit ao) {
   if (loc == null) return;
   if (room == null) return;
   int opCode = Directions.getOpDirectionCode(dirCode);
   if (room.rawDoors()[dirCode] != null) {
     if (room.rawDoors()[dirCode].getGridParent() == null) return;
     if (room.rawDoors()[dirCode].getGridParent().isMyGridChild(room.rawDoors()[dirCode])) return;
     room.rawDoors()[dirCode] = null;
   }
   if (o == null) o = CMClass.getExit("Open");
   room.rawDoors()[dirCode] = alternativeLink(room, loc, dirCode);
   room.setRawExit(dirCode, o);
   if (loc.rawDoors()[opCode] != null) {
     if (loc.rawDoors()[opCode].getGridParent() == null) return;
     if (loc.rawDoors()[opCode].getGridParent().isMyGridChild(loc.rawDoors()[opCode])) return;
     loc.rawDoors()[opCode] = null;
   }
   if (ao == null) ao = CMClass.getExit("Open");
   loc.rawDoors()[opCode] = alternativeLink(loc, room, opCode);
   loc.setRawExit(opCode, ao);
 }
Example #3
0
 protected void halfLink(Room room, Room loc, int dirCode, Exit o) {
   if (room == null) return;
   if (loc == null) return;
   if (room.rawDoors()[dirCode] != null) {
     if (room.rawDoors()[dirCode].getGridParent() == null) return;
     if (room.rawDoors()[dirCode].getGridParent().isMyGridChild(room.rawDoors()[dirCode])) return;
     room.rawDoors()[dirCode] = null;
   }
   if (o == null) o = CMClass.getExit("Open");
   room.rawDoors()[dirCode] = alternativeLink(room, loc, dirCode);
   room.setRawExit(dirCode, o);
 }
Example #4
0
 public void executeMsg(Environmental myHost, CMMsg msg) {
   if ((msg.targetMinor() == CMMsg.TYP_EXPIRE) && (msg.target() instanceof Room)) {
     Room R = (Room) msg.target();
     if (R.getGridParent() == this) {
       if ((roomID().length() > 0) && (getArea() != null))
         getArea().delProperRoomnumber(getGridChildCode(R));
       DVector thisGridRooms = rooms;
       thisGridRooms.removeElement(R);
       Room R2 = null;
       for (int r = thisGridRooms.size() - 1; r >= 0; r--) {
         R2 = (Room) thisGridRooms.elementAt(r, 1);
         for (int d = Directions.NUM_DIRECTIONS() - 1; d >= 0; d--)
           if (R2.rawDoors()[d] == R) {
             R2.rawDoors()[d] = null;
             R2.setRawExit(d, null);
           }
       }
     }
   }
   super.executeMsg(myHost, msg);
 }