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

Method duration

battlecode-engine/src/map/mod.rs:580–584  ·  view source on GitHub ↗

Get the duration of flight if the rocket were to take off from either planet on the given round.

(&self, round: Rounds)

Source from the content-addressed store, hash-verified

578 /// Get the duration of flight if the rocket were to take off from either
579 /// planet on the given round.
580 pub fn duration(&self, round: Rounds) -> Rounds {
581 let arg = 2. * f32::consts::PI / self.period_s as f32 * round as f32;
582 let sin = ((self.amplitude_s as f32) * f32::sin(arg)) as i32;
583 (sin + self.center_s) as Rounds
584 }
585
586 /// Generates a random orbit pattern.
587 pub fn random(seed: u16) -> OrbitPattern {

Callers 3

launch_rocketMethod · 0.80
test_durationFunction · 0.80

Calls

no outgoing calls

Tested by 1

test_durationFunction · 0.64