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

Method dx

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

Returns the x displacement of this direction.

(&self)

Source from the content-addressed store, hash-verified

59
60 /// Returns the x displacement of this direction.
61 pub fn dx(&self) -> i32 {
62 match *self {
63 North => 0,
64 Northeast => 1,
65 East => 1,
66 Southeast => 1,
67 South => 0,
68 Southwest => -1,
69 West => -1,
70 Northwest => -1,
71 Center => 0,
72 }
73 }
74
75 /// Returns the y displacement of this direction.
76 pub fn dy(&self) -> i32 {

Callers 3

addMethod · 0.80
subtractMethod · 0.80
add_multipleMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected