the game where you go into mines and start crafting! but for consoles (forked directly from smartcmd's github)
at main 66 lines 1.3 kB view raw
1#pragma once 2// Pos implements Comparable<Pos> 3// We don't REALLY need it as it's main use it to make things easy 4// to handle in the java array/list classes, but adding to help 5// maintain as much original code as possible 6 7//class Pos //implements Comparable<Pos> 8class Pos 9{ 10public: 11 int x; 12 int y; 13 int z; 14 15 Pos(); 16 17 Pos(int x, int y, int z); 18 19 Pos(Pos *position); 20 21 //@Override 22 //public boolean equals(Object other) 23 bool equals(void *other); 24 25 int hashCode(); 26 int compareTo(Pos *pos); 27 Pos *offset(int x, int y, int z); 28 void set(int x, int y, int z); 29 void set(Pos *pos); 30 31 Pos *above(); 32 Pos *above(int steps); 33 Pos *below(); 34 Pos *below(int steps); 35 Pos *north(); 36 Pos *north(int steps); 37 Pos *south(); 38 Pos *south(int steps); 39 Pos *west(); 40 Pos *west(int steps); 41 Pos *east(); 42 Pos *east(int steps); 43 44 void move(int x, int y, int z); 45 void move(Pos pos); 46 void moveX(int steps); 47 void moveY(int steps); 48 void moveZ(int steps); 49 void moveUp(int steps); 50 void moveUp(); 51 void moveDown(int steps); 52 void moveDown(); 53 void moveEast(int steps); 54 void moveEast(); 55 void moveWest(int steps); 56 void moveWest(); 57 void moveNorth(int steps); 58 void moveNorth(); 59 void moveSouth(int steps); 60 void moveSouth(); 61 62 double dist(int x, int y, int z); 63 double dist(Pos *pos); 64 float distSqr(int x, int y, int z); 65 float distSqr(Pos *pos); 66};