MCPcopy Create free account
hub / github.com/battlecode/battlecode-2018 / new_manager

Method new_manager

battlecode-engine/src/controller/mod.rs:1078–1089  ·  view source on GitHub ↗

Initializes the game world and creates a new controller for the manager to interact with it. DO NOT CALL THIS FUNCTION UNLESS YOU ARE THE MANAGER!

(map: GameMap)

Source from the content-addressed store, hash-verified

1076 ///
1077 /// DO NOT CALL THIS FUNCTION UNLESS YOU ARE THE MANAGER!
1078 pub fn new_manager(map: GameMap) -> GameController {
1079 let world = GameWorld::new(map);
1080 GameController {
1081 world: world.clone(),
1082 old_world: world,
1083 config: Config::runner_config(),
1084 turn: TurnMessage { changes: vec![] },
1085 stream: None,
1086 player_key: None,
1087 time_left_ms: None,
1088 }
1089 }
1090
1091 /// The start turn message to send to the first player to move. Should
1092 /// only be called on Round 1, and should only be sent to Red Earth.

Callers 2

test_controllerFunction · 0.80
__init__Method · 0.80

Calls 1

cloneMethod · 0.80

Tested by 1

test_controllerFunction · 0.64