ViewVC Help
View File | Revision Log | Show Annotations | Download File
/cvs/deliantra/server/include/traits.h
(Generate patch)

Comparing deliantra/server/include/traits.h (file contents):
Revision 1.1 by root, Thu Aug 31 09:19:34 2006 UTC vs.
Revision 1.2 by root, Thu Aug 31 17:54:14 2006 UTC

6struct mapstruct; 6struct mapstruct;
7struct archt; 7struct archt;
8struct region; 8struct region;
9struct party; 9struct party;
10struct mapstruct; 10struct mapstruct;
11struct treasureliststruct;
11 12
12// could have used templates, but a more traditional C api 13// could have used templates, but a more traditional C api
13// uses more explicit typing which is ok for this purpose. 14// uses more explicit typing which is ok for this purpose.
14enum data_type 15enum data_type
15{ 16{
33template<typename T> 34template<typename T>
34struct cftype { }; 35struct cftype { };
35 36
36template<> 37template<>
37struct cftype<int> { 38struct cftype<int> {
38 enum { dt = DT_INT }; 39 static const data_type dt = DT_INT;
39}; 40};
40 41
41template<> 42template<>
42struct cftype<sint64> { 43struct cftype<sint64> {
43 enum { dt = DT_INT64 }; 44 static const data_type dt = DT_INT64;
44}; 45};
45 46
46template<> 47template<>
47struct cftype<double> { 48struct cftype<double> {
48 enum { dt = DT_DOUBLE }; 49 static const data_type dt = DT_DOUBLE;
49}; 50};
50 51
51template<> 52template<>
52struct cftype<const char *> { 53struct cftype<const char *> {
53 enum { dt = DT_STRING }; 54 static const data_type dt = DT_STRING;
54}; 55};
55 56
56template<> 57template<>
57struct cftype<object> { 58struct cftype<object> {
58 enum { dt = DT_OBJECT }; 59 static const data_type dt = DT_OBJECT;
59}; 60};
60 61
61template<> 62template<>
62struct cftype<struct pl> { 63struct cftype<struct pl> {
63 enum { dt = DT_PLAYER }; 64 static const data_type dt = DT_PLAYER;
64}; 65};
65 66
66template<> 67template<>
67struct cftype<mapstruct> { 68struct cftype<mapstruct> {
68 enum { dt = DT_MAP }; 69 static const data_type dt = DT_MAP;
69}; 70};
70 71
71template<> 72template<>
72struct cftype<struct archt> { 73struct cftype<archt> {
73 enum { dt = DT_ARCH }; 74 static const data_type dt = DT_ARCH;
74}; 75};
75 76
76template<> 77template<>
77struct cftype<party> { 78struct cftype<party> {
78 enum { dt = DT_PARTY }; 79 static const data_type dt = DT_PARTY;
79}; 80};
80 81
81template<> 82template<>
82struct cftype<region> { 83struct cftype<region> {
83 enum { dt = DT_REGION }; 84 static const data_type dt = DT_REGION;
85};
86
87template<>
88struct cftype<treasureliststruct> {
89 static const data_type dt = DT_REGION;
84}; 90};
85 91
86#endif 92#endif
87 93

Diff Legend

Removed lines
+ Added lines
< Changed lines
> Changed lines