Simutrans-Squirrel-API OTRP v63_4
Loading...
Searching...
No Matches
api_simple.cc
Go to the documentation of this file.
1
9class time_x {
10public:
11 integer raw;
12 integer year;
13 integer month;
14};
15
19class time_ticks_x : public time_x {
20public:
21 integer ticks;
24};
25
32class coord {
33public:
35 integer x;
37 integer y;
38 // operators are defined in script_base.nut
39 coord(int x, int y);
40 coord operator + (coord other);
41 coord operator - (coord other);
42 coord operator - ();
43 coord operator * (integer fac);
44 coord operator / (integer fac);
50 string _tostring();
57 string href(string text);
62};
63
70class coord3d : public coord {
71public:
73 integer x;
75 integer y;
77 integer z;
78 // operators are defined in script_base.nut
79 coord(int x, int y, int z);
80 coord3d operator + (coord3d other);
81 coord3d operator - (coord other);
82 coord3d operator + (coord3d other);
83 coord3d operator - (coord other);
84 coord3d operator - ();
85 coord3d operator * (integer fac);
86 coord3d operator / (integer fac);
92 string _tostring();
99 string href(string text);
100};
101
110class dir {
111public:
114 static const dir none;
115 static const dir north;
116 static const dir east;
117 static const dir northeast;
118 static const dir south;
119 static const dir northsouth;
120 static const dir southeast;
121 static const dir northsoutheast;
122 static const dir west;
123 static const dir northwest;
124 static const dir eastwest;
125 static const dir northeastwest;
126 static const dir southwest;
127 static const dir northsouthwest;
128 static const dir southeastwest;
129 static const dir all;
131
135 static bool is_single(dir d);
140 static bool is_twoway(dir d);
145 static bool is_threeway(dir d);
150 static bool is_curve(dir d);
155 static bool is_straight(dir d);
160 static dir double(dir d);
165 static dir backward(dir d);
170 static slope to_slope(dir d);
174 static coord to_coord();
175};
176
180class slope {
181public:
184 static const slope flat;
185 static const slope north;
186 static const slope west;
187 static const slope east;
188 static const slope south;
189 static const slope northwest;
190 static const slope northeast;
191 static const slope southeast;
192 static const slope southwest;
193 static const slope raised;
194 static const slope all_up_slope = 82;
195 static const slope all_down_slope = 83;
197
202 static dir to_dir(slope s);
203};
204
212{
216bool is_valid();
217}
dir coord_to_dir(coord dir)
string href(string text)
string _tostring()
integer x
x-coordinate
Definition api_simple.cc:73
integer y
y-coordinate
Definition api_simple.cc:75
integer z
z-coordinate - height
Definition api_simple.cc:77
integer x
x-coordinate
Definition api_simple.cc:35
dir to_dir()
integer y
y-coordinate
Definition api_simple.cc:37
string href(string text)
string _tostring()
static bool is_straight(dir d)
static coord to_coord()
static dir double(dir d)
static bool is_twoway(dir d)
static bool is_curve(dir d)
static bool is_threeway(dir d)
static bool is_single(dir d)
static slope to_slope(dir d)
static dir backward(dir d)
static const slope southeast
SE corner.
static const slope all_up_slope
used for terraforming tools
static const slope raised
special meaning: used as slope of bridgeheads
static const slope northwest
NW corner.
static dir to_dir(slope s)
static const slope south
South slope.
static const slope northeast
NE corner.
static const slope west
West slope.
static const slope north
North slope.
static const slope southwest
SW corner.
static const slope east
East slope.
static const slope all_down_slope
used for terraforming tools
integer ticks
current time in ticks
Definition api_simple.cc:21
integer ticks_per_month
length of one in-game month in ticks
Definition api_simple.cc:22
integer next_month_ticks
new month will start at this time
Definition api_simple.cc:23
integer month
month in 0..11
Definition api_simple.cc:13
integer raw
raw integer value of date
Definition api_simple.cc:11
integer year
year
Definition api_simple.cc:12