MCPcopy Create free account
hub / github.com/GoMudEngine/GoMud / buildTestMapper

Function buildTestMapper

internal/mapper/mapper.path_test.go:11–19  ·  view source on GitHub ↗

buildTestMapper creates a simple 3-room chain: 1 -east-> 2 -south-> 3

()

Source from the content-addressed store, hash-verified

9
10// buildTestMapper creates a simple 3-room chain: 1 -east-> 2 -south-> 3
11func buildTestMapper() *mapper {
12 m := NewMapper(1)
13 m.crawledRooms = map[int]*mapNode{
14 1: {RoomId: 1, Pos: positionDelta{x: 0, y: 0, z: 0}, Exits: map[string]nodeExit{"east": {RoomId: 2}}},
15 2: {RoomId: 2, Pos: positionDelta{x: 1, y: 0, z: 0}, Exits: map[string]nodeExit{"south": {RoomId: 3}}},
16 3: {RoomId: 3, Pos: positionDelta{x: 1, y: 1, z: 0}, Exits: map[string]nodeExit{}},
17 }
18 return m
19}
20
21// buildCycleMapper creates a graph with a cycle: 1 <-> 2 -> 3
22func buildCycleMapper() *mapper {

Callers 2

Test_findPath_DestMatchFunction · 0.85
Test_findPath_SimpleFunction · 0.85

Calls 1

NewMapperFunction · 0.85

Tested by

no test coverage detected