Struct cogs_gamedev::grids::coords::ICoord [−][src]
Expand description
Signed-int coordinates
Fields
x: isizey: isizeImplementations
Return the quadrant this coordinate is in.
- 1: +X, +Y
- 2: -X, +Y
- 3: -X, -Y
- 4: +X, -Y
Zeroes are treated as positive.
assert_eq!(ICoord::new(4, 5).quadrant(), 1); assert_eq!(ICoord::new(-3, -2).quadrant(), 3); // Zero is treated as positive assert_eq!(ICoord::new(0, -8).quadrant(), 4); assert_eq!(ICoord::new(0, 0).quadrant(), 1);
Trait Implementations
Performs the += operation. Read more
Performs the += operation. Read more
Performs the += operation. Read more
Performs the *= operation. Read more
Try to convert an ICoord to a Coord. Will return Error if the ICoord has any negatives in it.
Auto Trait Implementations
impl RefUnwindSafe for ICoordimpl UnwindSafe for ICoordBlanket Implementations
Mutably borrows from an owned value. Read more
pub fn vzip(self) -> V