// Byond direction defines, because I want to put them somewhere. // #define NORTH 1 // #define SOUTH 2 // #define EAST 4 // #define WEST 8 /// North direction as a string "[1]" #define TEXT_NORTH "[NORTH]" /// South direction as a string "[2]" #define TEXT_SOUTH "[SOUTH]" /// East direction as a string "[4]" #define TEXT_EAST "[EAST]" /// West direction as a string "[8]" #define TEXT_WEST "[WEST]" //dir macros ///Returns true if the dir is diagonal, false otherwise #define ISDIAGONALDIR(d) (d&(d-1)) ///True if the dir is north or south, false therwise #define NSCOMPONENT(d) (d&(NORTH|SOUTH)) ///True if the dir is east/west, false otherwise #define EWCOMPONENT(d) (d&(EAST|WEST)) ///Flips the dir for north/south directions #define NSDIRFLIP(d) (d^(NORTH|SOUTH)) ///Flips the dir for east/west directions #define EWDIRFLIP(d) (d^(EAST|WEST)) /// Inverse direction, taking into account UP|DOWN if necessary. #define REVERSE_DIR(dir) ( ((dir & 85) << 1) | ((dir & 170) >> 1) )