Simutrans-Squirrel-API  r11919
api_simple.h
Go to the documentation of this file.
1 /*
2  * This file is part of the Simutrans project under the Artistic License.
3  * (see LICENSE.txt)
4  */
5 
6 #ifndef SCRIPT_API_API_SIMPLE_H
7 #define SCRIPT_API_API_SIMPLE_H
8 
9 
10 #include "../../../squirrel/squirrel.h"
11 #include "../../dataobj/ribi.h"
12 #include "../../dataobj/koord3d.h"
13 
20 struct my_ribi_t {
21  uint8 data;
22  my_ribi_t(ribi_t::ribi r) : data(r) { }
23  operator ribi_t::ribi() const { return data; }
24 };
25 
26 struct my_slope_t {
27  uint8 data;
28  my_slope_t(slope_t::type r) : data(r) { }
29  operator slope_t::type() const { return data; }
30 };
31 
32 
37 struct my_koord3d {
38  koord3d data;
39  my_koord3d(koord3d k) : data(k) { }
40  operator koord3d() const { return data; }
41 };
42 
43 namespace script_api {
44 
45  struct mytime_t
46  {
47  uint32 raw;
48  mytime_t(uint32 r_) : raw(r_) {}
49  };
50 
51  struct mytime_ticks_t : public mytime_t
52  {
53  uint32 ticks;
54  uint32 ticks_per_month;
55  uint32 next_month_ticks;
56 
57  mytime_ticks_t(uint32 r, uint32 t, uint32 tpm, uint32 nmt) : mytime_t(r),
58  ticks(t), ticks_per_month(tpm), next_month_ticks(nmt)
59  {}
60  };
61 
62  struct mytool_data_t
63  {
64  koord3d start_pos;
65  bool is_drag_tool;
66  bool is_ctrl;
67  bool is_shift;
68 
69  mytool_data_t(koord3d pos, bool drag, bool ctrl, bool shift) :
70  start_pos(pos), is_drag_tool(drag), is_ctrl(ctrl), is_shift(shift)
71  {}
72  };
73 
74 };
75 
76 #endif