… | |
… | |
6 | struct mapstruct; |
6 | struct mapstruct; |
7 | struct archt; |
7 | struct archt; |
8 | struct region; |
8 | struct region; |
9 | struct party; |
9 | struct party; |
10 | struct mapstruct; |
10 | struct mapstruct; |
|
|
11 | struct 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. |
14 | enum data_type |
15 | enum data_type |
15 | { |
16 | { |
… | |
… | |
33 | template<typename T> |
34 | template<typename T> |
34 | struct cftype { }; |
35 | struct cftype { }; |
35 | |
36 | |
36 | template<> |
37 | template<> |
37 | struct cftype<int> { |
38 | struct cftype<int> { |
38 | enum { dt = DT_INT }; |
39 | static const data_type dt = DT_INT; |
39 | }; |
40 | }; |
40 | |
41 | |
41 | template<> |
42 | template<> |
42 | struct cftype<sint64> { |
43 | struct cftype<sint64> { |
43 | enum { dt = DT_INT64 }; |
44 | static const data_type dt = DT_INT64; |
44 | }; |
45 | }; |
45 | |
46 | |
46 | template<> |
47 | template<> |
47 | struct cftype<double> { |
48 | struct cftype<double> { |
48 | enum { dt = DT_DOUBLE }; |
49 | static const data_type dt = DT_DOUBLE; |
49 | }; |
50 | }; |
50 | |
51 | |
51 | template<> |
52 | template<> |
52 | struct cftype<const char *> { |
53 | struct cftype<const char *> { |
53 | enum { dt = DT_STRING }; |
54 | static const data_type dt = DT_STRING; |
54 | }; |
55 | }; |
55 | |
56 | |
56 | template<> |
57 | template<> |
57 | struct cftype<object> { |
58 | struct cftype<object> { |
58 | enum { dt = DT_OBJECT }; |
59 | static const data_type dt = DT_OBJECT; |
59 | }; |
60 | }; |
60 | |
61 | |
61 | template<> |
62 | template<> |
62 | struct cftype<struct pl> { |
63 | struct cftype<struct pl> { |
63 | enum { dt = DT_PLAYER }; |
64 | static const data_type dt = DT_PLAYER; |
64 | }; |
65 | }; |
65 | |
66 | |
66 | template<> |
67 | template<> |
67 | struct cftype<mapstruct> { |
68 | struct cftype<mapstruct> { |
68 | enum { dt = DT_MAP }; |
69 | static const data_type dt = DT_MAP; |
69 | }; |
70 | }; |
70 | |
71 | |
71 | template<> |
72 | template<> |
72 | struct cftype<struct archt> { |
73 | struct cftype<archt> { |
73 | enum { dt = DT_ARCH }; |
74 | static const data_type dt = DT_ARCH; |
74 | }; |
75 | }; |
75 | |
76 | |
76 | template<> |
77 | template<> |
77 | struct cftype<party> { |
78 | struct cftype<party> { |
78 | enum { dt = DT_PARTY }; |
79 | static const data_type dt = DT_PARTY; |
79 | }; |
80 | }; |
80 | |
81 | |
81 | template<> |
82 | template<> |
82 | struct cftype<region> { |
83 | struct cftype<region> { |
83 | enum { dt = DT_REGION }; |
84 | static const data_type dt = DT_REGION; |
|
|
85 | }; |
|
|
86 | |
|
|
87 | template<> |
|
|
88 | struct cftype<treasureliststruct> { |
|
|
89 | static const data_type dt = DT_REGION; |
84 | }; |
90 | }; |
85 | |
91 | |
86 | #endif |
92 | #endif |
87 | |
93 | |