aboutsummaryrefslogtreecommitdiff
path: root/assets/manual/man
diff options
context:
space:
mode:
Diffstat (limited to 'assets/manual/man')
-rw-r--r--assets/manual/man/man3advtrains/rwt_add.3advtrains.md20
-rw-r--r--assets/manual/man/man3advtrains/rwt_copy.3advtrains.md28
-rw-r--r--assets/manual/man/man3advtrains/rwt_last_rpt.3advtrains.md19
-rw-r--r--assets/manual/man/man3advtrains/rwt_now.3advtrains.md7
-rw-r--r--assets/manual/man/man7advtrains/rwt.7advtrains.md24
5 files changed, 98 insertions, 0 deletions
diff --git a/assets/manual/man/man3advtrains/rwt_add.3advtrains.md b/assets/manual/man/man3advtrains/rwt_add.3advtrains.md
new file mode 100644
index 0000000..ec73e9c
--- /dev/null
+++ b/assets/manual/man/man3advtrains/rwt_add.3advtrains.md
@@ -0,0 +1,20 @@
+% RWT_ADD(3ADVTRAINS) | Advtrains Developer's Manual
+
+# NAME
+`add`, `diff`, `sub` - Add or subtract railway time objects
+
+# SYNOPSIS
+
+* `add(t1, t2)`
+* `diff(t1, t2)`
+* `sub(t1, t2)`
+
+# DESCRIPTION
+
+* `add()` returns the result of adding `t1` and `t2`.
+* `diff()` returns the result of subtracting `t1` from `t2`.
+* `sub()` returns the result of subtracting `t2` from `t1`.
+
+# RETURN VALUE
+
+`add()` and `sub()` return their results as tables. `diff()` returns its result as a number.
diff --git a/assets/manual/man/man3advtrains/rwt_copy.3advtrains.md b/assets/manual/man/man3advtrains/rwt_copy.3advtrains.md
new file mode 100644
index 0000000..99dfaf1
--- /dev/null
+++ b/assets/manual/man/man3advtrains/rwt_copy.3advtrains.md
@@ -0,0 +1,28 @@
+% RWT_COPY(3ADVTRAINS) | Advtrains Developer's Manual
+
+# NAME
+`copy`, `new`, `to_table`, `to_secs`, `to_string` - Create and copy railway time objects
+
+# SYNOPSIS
+
+* `copy(obj)`
+* `new(cycles, minutes, seconds)`
+* `to_table(obj)`
+* `to_secs(obj [, cycles])`
+* `to_string(obj [, no_cycles])`
+
+# DESCRIPTION
+
+* `copy()` returns a copy of `obj`.
+* `new()` creates a new railway time object with the given number of cycles, minutes, and seconds.
+* `to_table()`, `to_secs()`, and `to_string()` convert `obj` to a table, number, or string, respectively. If `cycles` is passed to `to_secs()`, that value is used as the number of cycles. If `no_cycles` is passed to `to_string()`, the number of cycles is set to zero.
+
+# RETURN VALUE
+
+* `copy()` returns the copy that is created. If `obj` is a table, the returned value is not identical to `obj`.
+* `new()` returns the newly created object as a table.
+* `to_table()`, `to_secs()`, `to_string()` returns the conveerted object.
+
+# NOTES
+
+`to_table()` returns `obj` if it is a table.
diff --git a/assets/manual/man/man3advtrains/rwt_last_rpt.3advtrains.md b/assets/manual/man/man3advtrains/rwt_last_rpt.3advtrains.md
new file mode 100644
index 0000000..0336820
--- /dev/null
+++ b/assets/manual/man/man3advtrains/rwt_last_rpt.3advtrains.md
@@ -0,0 +1,19 @@
+% RWT_LAST_RPT(3ADVTRAINS) | Advtrains Developer's Manual
+
+# NAME
+`last_rpt`, `next_rpt`, `time_from_last_rpt`, `time_to_next_rpt` - Calculate time for repeating events
+
+# SYNOPSIS
+
+* `last_rpt(time, interval, offset)`
+* `next_rpt(time, interval, offset)`
+* `time_from_last_rpt(interval, offset)`
+* `time_to_next_rpt(interval, offset)`
+
+# DESCRIPTOIN
+The functions described in this page calculates the time or time difference related to events scheduled to repeat with the given interval and at the given offset, in relation to the given time. Whether and when the event actually takes place is not relevant to the API.
+
+* `last_rpt()` returns the time at which the event was expected to occur the last time
+* `next_rpt()` returns the time at which the event is expected to occur the next time
+* `time_from_last_rpt()` returns the time since the event was expected to occur the last time
+* `time_to_next_rpt()` return the time until the event is expected to occur the next time
diff --git a/assets/manual/man/man3advtrains/rwt_now.3advtrains.md b/assets/manual/man/man3advtrains/rwt_now.3advtrains.md
new file mode 100644
index 0000000..0843b1f
--- /dev/null
+++ b/assets/manual/man/man3advtrains/rwt_now.3advtrains.md
@@ -0,0 +1,7 @@
+% RWT_NOW(3ADVTRAINS) | Advtrains Developer's Manual
+
+# NAME
+`now` - Get the current railway time
+
+# DESCRIPTION
+`now()` returns the current railway time as a table.
diff --git a/assets/manual/man/man7advtrains/rwt.7advtrains.md b/assets/manual/man/man7advtrains/rwt.7advtrains.md
new file mode 100644
index 0000000..5e04d5e
--- /dev/null
+++ b/assets/manual/man/man7advtrains/rwt.7advtrains.md
@@ -0,0 +1,24 @@
+% RWT(7ADVTRAINS) | Advtrains Developer's Manual
+
+# NAME
+`rwt` - Advtrains railway time
+
+# DESCRIPTION
+Advtrains depends on Minetest's "dtime" for most operations, and may slow itself down when necessary to prevent unexpected behavior, such as in a situation with a significant amount of lag. As a result, the internal time used by Advtrains is not synchronized to real-life time due to lag and server restarts. Railway time was therefore introduced as a method of accurately measuring internal time and, with this information, implementing a scheduling system. It can, however, also be set up to keep in sync with real-life time.
+
+Railway time is counted in cycles, minutes, and seconds, roughly corresponding to their real-life counterparts, with cycles roughly corresponding to hours. For a valid railway time object, it is expected that
+
+* The "cycles" element is an integer,
+* The "minutes" element is an integer between 0 and 59 (inclusive), and
+* The "seconds" element is an integer between 0 and 59 (inclusive).
+
+Railway time may be represented in three formats:
+
+* As a table with the `c`, `m`, `s` fields holding the cycles, minutes, and seconds, respectively,
+* As a string with the cycles, minutes and seconds delimited with a semicolon,
+* For zero cycles, as a string with the minutes and seconds delimited with a semicolon, or
+* As a number representing the number of seconds since 0;0;0.
+
+If railway time is represented as a string, each element may have a variable length and do not require padding zeroes, and an element of the string may be empty if it is at the beginning or the end of the string.
+
+The railway time API is available in the `advtrains.interlocking.rwt` table or, for LuaATC, in the `rwt` table.