--- deliantra/server/include/util.h 2006/12/21 06:12:36 1.21 +++ deliantra/server/include/util.h 2006/12/30 10:16:10 1.25 @@ -8,9 +8,14 @@ #endif #include +#include +#include #include +#include +#include + // use a gcc extension for auto declarations until ISO C++ sanctifies them #define AUTODECL(var,expr) typeof(expr) var = (expr) @@ -122,21 +127,6 @@ } }; -struct refcounted -{ - refcounted () : refcnt (0) { } -// virtual ~refcounted (); - void refcnt_inc () { ++refcnt; } - void refcnt_dec () { --refcnt; } - bool dead () { return refcnt == 0; } - mutable int refcnt; -#if 0 -private: - static refcounted *rc_first; - refcounted *rc_next; -#endif -}; - template struct refptr { @@ -168,6 +158,12 @@ operator T *() const { return p; } }; +typedef refptr maptile_ptr; +typedef refptr object_ptr; +typedef refptr arch_ptr; +typedef refptr client_ptr; +typedef refptr player_ptr; + struct str_hash { std::size_t operator ()(const char *s) const @@ -202,8 +198,6 @@ } }; -#include - template struct unordered_vector : std::vector > { @@ -244,5 +238,7 @@ // return current time as timestampe tstamp now (); +int similar_direction (int a, int b); + #endif