MCPcopy Index your code
hub / github.com/battlecode/battlecode-2018 / initial_start_turn_message

Method initial_start_turn_message

battlecode-engine/src/world.rs:2041–2063  ·  view source on GitHub ↗
(&self, time_left_ms: i32)

Source from the content-addressed store, hash-verified

2039 }
2040
2041 pub(crate) fn initial_start_turn_message(&self, time_left_ms: i32) -> StartTurnMessage {
2042 let initial_player = Player::first_to_move();
2043 let world = self.cached_world(initial_player);
2044 if world.round != 1 {
2045 panic!("You should only get the initial STM on round 1.");
2046 }
2047
2048 StartTurnMessage {
2049 time_left_ms,
2050 round: world.round,
2051 visible_locs: world.my_planet().visible_locs.clone(),
2052 units_changed: vec![],
2053 units_vanished: vec![],
2054 karbonite_changed: vec![],
2055 id_generator: world.id_generator.clone(),
2056 units_in_space_changed: vec![],
2057 units_in_space_vanished: vec![],
2058 other_array_changed: vec![],
2059 rocket_landings: world.my_team().rocket_landings.clone(),
2060 research: world.my_team().research.clone(),
2061 karbonite: world.my_team().karbonite,
2062 }
2063 }
2064
2065 /// Updates the current player in the game. If a round of four turns has
2066 /// finished, also processes the end of the round. This includes updating

Callers 1

__init__Method · 0.45

Calls 4

cached_worldMethod · 0.80
cloneMethod · 0.80
my_planetMethod · 0.80
my_teamMethod · 0.80

Tested by

no test coverage detected