--- deliantra/server/include/traits.h 2006/12/20 09:14:22 1.8 +++ deliantra/server/include/traits.h 2007/04/25 18:47:50 1.13 @@ -1,15 +1,30 @@ #ifndef TRAITS_H__ #define TRAITS_H__ +#include + +typedef int8_t sint8; +typedef uint8_t uint8; +typedef int16_t sint16; +typedef uint16_t uint16; +typedef int32_t sint32; +typedef uint32_t uint32; +typedef int64_t sint64; +typedef uint64_t uint64; + +typedef uint32_t tick_t; + struct client_container; struct client; struct player; struct object; struct maptile; +struct mapspace; struct archetype; struct region; struct party; struct treasurelist; +struct random_map_params; // could have used templates, but a more traditional C api // uses more explicit typing which is ok for this purpose. @@ -22,6 +37,7 @@ DT_DOUBLE, DT_STRING, // 0-terminated string DT_DATA, // string + length + DT_ATTACHABLE, // will go DT_OBJECT, DT_MAP, DT_CLIENT, @@ -33,68 +49,5 @@ NUM_DATA_TYPES }; -template -struct cftype { }; - -template<> -struct cftype { - static const data_type dt = DT_INT; -}; - -template<> -struct cftype { - static const data_type dt = DT_INT64; -}; - -template<> -struct cftype { - static const data_type dt = DT_DOUBLE; -}; - -template<> -struct cftype { - static const data_type dt = DT_STRING; -}; - -template<> -struct cftype { - static const data_type dt = DT_OBJECT; -}; - -template<> -struct cftype { - static const data_type dt = DT_CLIENT; -}; - -template<> -struct cftype { - static const data_type dt = DT_PLAYER; -}; - -template<> -struct cftype { - static const data_type dt = DT_MAP; -}; - -template<> -struct cftype { - static const data_type dt = DT_ARCH; -}; - -template<> -struct cftype { - static const data_type dt = DT_PARTY; -}; - -template<> -struct cftype { - static const data_type dt = DT_REGION; -}; - -template<> -struct cftype { - static const data_type dt = DT_REGION; -}; - #endif