19 lines
285 B
Zig
19 lines
285 B
Zig
|
|
const Vec2i = @This();
|
||
|
|
|
||
|
|
x: i32,
|
||
|
|
y: i32,
|
||
|
|
|
||
|
|
pub fn new(x: i32, y: i32) Vec2i {
|
||
|
|
return .{
|
||
|
|
.x = x,
|
||
|
|
.y = y,
|
||
|
|
};
|
||
|
|
}
|
||
|
|
|
||
|
|
pub const ZERO = new(0, 0);
|
||
|
|
pub const ONE = new(1, 1);
|
||
|
|
pub const NORTH = new(0, -1);
|
||
|
|
pub const SOUTH = new(0, 1);
|
||
|
|
pub const EAST = new(1, 0);
|
||
|
|
pub const WEST = new(-1, 0);
|