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

Method dy

battlecode-engine/src/location.rs:76–88  ·  view source on GitHub ↗

Returns the y displacement of this direction.

(&self)

Source from the content-addressed store, hash-verified

74
75 /// Returns the y displacement of this direction.
76 pub fn dy(&self) -> i32 {
77 match *self {
78 North => 1,
79 Northeast => 1,
80 East => 0,
81 Southeast => -1,
82 South => -1,
83 Southwest => -1,
84 West => 0,
85 Northwest => 1,
86 Center => 0,
87 }
88 }
89
90 /// Whether this direction is a diagonal one.
91 pub fn is_diagonal(&self) -> bool {

Callers 3

addMethod · 0.80
subtractMethod · 0.80
add_multipleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected