(rootRoomId int)
| 213 | } |
| 214 | |
| 215 | func NewMapper(rootRoomId int) *mapper { |
| 216 | rootZone := "" |
| 217 | if room := rooms.LoadRoom(rootRoomId); room != nil { |
| 218 | rootZone = room.Zone |
| 219 | } |
| 220 | return &mapper{ |
| 221 | rootRoomId: rootRoomId, |
| 222 | rootZone: rootZone, |
| 223 | crawledRooms: make(map[int]*mapNode, 100), // pre-allocate 100 |
| 224 | roomGrid: RoomGrid{ |
| 225 | rooms: [][][]*mapNode{}, |
| 226 | }, |
| 227 | } |
| 228 | } |
| 229 | |
| 230 | type crawlRoom struct { |
| 231 | RoomId int |