internal static DoorInstance LoadInstance(byte[] data, ref int oData) { DoorInstance result = new DoorInstance(); oData++; // First byte merely specifies its a door. We already know this. int low = data[oData] & 0x0F; int high = data[oData] & 0xF0; oData++; if (high == 0xA0) { result.Side = DoorSide.Right; } else if (high == 0xB0) { result.Side = DoorSide.Left; } else { result.Side = DoorSide.Invalid; } if (low <= 3) { result.Type = (DoorType)low; } else { result.Type = DoorType.Invalid; } return(result); }
internal DoorInstance Clone() { DoorInstance door = new DoorInstance(); door.Side = this.Side; door.Type = this.Type; return(door); }