Changeset - r0:a49302f6e9d7
[Not reviewed]
default
! ! !
Ruby Dennington (Theleruby) - 2 years ago 2022-03-20 14:16:18
theleruby@gmail.com
6.0.0
19 files changed:
0 comments (0 inline, 0 general)
COPYING.md
Show inline comments
 
new file 100644
 
This is the license which applies to OpenTTD with the exception of some
 
3rd party modules. See [./README.md](./README.md) for details
 
 
GNU General Public License
 
==========================
 
 
_Version 2, June 1991_
 
_Copyright © 1989, 1991 Free Software Foundation, Inc.,_
 
_51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA_
 
 
Everyone is permitted to copy and distribute verbatim copies
 
of this license document, but changing it is not allowed.
 
 
### Preamble
 
 
The licenses for most software are designed to take away your
 
freedom to share and change it.  By contrast, the GNU General Public
 
License is intended to guarantee your freedom to share and change free
 
software--to make sure the software is free for all its users.  This
 
General Public License applies to most of the Free Software
 
Foundation's software and to any other program whose authors commit to
 
using it.  (Some other Free Software Foundation software is covered by
 
the GNU Lesser General Public License instead.)  You can apply it to
 
your programs, too.
 
 
When we speak of free software, we are referring to freedom, not
 
price.  Our General Public Licenses are designed to make sure that you
 
have the freedom to distribute copies of free software (and charge for
 
this service if you wish), that you receive source code or can get it
 
if you want it, that you can change the software or use pieces of it
 
in new free programs; and that you know you can do these things.
 
 
To protect your rights, we need to make restrictions that forbid
 
anyone to deny you these rights or to ask you to surrender the rights.
 
These restrictions translate to certain responsibilities for you if you
 
distribute copies of the software, or if you modify it.
 
 
For example, if you distribute copies of such a program, whether
 
gratis or for a fee, you must give the recipients all the rights that
 
you have.  You must make sure that they, too, receive or can get the
 
source code.  And you must show them these terms so they know their
 
rights.
 
 
We protect your rights with two steps: **(1)** copyright the software, and
 
**(2)** offer you this license which gives you legal permission to copy,
 
distribute and/or modify the software.
 
 
Also, for each author's protection and ours, we want to make certain
 
that everyone understands that there is no warranty for this free
 
software.  If the software is modified by someone else and passed on, we
 
want its recipients to know that what they have is not the original, so
 
that any problems introduced by others will not reflect on the original
 
authors' reputations.
 
 
Finally, any free program is threatened constantly by software
 
patents.  We wish to avoid the danger that redistributors of a free
 
program will individually obtain patent licenses, in effect making the
 
program proprietary.  To prevent this, we have made it clear that any
 
patent must be licensed for everyone's free use or not licensed at all.
 
 
The precise terms and conditions for copying, distribution and
 
modification follow.
 
 
### TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
 
 
**0.** This License applies to any program or other work which contains
 
a notice placed by the copyright holder saying it may be distributed
 
under the terms of this General Public License.  The "Program", below,
 
refers to any such program or work, and a "work based on the Program"
 
means either the Program or any derivative work under copyright law:
 
that is to say, a work containing the Program or a portion of it,
 
either verbatim or with modifications and/or translated into another
 
language.  (Hereinafter, translation is included without limitation in
 
the term "modification".)  Each licensee is addressed as "you".
 
 
Activities other than copying, distribution and modification are not
 
covered by this License; they are outside its scope.  The act of
 
running the Program is not restricted, and the output from the Program
 
is covered only if its contents constitute a work based on the
 
Program (independent of having been made by running the Program).
 
Whether that is true depends on what the Program does.
 
 
**1.** You may copy and distribute verbatim copies of the Program's
 
source code as you receive it, in any medium, provided that you
 
conspicuously and appropriately publish on each copy an appropriate
 
copyright notice and disclaimer of warranty; keep intact all the
 
notices that refer to this License and to the absence of any warranty;
 
and give any other recipients of the Program a copy of this License
 
along with the Program.
 
 
You may charge a fee for the physical act of transferring a copy, and
 
you may at your option offer warranty protection in exchange for a fee.
 
 
**2.** You may modify your copy or copies of the Program or any portion
 
of it, thus forming a work based on the Program, and copy and
 
distribute such modifications or work under the terms of Section 1
 
above, provided that you also meet all of these conditions:
 
 
* **a)** You must cause the modified files to carry prominent notices
 
stating that you changed the files and the date of any change.
 
* **b)** You must cause any work that you distribute or publish, that in
 
whole or in part contains or is derived from the Program or any
 
part thereof, to be licensed as a whole at no charge to all third
 
parties under the terms of this License.
 
* **c)** If the modified program normally reads commands interactively
 
when run, you must cause it, when started running for such
 
interactive use in the most ordinary way, to print or display an
 
announcement including an appropriate copyright notice and a
 
notice that there is no warranty (or else, saying that you provide
 
a warranty) and that users may redistribute the program under
 
these conditions, and telling the user how to view a copy of this
 
License.  (Exception: if the Program itself is interactive but
 
does not normally print such an announcement, your work based on
 
the Program is not required to print an announcement.)
 
 
These requirements apply to the modified work as a whole.  If
 
identifiable sections of that work are not derived from the Program,
 
and can be reasonably considered independent and separate works in
 
themselves, then this License, and its terms, do not apply to those
 
sections when you distribute them as separate works.  But when you
 
distribute the same sections as part of a whole which is a work based
 
on the Program, the distribution of the whole must be on the terms of
 
this License, whose permissions for other licensees extend to the
 
entire whole, and thus to each and every part regardless of who wrote it.
 
 
Thus, it is not the intent of this section to claim rights or contest
 
your rights to work written entirely by you; rather, the intent is to
 
exercise the right to control the distribution of derivative or
 
collective works based on the Program.
 
 
In addition, mere aggregation of another work not based on the Program
 
with the Program (or with a work based on the Program) on a volume of
 
a storage or distribution medium does not bring the other work under
 
the scope of this License.
 
 
**3.** You may copy and distribute the Program (or a work based on it,
 
under Section 2) in object code or executable form under the terms of
 
Sections 1 and 2 above provided that you also do one of the following:
 
 
* **a)** Accompany it with the complete corresponding machine-readable
 
source code, which must be distributed under the terms of Sections
 
1 and 2 above on a medium customarily used for software interchange; or,
 
* **b)** Accompany it with a written offer, valid for at least three
 
years, to give any third party, for a charge no more than your
 
cost of physically performing source distribution, a complete
 
machine-readable copy of the corresponding source code, to be
 
distributed under the terms of Sections 1 and 2 above on a medium
 
customarily used for software interchange; or,
 
* **c)** Accompany it with the information you received as to the offer
 
to distribute corresponding source code.  (This alternative is
 
allowed only for noncommercial distribution and only if you
 
received the program in object code or executable form with such
 
an offer, in accord with Subsection b above.)
 
 
The source code for a work means the preferred form of the work for
 
making modifications to it.  For an executable work, complete source
 
code means all the source code for all modules it contains, plus any
 
associated interface definition files, plus the scripts used to
 
control compilation and installation of the executable.  However, as a
 
special exception, the source code distributed need not include
 
anything that is normally distributed (in either source or binary
 
form) with the major components (compiler, kernel, and so on) of the
 
operating system on which the executable runs, unless that component
 
itself accompanies the executable.
 
 
If distribution of executable or object code is made by offering
 
access to copy from a designated place, then offering equivalent
 
access to copy the source code from the same place counts as
 
distribution of the source code, even though third parties are not
 
compelled to copy the source along with the object code.
 
 
**4.** You may not copy, modify, sublicense, or distribute the Program
 
except as expressly provided under this License.  Any attempt
 
otherwise to copy, modify, sublicense or distribute the Program is
 
void, and will automatically terminate your rights under this License.
 
However, parties who have received copies, or rights, from you under
 
this License will not have their licenses terminated so long as such
 
parties remain in full compliance.
 
 
**5.** You are not required to accept this License, since you have not
 
signed it.  However, nothing else grants you permission to modify or
 
distribute the Program or its derivative works.  These actions are
 
prohibited by law if you do not accept this License.  Therefore, by
 
modifying or distributing the Program (or any work based on the
 
Program), you indicate your acceptance of this License to do so, and
 
all its terms and conditions for copying, distributing or modifying
 
the Program or works based on it.
 
 
**6.** Each time you redistribute the Program (or any work based on the
 
Program), the recipient automatically receives a license from the
 
original licensor to copy, distribute or modify the Program subject to
 
these terms and conditions.  You may not impose any further
 
restrictions on the recipients' exercise of the rights granted herein.
 
You are not responsible for enforcing compliance by third parties to
 
this License.
 
 
**7.** If, as a consequence of a court judgment or allegation of patent
 
infringement or for any other reason (not limited to patent issues),
 
conditions are imposed on you (whether by court order, agreement or
 
otherwise) that contradict the conditions of this License, they do not
 
excuse you from the conditions of this License.  If you cannot
 
distribute so as to satisfy simultaneously your obligations under this
 
License and any other pertinent obligations, then as a consequence you
 
may not distribute the Program at all.  For example, if a patent
 
license would not permit royalty-free redistribution of the Program by
 
all those who receive copies directly or indirectly through you, then
 
the only way you could satisfy both it and this License would be to
 
refrain entirely from distribution of the Program.
 
 
If any portion of this section is held invalid or unenforceable under
 
any particular circumstance, the balance of the section is intended to
 
apply and the section as a whole is intended to apply in other
 
circumstances.
 
 
It is not the purpose of this section to induce you to infringe any
 
patents or other property right claims or to contest validity of any
 
such claims; this section has the sole purpose of protecting the
 
integrity of the free software distribution system, which is
 
implemented by public license practices.  Many people have made
 
generous contributions to the wide range of software distributed
 
through that system in reliance on consistent application of that
 
system; it is up to the author/donor to decide if he or she is willing
 
to distribute software through any other system and a licensee cannot
 
impose that choice.
 
 
This section is intended to make thoroughly clear what is believed to
 
be a consequence of the rest of this License.
 
 
**8.** If the distribution and/or use of the Program is restricted in
 
certain countries either by patents or by copyrighted interfaces, the
 
original copyright holder who places the Program under this License
 
may add an explicit geographical distribution limitation excluding
 
those countries, so that distribution is permitted only in or among
 
countries not thus excluded.  In such case, this License incorporates
 
the limitation as if written in the body of this License.
 
 
**9.** The Free Software Foundation may publish revised and/or new versions
 
of the General Public License from time to time.  Such new versions will
 
be similar in spirit to the present version, but may differ in detail to
 
address new problems or concerns.
 
 
Each version is given a distinguishing version number.  If the Program
 
specifies a version number of this License which applies to it and "any
 
later version", you have the option of following the terms and conditions
 
either of that version or of any later version published by the Free
 
Software Foundation.  If the Program does not specify a version number of
 
this License, you may choose any version ever published by the Free Software
 
Foundation.
 
 
**10.** If you wish to incorporate parts of the Program into other free
 
programs whose distribution conditions are different, write to the author
 
to ask for permission.  For software which is copyrighted by the Free
 
Software Foundation, write to the Free Software Foundation; we sometimes
 
make exceptions for this.  Our decision will be guided by the two goals
 
of preserving the free status of all derivatives of our free software and
 
of promoting the sharing and reuse of software generally.
 
 
### NO WARRANTY
 
 
**11.** BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
 
FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW.  EXCEPT WHEN
 
OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
 
PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
 
OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
 
MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.  THE ENTIRE RISK AS
 
TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU.  SHOULD THE
 
PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
 
REPAIR OR CORRECTION.
 
 
**12.** IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
 
WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
 
REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
 
INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
 
OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
 
TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
 
YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
 
PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
 
POSSIBILITY OF SUCH DAMAGES.
 
 
END OF TERMS AND CONDITIONS
 
 
### How to Apply These Terms to Your New Programs
 
 
If you develop a new program, and you want it to be of the greatest
 
possible use to the public, the best way to achieve this is to make it
 
free software which everyone can redistribute and change under these terms.
 
 
To do so, attach the following notices to the program.  It is safest
 
to attach them to the start of each source file to most effectively
 
convey the exclusion of warranty; and each file should have at least
 
the "copyright" line and a pointer to where the full notice is found.
 
 
    <one line to give the program's name and a brief idea of what it does.>
 
    Copyright (C) <year>  <name of author>
 
 
    This program is free software; you can redistribute it and/or modify
 
    it under the terms of the GNU General Public License as published by
 
    the Free Software Foundation; either version 2 of the License, or
 
    (at your option) any later version.
 
 
    This program is distributed in the hope that it will be useful,
 
    but WITHOUT ANY WARRANTY; without even the implied warranty of
 
    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
    GNU General Public License for more details.
 
 
    You should have received a copy of the GNU General Public License along
 
    with this program; if not, write to the Free Software Foundation, Inc.,
 
    51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA.
 
 
Also add information on how to contact you by electronic and paper mail.
 
 
If the program is interactive, make it output a short notice like this
 
when it starts in an interactive mode:
 
 
    Gnomovision version 69, Copyright (C) year name of author
 
    Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
 
    This is free software, and you are welcome to redistribute it
 
    under certain conditions; type `show c' for details.
 
 
The hypothetical commands `show w` and `show c` should show the appropriate
 
parts of the General Public License.  Of course, the commands you use may
 
be called something other than `show w` and `show c`; they could even be
 
mouse-clicks or menu items--whatever suits your program.
 
 
You should also get your employer (if you work as a programmer) or your
 
school, if any, to sign a "copyright disclaimer" for the program, if
 
necessary.  Here is a sample; alter the names:
 
 
    Yoyodyne, Inc., hereby disclaims all copyright interest in the program
 
    `Gnomovision' (which makes passes at compilers) written by James Hacker.
 
 
    <signature of Ty Coon>, 1 April 1989
 
    Ty Coon, President of Vice
 
 
This General Public License does not permit incorporating your program into
 
proprietary programs.  If your program is a subroutine library, you may
 
consider it more useful to permit linking proprietary applications with the
 
library.  If this is what you want to do, use the GNU Lesser General
 
Public License instead of this License.
README-OPENTTD.md
Show inline comments
 
new file 100644
 
# OpenTTD
 
 
## Table of contents
 
 
- 1.0) [About](#10-about)
 
    - 1.1) [Downloading OpenTTD](#11-downloading-openttd)
 
    - 1.2) [OpenTTD gameplay manual](#12-openttd-gameplay-manual)
 
    - 1.3) [Supported platforms](#13-supported-platforms)
 
    - 1.4) [Installing and running OpenTTD](#14-installing-and-running-openttd)
 
    - 1.5) [Add-on content / mods](#15-add-on-content--mods)
 
    - 1.6) [OpenTTD directories](#16-openttd-directories)
 
    - 1.7) [Compiling OpenTTD](#17-compiling-openttd)
 
- 2.0) [Contact and community](#20-contact-and-community)
 
    - 2.1) [Contributing to OpenTTD](#21-contributing-to-openttd)
 
    - 2.2) [Reporting bugs](#22-reporting-bugs)
 
    - 2.3) [Translating](#23-translating)
 
- 3.0) [Licensing](#30-licensing)
 
- 4.0) [Credits](#40-credits)
 
 
## 1.0) About
 
 
OpenTTD is a transport simulation game based upon the popular game Transport Tycoon Deluxe, written by Chris Sawyer.
 
It attempts to mimic the original game as closely as possible while extending it with new features.
 
 
OpenTTD is licensed under the GNU General Public License version 2.0, but includes some 3rd party software under different licenses.
 
See the section ["Licensing"](#30-licensing) below for details.
 
 
## 1.1) Downloading OpenTTD
 
 
OpenTTD can be downloaded from the [official OpenTTD website](https://www.openttd.org/).
 
 
Both 'stable' and 'nightly' versions are available for download:
 
 
- most people should choose the 'stable' version, as this has been more extensively tested
 
- the 'nightly' version includes the latest changes and features, but may sometimes be less reliable
 
 
OpenTTD is also available for free on [Steam](https://store.steampowered.com/app/1536610/OpenTTD/), [GOG.com](https://www.gog.com/game/openttd), and the [Microsoft Store](https://www.microsoft.com/p/openttd-official/9ncjg5rvrr1c). On some platforms OpenTTD will be available via your OS package manager or a similar service.
 
 
 
## 1.2) OpenTTD gameplay manual
 
 
OpenTTD has a [community-maintained wiki](https://wiki.openttd.org/), including a gameplay manual and tips.
 
 
 
## 1.3) Supported platforms
 
 
OpenTTD has been ported to several platforms and operating systems.
 
 
The currently supported platforms are:
 
 
- Linux (SDL (OpenGL and non-OpenGL))
 
- macOS (universal) (Cocoa)
 
- Windows (Win32 GDI / OpenGL)
 
 
Other platforms may also work (in particular various BSD systems), but we don't actively test or maintain these.
 
 
### 1.3.1) Legacy support
 
Platforms, languages and compilers change.
 
We'll keep support going on old platforms as long as someone is interested in supporting them, except where it means the project can't move forward to keep up with language and compiler features.
 
 
We guarantee that every revision of OpenTTD will be able to load savegames from every older revision (excepting where the savegame is corrupt).
 
Please report a bug if you find a save that doesn't load.
 
 
## 1.4) Installing and running OpenTTD
 
 
OpenTTD is usually straightforward to install, but for more help the wiki [includes an installation guide](https://wiki.openttd.org/en/Manual/Installation).
 
 
OpenTTD needs some additional graphics and sound files to run.
 
 
For some platforms these will be downloaded during the installation process if required.
 
 
For some platforms, you will need to refer to [the installation guide](https://wiki.openttd.org/en/Manual/Installation).
 
 
 
### 1.4.1) Free graphics and sound files
 
 
The free data files, split into OpenGFX for graphics, OpenSFX for sounds and
 
OpenMSX for music can be found at:
 
 
- https://www.openttd.org/downloads/opengfx-releases/ for OpenGFX
 
- https://www.openttd.org/downloads/opensfx-releases/ for OpenSFX
 
- https://www.openttd.org/downloads/openmsx-releases/ for OpenMSX
 
 
Please follow the readme of these packages about the installation procedure.
 
The Windows installer can optionally download and install these packages.
 
 
 
### 1.4.2) Original Transport Tycoon Deluxe graphics and sound files
 
 
If you want to play with the original Transport Tycoon Deluxe data files you have to copy the data files from the CD-ROM into the baseset/ directory.
 
It does not matter whether you copy them from the DOS or Windows version of Transport Tycoon Deluxe.
 
The Windows install can optionally copy these files.
 
 
You need to copy the following files:
 
- sample.cat
 
- trg1r.grf or TRG1.GRF
 
- trgcr.grf or TRGC.GRF
 
- trghr.grf or TRGH.GRF
 
- trgir.grf or TRGI.GRF
 
- trgtr.grf or TRGT.GRF
 
 
 
### 1.4.3) Original Transport Tycoon Deluxe music
 
 
If you want the Transport Tycoon Deluxe music, copy the appropriate files from the original game into the baseset folder.
 
- TTD for Windows: All files in the gm/ folder (gm_tt00.gm up to gm_tt21.gm)
 
- TTD for DOS: The GM.CAT file
 
- Transport Tycoon Original: The GM.CAT file, but rename it to GM-TTO.CAT
 
 
 
## 1.5) Add-on content / mods
 
 
OpenTTD features multiple types of add-on content, which modify gameplay in different ways.
 
 
Most types of add-on content can be downloaded within OpenTTD via the 'Check Online Content' button in the main menu.
 
 
Add-on content can also be installed manually, but that's more complicated; the [OpenTTD wiki](https://wiki.openttd.org/) may offer help with that, or the [OpenTTD directory structure guide](./docs/directory_structure.md).
 
 
### 1.5.1) AI opponents
 
 
OpenTTD comes without AI opponents, so if you want to play with AIs you have to download them.
 
 
The easiest way is via the 'Check Online Content' button in the main menu.
 
 
You can select some AIs that you think are compatible with your playing style.
 
 
AI help and discussions may also be found in the [AI section of the forum](https://www.tt-forums.net/viewforum.php?f=65).
 
 
### 1.5.2) Scenarios and height maps
 
 
Scenarios and heightmaps can be added via the 'Check Online Content' button in the main menu.
 
 
### 1.5.3) NewGRFs
 
 
A wide range of add-content is available as NewGRFs, including vehicles, industries, stations, landscape objects, town names and more.
 
 
NewGRFs can be added via the 'Check Online Content' button in the main menu.
 
 
See also the wiki [guide to NewGRFs](https://wiki.openttd.org/en/Manual/NewGRF) and [the forum graphics development section](https://www.tt-forums.net/viewforum.php?f=66).
 
 
### 1.5.4) Game scripts
 
 
Game scripts can provide additional challenges or changes to the standard OpenTTD gameplay, for example setting transport goals, or changing town growth behaviour.
 
 
Game scripts can be added via the 'Check Online Content' button in the main menu.
 
 
See also the wiki [guide to game scripts](https://wiki.openttd.org/en/Manual/Game%20script) and [the forum graphics game script section](https://www.tt-forums.net/viewforum.php?f=65).
 
 
### 1.6) OpenTTD directories
 
 
OpenTTD uses its own directory structure to store game data, add-on content etc.
 
 
For more information, see the [directory structure guide](./docs/directory_structure.md).
 
 
### 1.7) Compiling OpenTTD
 
 
If you want to compile OpenTTD from source, instructions can be found in [COMPILING.md](./COMPILING.md).
 
 
 
## 2.0) Contact and Community
 
 
'Official' channels
 
 
- [OpenTTD website](https://www.openttd.org)
 
- IRC chat using #openttd on irc.oftc.net [more info about our irc channel](https://wiki.openttd.org/en/Development/IRC%20channel)
 
- [OpenTTD on Github](https://github.com/openTTD/) for code repositories and for reporting issues
 
- [forum.openttd.org](https://forum.openttd.org/) - the primary community forum site for discussing OpenTTD and related games
 
- [OpenTTD wiki](https://wiki.openttd.org/) community-maintained wiki, including topics like gameplay guide, detailed explanation of some game mechanics, how to use add-on content (mods) and much more
 
 
'Unofficial' channels
 
 
- the OpenTTD wiki has a [page listing OpenTTD communities](https://wiki.openttd.org/en/Community/Community) including some in languages other than English
 
 
 
### 2.1) Contributing to OpenTTD
 
 
We welcome contributors to OpenTTD.  More information for contributors can be found in [CONTRIBUTING.md](./CONTRIBUTING.md)
 
 
 
### 2.2) Reporting bugs
 
 
Good bug reports are very helpful.  We have a [guide to reporting bugs](./CONTRIBUTING.md#bug-reports) to help with this.
 
 
Desyncs in multiplayer are complex to debug and report (some software development skils are required).
 
Instructions can be found in [debugging and reporting desyncs](./docs/debugging_desyncs.md).
 
 
 
### 2.3) Translating
 
 
OpenTTD is translated into many languages.  Translations are added and updated via the [online translation tool](https://translator.openttd.org).
 
 
 
## 3.0) Licensing
 
 
OpenTTD is licensed under the GNU General Public License version 2.0.
 
For the complete license text, see the file '[COPYING.md](./COPYING.md)'.
 
This license applies to all files in this distribution, except as noted below.
 
 
The squirrel implementation in `src/3rdparty/squirrel` is licensed under the Zlib license.
 
See `src/3rdparty/squirrel/COPYRIGHT` for the complete license text.
 
 
The md5 implementation in `src/3rdparty/md5` is licensed under the Zlib license.
 
See the comments in the source files in `src/3rdparty/md5` for the complete license text.
 
 
The implementations of Posix `getaddrinfo` and `getnameinfo` for OS/2 in `src/3rdparty/os2` are distributed partly under the GNU Lesser General Public License 2.1, and partly under the (3-clause) BSD license.
 
The exact licensing terms can be found in `src/3rdparty/os2/getaddrinfo.c` resp. `src/3rdparty/os2/getnameinfo.c`.
 
 
The fmt implementation in `src/3rdparty/fmt` is licensed under the MIT license.
 
See `src/3rdparty/fmt/LICENSE.rst` for the complete license text.
 
 
 
## 4.0 Credits
 
 
See [CREDITS.md](./CREDITS.md)
ai/compat_0.7.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("0.7 API compatibility in effect:");
 
AILog.Info(" - AITown::GetLastMonthProduction's behaviour has slightly changed.");
 
AILog.Info(" - AISubsidy::GetDestination returns STATION_INVALID for awarded subsidies.");
 
AILog.Info(" - AISubsidy::GetSource returns STATION_INVALID for awarded subsidies.");
 

	
 
AISign.GetMaxSignID <- function()
 
{
 
	local list = AISignList();
 
	local max_id = 0;
 
	foreach (id, d in list) {
 
		if (id > max_id) max_id = id;
 
	}
 
	return max_id;
 
}
 

	
 
AITile.GetHeight <- function(tile)
 
{
 
	if (!AIMap.IsValidTile(tile)) return -1;
 

	
 
	return AITile.GetCornerHeight(tile, AITile.CORNER_N);
 
}
 

	
 
AIOrder.ChangeOrder <- function(vehicle_id, order_position, order_flags)
 
{
 
	return AIOrder.SetOrderFlags(vehicle_id, order_position, order_flags);
 
}
 

	
 
AIWaypoint.WAYPOINT_INVALID <- 0xFFFF;
 

	
 
AISubsidy.SourceIsTown <- function(subsidy_id)
 
{
 
	if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
 

	
 
	return AISubsidy.GetSourceType(subsidy_id) == AISubsidy.SPT_TOWN;
 
}
 

	
 
AISubsidy.GetSource <- function(subsidy_id)
 
{
 
	if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
 

	
 
	if (AISubsidy.IsAwarded(subsidy_id)) {
 
		return AIBaseStation.STATION_INVALID;
 
	}
 

	
 
	return AISubsidy.GetSourceIndex(subsidy_id);
 
}
 

	
 
AISubsidy.DestinationIsTown <- function(subsidy_id)
 
{
 
	if (!AISubsidy.IsValidSubsidy(subsidy_id) || AISubsidy.IsAwarded(subsidy_id)) return false;
 

	
 
	return AISubsidy.GetDestinationType(subsidy_id) == AISubsidy.SPT_TOWN;
 
}
 

	
 
AISubsidy.GetDestination <- function(subsidy_id)
 
{
 
	if (!AISubsidy.IsValidSubsidy(subsidy_id)) return AIBaseStation.STATION_INVALID;
 

	
 
	if (AISubsidy.IsAwarded(subsidy_id)) {
 
		return AIBaseStation.STATION_INVALID;
 
	}
 

	
 
	return AISubsidy.GetDestinationIndex(subsidy_id);
 
}
 

	
 
AITown.GetMaxProduction <- function(town_id, cargo_id)
 
{
 
	return AITown.GetLastMonthProduction(town_id, cargo_id);
 
}
 

	
 
AIRail.RemoveRailWaypoint <- function(tile)
 
{
 
	return AIRail.RemoveRailWaypointTileRect(tile, tile, true);
 
}
 

	
 
AIRail.RemoveRailStationTileRect <- function(tile, tile2)
 
{
 
	return AIRail.RemoveRailStationTileRectangle(tile, tile2, false);
 
}
 

	
 
AIVehicle.SkipToVehicleOrder <- function(vehicle_id, order_position)
 
{
 
	return AIOrder.SkipToOrder(vehicle_id, order_position);
 
}
 

	
 
AIEngine.IsValidEngine <- function(engine_id)
 
{
 
	return AIEngine.IsBuildable(engine_id);
 
}
 

	
 
AIEngine._GetName <- AIEngine.GetName;
 
AIEngine.GetName <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return null;
 
	return AIEngine._GetName(engine_id);
 
}
 

	
 
AIEngine._GetCargoType <- AIEngine.GetCargoType;
 
AIEngine.GetCargoType <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return 255;
 
	return AIEngine._GetCargoType(engine_id);
 
}
 

	
 
AIEngine._CanRefitCargo <- AIEngine.CanRefitCargo;
 
AIEngine.CanRefitCargo <- function(engine_id, cargo_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return false;
 
	return AIEngine._CanRefitCargo(engine_id, cargo_id);
 
}
 

	
 
AIEngine._CanPullCargo <- AIEngine.CanPullCargo;
 
AIEngine.CanPullCargo <- function(engine_id, cargo_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return false;
 
	return AIEngine._CanPullCargo(engine_id, cargo_id);
 
}
 

	
 
AIEngine._GetCapacity <- AIEngine.GetCapacity;
 
AIEngine.GetCapacity <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetCapacity(engine_id);
 
}
 

	
 
AIEngine._GetReliability <- AIEngine.GetReliability;
 
AIEngine.GetReliability <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetReliability(engine_id);
 
}
 

	
 
AIEngine._GetMaxSpeed <- AIEngine.GetMaxSpeed;
 
AIEngine.GetMaxSpeed <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetMaxSpeed(engine_id);
 
}
 

	
 
AIEngine._GetPrice <- AIEngine.GetPrice;
 
AIEngine.GetPrice <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetPrice(engine_id);
 
}
 

	
 
AIEngine._GetMaxAge <- AIEngine.GetMaxAge;
 
AIEngine.GetMaxAge <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetMaxAge(engine_id);
 
}
 

	
 
AIEngine._GetRunningCost <- AIEngine.GetRunningCost;
 
AIEngine.GetRunningCost <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetRunningCost(engine_id);
 
}
 

	
 
AIEngine._GetPower <- AIEngine.GetPower;
 
AIEngine.GetPower <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetPower(engine_id);
 
}
 

	
 
AIEngine._GetWeight <- AIEngine.GetWeight;
 
AIEngine.GetWeight <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetWeight(engine_id);
 
}
 

	
 
AIEngine._GetMaxTractiveEffort <- AIEngine.GetMaxTractiveEffort;
 
AIEngine.GetMaxTractiveEffort <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetMaxTractiveEffort(engine_id);
 
}
 

	
 
AIEngine._GetDesignDate <- AIEngine.GetDesignDate;
 
AIEngine.GetDesignDate <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetDesignDate(engine_id);
 
}
 

	
 
AIEngine._GetVehicleType <- AIEngine.GetVehicleType;
 
AIEngine.GetVehicleType <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return AIVehicle.VT_INVALID;
 
	return AIEngine._GetVehicleType(engine_id);
 
}
 

	
 
AIEngine._IsWagon <- AIEngine.IsWagon;
 
AIEngine.IsWagon <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return false;
 
	return AIEngine._IsWagon(engine_id);
 
}
 

	
 
AIEngine._CanRunOnRail <- AIEngine.CanRunOnRail;
 
AIEngine.CanRunOnRail <- function(engine_id, track_rail_type)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return false;
 
	return AIEngine._CanRunOnRail(engine_id, track_rail_type);
 
}
 

	
 
AIEngine._HasPowerOnRail <- AIEngine.HasPowerOnRail;
 
AIEngine.HasPowerOnRail <- function(engine_id, track_rail_type)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return false;
 
	return AIEngine._HasPowerOnRail(engine_id, track_rail_type);
 
}
 

	
 
AIEngine._GetRoadType <- AIEngine.GetRoadType;
 
AIEngine.GetRoadType <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return AIRoad.ROADTYPE_INVALID;
 
	return AIEngine._GetRoadType(engine_id);
 
}
 

	
 
AIEngine._GetRailType <- AIEngine.GetRailType;
 
AIEngine.GetRailType <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return AIRail.RAILTYPE_INVALID;
 
	return AIEngine._GetRailType(engine_id);
 
}
 

	
 
AIEngine._IsArticulated <- AIEngine.IsArticulated;
 
AIEngine.IsArticulated <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return false;
 
	return AIEngine._IsArticulated(engine_id);
 
}
 

	
 
AIEngine._GetPlaneType <- AIEngine.GetPlaneType;
 
AIEngine.GetPlaneType <- function(engine_id)
 
{
 
	if (!AIEngine.IsBuildable(engine_id)) return -1;
 
	return AIEngine._GetPlaneType(engine_id);
 
}
 

	
 
_AIWaypointList <- AIWaypointList;
 
class AIWaypointList extends _AIWaypointList {
 
	constructor()
 
	{
 
		::_AIWaypointList.constructor(AIWaypoint.WAYPOINT_RAIL);
 
	}
 
}
 

	
 
AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation;
 
AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
 
{
 
	if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
 

	
 
	return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id);
 
}
 

	
 
AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation;
 
AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
 
{
 
	if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
 

	
 
	return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
 
}
 

	
 
AIBridgeList.HasNext <-
 
AIBridgeList_Length.HasNext <-
 
AICargoList.HasNext <-
 
AICargoList_IndustryAccepting.HasNext <-
 
AICargoList_IndustryProducing.HasNext <-
 
AIDepotList.HasNext <-
 
AIEngineList.HasNext <-
 
AIGroupList.HasNext <-
 
AIIndustryList.HasNext <-
 
AIIndustryList_CargoAccepting.HasNext <-
 
AIIndustryList_CargoProducing.HasNext <-
 
AIIndustryTypeList.HasNext <-
 
AIList.HasNext <-
 
AIRailTypeList.HasNext <-
 
AISignList.HasNext <-
 
AIStationList.HasNext <-
 
AIStationList_Vehicle.HasNext <-
 
AISubsidyList.HasNext <-
 
AITileList.HasNext <-
 
AITileList_IndustryAccepting.HasNext <-
 
AITileList_IndustryProducing.HasNext <-
 
AITileList_StationType.HasNext <-
 
AITownList.HasNext <-
 
AIVehicleList.HasNext <-
 
AIVehicleList_DefaultGroup.HasNext <-
 
AIVehicleList_Group.HasNext <-
 
AIVehicleList_SharedOrders.HasNext <-
 
AIVehicleList_Station.HasNext <-
 
AIWaypointList.HasNext <-
 
AIWaypointList_Vehicle.HasNext <-
 
function()
 
{
 
	return !this.IsEnd();
 
}
 

	
 
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted;
 
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
 
{
 
	return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
 
}
 

	
 
AIAbstractList <- AIList;
 

	
 
AIList.ChangeItem <- AIList.SetValue;
 

	
 
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
 

	
 
AICompany.GetCompanyValue <- function(company)
 
{
 
	return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
 
}
 

	
 
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
 

	
 
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
 
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
 
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
 
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
 
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
 
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
 
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
 
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
 
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
 
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
 
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
 
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
 
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
 
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
 
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
 
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
 
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
 
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
 
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
 
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
 
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
 
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
 
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
 
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
 
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
 
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
 
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
 
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
 
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
 
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
 
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
 
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
 
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
 
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
 
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
 
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
 
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
 
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.0.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.0 API compatibility in effect.");
 

	
 
AIRoad._BuildRoadStation <- AIRoad.BuildRoadStation;
 
AIRoad.BuildRoadStation <- function(tile, front, road_veh_type, station_id)
 
{
 
	if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
 

	
 
	return AIRoad._BuildRoadStation(tile, front, road_veh_type, station_id);
 
}
 

	
 
AIRoad._BuildDriveThroughRoadStation <- AIRoad.BuildDriveThroughRoadStation;
 
AIRoad.BuildDriveThroughRoadStation <- function(tile, front, road_veh_type, station_id)
 
{
 
	if (AIRoad.IsRoadStationTile(tile) && AICompany.IsMine(AITile.GetOwner(tile))) return false;
 

	
 
	return AIRoad._BuildDriveThroughRoadStation(tile, front, road_veh_type, station_id);
 
}
 

	
 
AIBridgeList.HasNext <-
 
AIBridgeList_Length.HasNext <-
 
AICargoList.HasNext <-
 
AICargoList_IndustryAccepting.HasNext <-
 
AICargoList_IndustryProducing.HasNext <-
 
AIDepotList.HasNext <-
 
AIEngineList.HasNext <-
 
AIGroupList.HasNext <-
 
AIIndustryList.HasNext <-
 
AIIndustryList_CargoAccepting.HasNext <-
 
AIIndustryList_CargoProducing.HasNext <-
 
AIIndustryTypeList.HasNext <-
 
AIList.HasNext <-
 
AIRailTypeList.HasNext <-
 
AISignList.HasNext <-
 
AIStationList.HasNext <-
 
AIStationList_Vehicle.HasNext <-
 
AISubsidyList.HasNext <-
 
AITileList.HasNext <-
 
AITileList_IndustryAccepting.HasNext <-
 
AITileList_IndustryProducing.HasNext <-
 
AITileList_StationType.HasNext <-
 
AITownList.HasNext <-
 
AIVehicleList.HasNext <-
 
AIVehicleList_DefaultGroup.HasNext <-
 
AIVehicleList_Depot.HasNext <-
 
AIVehicleList_Group.HasNext <-
 
AIVehicleList_SharedOrders.HasNext <-
 
AIVehicleList_Station.HasNext <-
 
AIWaypointList.HasNext <-
 
AIWaypointList_Vehicle.HasNext <-
 
function()
 
{
 
	return !this.IsEnd();
 
}
 

	
 
AIIndustry._IsCargoAccepted <- AIIndustry.IsCargoAccepted;
 
AIIndustry.IsCargoAccepted <- function(industry_id, cargo_id)
 
{
 
	return AIIndustry._IsCargoAccepted(industry_id, cargo_id) != AIIndustry.CAS_NOT_ACCEPTED;
 
}
 

	
 
AIAbstractList <- AIList;
 

	
 
AIList.ChangeItem <- AIList.SetValue;
 

	
 
AIRail.ERR_NONUNIFORM_STATIONS_DISABLED <- 0xFFFF;
 

	
 
AICompany.GetCompanyValue <- function(company)
 
{
 
	return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
 
}
 

	
 
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
 

	
 
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
 
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
 
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
 
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
 
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
 
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
 
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
 
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
 
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
 
AIEvent.AI_ET_COMPANY_ASK_MERGER <- AIEvent.ET_COMPANY_ASK_MERGER;
 
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
 
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
 
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
 
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
 
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
 
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
 
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
 
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
 
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
 
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
 
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
 
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
 
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
 
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
 
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
 
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
 
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
 
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
 
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
 
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
 
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
 
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
 
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
 
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
 
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
 
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
 
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
 
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
 
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.1.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.1 API compatibility in effect.");
 

	
 
AICompany.GetCompanyValue <- function(company)
 
{
 
	return AICompany.GetQuarterlyCompanyValue(company, AICompany.CURRENT_QUARTER);
 
}
 

	
 
AITown.GetLastMonthTransported <- AITown.GetLastMonthSupplied;
 

	
 
AIEvent.AI_ET_INVALID <- AIEvent.ET_INVALID;
 
AIEvent.AI_ET_TEST <- AIEvent.ET_TEST;
 
AIEvent.AI_ET_SUBSIDY_OFFER <- AIEvent.ET_SUBSIDY_OFFER;
 
AIEvent.AI_ET_SUBSIDY_OFFER_EXPIRED <- AIEvent.ET_SUBSIDY_OFFER_EXPIRED;
 
AIEvent.AI_ET_SUBSIDY_AWARDED <- AIEvent.ET_SUBSIDY_AWARDED;
 
AIEvent.AI_ET_SUBSIDY_EXPIRED <- AIEvent.ET_SUBSIDY_EXPIRED;
 
AIEvent.AI_ET_ENGINE_PREVIEW <- AIEvent.ET_ENGINE_PREVIEW;
 
AIEvent.AI_ET_COMPANY_NEW <- AIEvent.ET_COMPANY_NEW;
 
AIEvent.AI_ET_COMPANY_IN_TROUBLE <- AIEvent.ET_COMPANY_IN_TROUBLE;
 
AIEvent.AI_ET_COMPANY_ASK_MERGER <- AIEvent.ET_COMPANY_ASK_MERGER;
 
AIEvent.AI_ET_COMPANY_MERGER <- AIEvent.ET_COMPANY_MERGER;
 
AIEvent.AI_ET_COMPANY_BANKRUPT <- AIEvent.ET_COMPANY_BANKRUPT;
 
AIEvent.AI_ET_VEHICLE_CRASHED <- AIEvent.ET_VEHICLE_CRASHED;
 
AIEvent.AI_ET_VEHICLE_LOST <- AIEvent.ET_VEHICLE_LOST;
 
AIEvent.AI_ET_VEHICLE_WAITING_IN_DEPOT <- AIEvent.ET_VEHICLE_WAITING_IN_DEPOT;
 
AIEvent.AI_ET_VEHICLE_UNPROFITABLE <- AIEvent.ET_VEHICLE_UNPROFITABLE;
 
AIEvent.AI_ET_INDUSTRY_OPEN <- AIEvent.ET_INDUSTRY_OPEN;
 
AIEvent.AI_ET_INDUSTRY_CLOSE <- AIEvent.ET_INDUSTRY_CLOSE;
 
AIEvent.AI_ET_ENGINE_AVAILABLE <- AIEvent.ET_ENGINE_AVAILABLE;
 
AIEvent.AI_ET_STATION_FIRST_VEHICLE <- AIEvent.ET_STATION_FIRST_VEHICLE;
 
AIEvent.AI_ET_DISASTER_ZEPPELINER_CRASHED <- AIEvent.ET_DISASTER_ZEPPELINER_CRASHED;
 
AIEvent.AI_ET_DISASTER_ZEPPELINER_CLEARED <- AIEvent.ET_DISASTER_ZEPPELINER_CLEARED;
 
AIEvent.AI_ET_TOWN_FOUNDED <- AIEvent.ET_TOWN_FOUNDED;
 
AIOrder.AIOF_NONE <- AIOrder.OF_NONE
 
AIOrder.AIOF_NON_STOP_INTERMEDIATE <- AIOrder.OF_NON_STOP_INTERMEDIATE
 
AIOrder.AIOF_NON_STOP_DESTINATION <- AIOrder.OF_NON_STOP_DESTINATION
 
AIOrder.AIOF_UNLOAD <- AIOrder.OF_UNLOAD
 
AIOrder.AIOF_TRANSFER <- AIOrder.OF_TRANSFER
 
AIOrder.AIOF_NO_UNLOAD <- AIOrder.OF_NO_UNLOAD
 
AIOrder.AIOF_FULL_LOAD <- AIOrder.OF_FULL_LOAD
 
AIOrder.AIOF_FULL_LOAD_ANY <- AIOrder.OF_FULL_LOAD_ANY
 
AIOrder.AIOF_NO_LOAD <- AIOrder.OF_NO_LOAD
 
AIOrder.AIOF_SERVICE_IF_NEEDED <- AIOrder.OF_SERVICE_IF_NEEDED
 
AIOrder.AIOF_STOP_IN_DEPOT <- AIOrder.OF_STOP_IN_DEPOT
 
AIOrder.AIOF_GOTO_NEAREST_DEPOT <- AIOrder.OF_GOTO_NEAREST_DEPOT
 
AIOrder.AIOF_NON_STOP_FLAGS <- AIOrder.OF_NON_STOP_FLAGS
 
AIOrder.AIOF_UNLOAD_FLAGS <- AIOrder.OF_UNLOAD_FLAGS
 
AIOrder.AIOF_LOAD_FLAGS <- AIOrder.OF_LOAD_FLAGS
 
AIOrder.AIOF_DEPOT_FLAGS <- AIOrder.OF_DEPOT_FLAGS
 
AIOrder.AIOF_INVALID <- AIOrder.OF_INVALID
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.10.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.10 API compatibility in effect.");
ai/compat_1.11.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.11 API compatibility in effect.");
ai/compat_1.2.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.2 API compatibility in effect.");
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.3.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.3 API compatibility in effect.");
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.4.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.4 API compatibility in effect.");
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.5.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.5 API compatibility in effect.");
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.6.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.6 API compatibility in effect.");
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.7.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.7 API compatibility in effect.");
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.8.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.8 API compatibility in effect.");
 

	
 
/* 1.9 adds a vehicle type parameter. */
 
AIBridge._GetName <- AIBridge.GetName;
 
AIBridge.GetName <- function(bridge_id)
 
{
 
	return AIBridge._GetName(bridge_id, AIVehicle.VT_RAIL);
 
}
 

	
 
/* 1.9 adds parent_group_id to CreateGroup function */
 
AIGroup._CreateGroup <- AIGroup.CreateGroup;
 
AIGroup.CreateGroup <- function(vehicle_type)
 
{
 
	return AIGroup._CreateGroup(vehicle_type, AIGroup.GROUP_INVALID);
 
}
ai/compat_1.9.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("1.9 API compatibility in effect.");
ai/compat_12.nut
Show inline comments
 
new file 100644
 
/*
 
 * This file is part of OpenTTD.
 
 * OpenTTD is free software; you can redistribute it and/or modify it under the terms of the GNU General Public License as published by the Free Software Foundation, version 2.
 
 * OpenTTD is distributed in the hope that it will be useful, but WITHOUT ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
 
 * See the GNU General Public License for more details. You should have received a copy of the GNU General Public License along with OpenTTD. If not, see <http://www.gnu.org/licenses/>.
 
 */
 

	
 
AILog.Info("12 API compatibility in effect.");
ai/regression/info.nut
Show inline comments
 
new file 100644
 
class Regression extends AIInfo {
 
	function GetAuthor()      { return "OpenTTD NoAI Developers Team"; }
 
	function GetName()        { return "Regression"; }
 
	function GetShortName()   { return "REGR"; }
 
	function GetDescription() { return "This runs regression-tests on some commands. On the same map the result should always be the same."; }
 
	function GetVersion()     { return 1; }
 
	function GetAPIVersion()  { return "13"; }
 
	function GetDate()        { return "2007-03-18"; }
 
	function CreateInstance() { return "Regression"; }
 
	function UseAsRandomAI()  { return false; }
 
}
 

	
 
RegisterAI(Regression());
 

	
ai/regression/main.nut
Show inline comments
 
new file 100644
 
class Regression extends AIController {
 
	function Start();
 
};
 

	
 

	
 

	
 
function Regression::TestInit()
 
{
 
	print("");
 
	print("--TestInit--");
 
	print(" Ops:      " + this.GetOpsTillSuspend());
 
	print(" TickTest: " + this.GetTick());
 
	this.Sleep(1);
 
	print(" TickTest: " + this.GetTick());
 
	print(" Ops:      " + this.GetOpsTillSuspend());
 
	print(" SetCommandDelay: " + AIController.SetCommandDelay(1));
 
	print(" IsValid(vehicle.plane_speed): " + AIGameSettings.IsValid("vehicle.plane_speed"));
 
	print(" vehicle.plane_speed: " + AIGameSettings.GetValue("vehicle.plane_speed"));
 
	require("require.nut");
 
	print(" min(6, 3): " + min(6, 3));
 
	print(" min(3, 6): " + min(3, 6));
 
	print(" max(6, 3): " + max(6, 3));
 
	print(" max(3, 6): " + max(3, 6));
 

	
 
	print(" AIList Consistency Tests");
 
	print("");
 
	print(" Value Descending");
 
	local list = AIList();
 
	list.AddItem( 5, 10);
 
	list.AddItem(10, 10);
 
	list.AddItem(15, 20);
 
	list.AddItem(20, 20);
 
	list.AddItem(25, 30);
 
	list.AddItem(30, 30);
 
	list.AddItem(35, 40);
 
	list.AddItem(40, 40);
 

	
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		list.RemoveItem(i - 10);
 
		list.RemoveItem(i - 5);
 
		list.RemoveItem(i);
 
		print("   " + i);
 
	}
 

	
 
	list.AddItem(10, 10);
 
	list.AddItem(20, 20);
 
	list.AddItem(30, 30);
 
	list.AddItem(40, 40);
 

	
 
	print("");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		list.SetValue(i, 2);
 
		print("   " + i);
 
	}
 
	print("");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("   " + i);
 
	}
 

	
 
	list = AIList();
 
	list.Sort(AIList.SORT_BY_VALUE, AIList.SORT_ASCENDING);
 
	print("");
 
	print(" Value Ascending");
 
	list.AddItem( 5, 10);
 
	list.AddItem(10, 10);
 
	list.AddItem(15, 20);
 
	list.AddItem(20, 20);
 
	list.AddItem(25, 30);
 
	list.AddItem(30, 30);
 
	list.AddItem(35, 40);
 
	list.AddItem(40, 40);
 

	
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		list.RemoveItem(i + 10);
 
		list.RemoveItem(i + 5);
 
		list.RemoveItem(i);
 
		print("   " + i);
 
	}
 

	
 
	list.AddItem(10, 10);
 
	list.AddItem(20, 20);
 
	list.AddItem(30, 30);
 
	list.AddItem(40, 40);
 

	
 
	print("");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		list.SetValue(i, 50);
 
		print("   " + i);
 
	}
 
	print("");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("   " + i);
 
	}
 

	
 
	list = AIList();
 
	list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_DESCENDING);
 
	print("");
 
	print(" Item Descending");
 
	list.AddItem( 5, 10);
 
	list.AddItem(10, 10);
 
	list.AddItem(15, 20);
 
	list.AddItem(20, 20);
 
	list.AddItem(25, 30);
 
	list.AddItem(30, 30);
 
	list.AddItem(35, 40);
 
	list.AddItem(40, 40);
 

	
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		list.RemoveItem(i - 10);
 
		list.RemoveItem(i - 5);
 
		list.RemoveItem(i);
 
		print("   " + i);
 
	}
 

	
 
	list.AddItem(10, 10);
 
	list.AddItem(20, 20);
 
	list.AddItem(30, 30);
 
	list.AddItem(40, 40);
 

	
 
	print("");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		list.SetValue(i, 2);
 
		print("   " + i);
 
	}
 
	print("");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("   " + i);
 
	}
 

	
 
	list = AIList();
 
	list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
 
	print("");
 
	print(" Item Ascending");
 
	list.AddItem( 5, 10);
 
	list.AddItem(10, 10);
 
	list.AddItem(15, 20);
 
	list.AddItem(20, 20);
 
	list.AddItem(25, 30);
 
	list.AddItem(30, 30);
 
	list.AddItem(35, 40);
 
	list.AddItem(40, 40);
 

	
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		list.RemoveItem(i + 10);
 
		list.RemoveItem(i + 5);
 
		list.RemoveItem(i);
 
		print("   " + i);
 
	}
 

	
 
	list.AddItem(10, 10);
 
	list.AddItem(20, 20);
 
	list.AddItem(30, 30);
 
	list.AddItem(40, 40);
 

	
 
	print("");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		list.SetValue(i, 50);
 
		print("   " + i);
 
	}
 
	print("");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("   " + i);
 
	}
 

	
 
	list.Clear();
 
	foreach (idx, val in list) {
 
		print("   " + idx);
 
	}
 

	
 
	print(" Ops:      " + this.GetOpsTillSuspend());
 
}
 

	
 
function Regression::Std()
 
{
 
	print("");
 
	print("--Std--");
 
	print(" abs(-21): " + abs(-21));
 
	print(" abs( 21): " + abs(21));
 
}
 

	
 
function Regression::Base()
 
{
 
	print("");
 
	print("--AIBase--");
 
	print("  Rand():       " + AIBase.Rand());
 
	print("  Rand():       " + AIBase.Rand());
 
	print("  Rand():       " + AIBase.Rand());
 
	print("  RandRange(0): " + AIBase.RandRange(0));
 
	print("  RandRange(0): " + AIBase.RandRange(0));
 
	print("  RandRange(0): " + AIBase.RandRange(0));
 
	print("  RandRange(1): " + AIBase.RandRange(1));
 
	print("  RandRange(1): " + AIBase.RandRange(1));
 
	print("  RandRange(1): " + AIBase.RandRange(1));
 
	print("  RandRange(2): " + AIBase.RandRange(2));
 
	print("  RandRange(2): " + AIBase.RandRange(2));
 
	print("  RandRange(2): " + AIBase.RandRange(2));
 
	print("  RandRange(1000000): " + AIBase.RandRange(1000000)); // 32 bit tests
 
	print("  RandRange(1000000): " + AIBase.RandRange(1000000));
 
	print("  RandRange(1000000): " + AIBase.RandRange(1000000));
 
	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
 
	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
 
	print("  Chance(1, 2): " + AIBase.Chance(1, 2));
 

	
 
	AIRoad.SetCurrentRoadType(AIRoad.ROADTYPE_ROAD);
 
}
 

	
 
function Regression::Airport()
 
{
 
	print("");
 
	print("--AIAirport--");
 

	
 
	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32116));
 
	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32116));
 
	print("  GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116));
 
	print("  GetAirportType():     " + AIAirport.GetAirportType(32116));
 

	
 
	for (local i = -1; i < 10; i++) {
 
		print("  IsAirportInformationAvailable(" + i + "): " + AIAirport.IsAirportInformationAvailable(i));
 
		print("  IsValidAirportType(" + i + "):            " + AIAirport.IsValidAirportType(i));
 
		print("  GetAirportWidth(" + i + "):               " + AIAirport.GetAirportWidth(i));
 
		print("  GetAirportHeight(" + i + "):              " + AIAirport.GetAirportHeight(i));
 
		print("  GetAirportCoverageRadius(" + i + "):      " + AIAirport.GetAirportCoverageRadius(i));
 
	}
 

	
 
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 
	print("  GetPrice():           " + AIAirport.GetPrice(0));
 
	print("  BuildAirport():       " + AIAirport.BuildAirport(32116, 0, AIStation.STATION_JOIN_ADJACENT));
 
	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32116));
 
	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32116));
 
	print("  GetAirportType():     " + AIAirport.GetAirportType(32119));
 
	print("  GetHangarOfAirport(): " + AIAirport.GetHangarOfAirport(32116));
 
	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32119));
 
	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32119));
 
	print("  GetAirportType():     " + AIAirport.GetAirportType(32119));
 
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 

	
 
	print("  RemoveAirport():      " + AIAirport.RemoveAirport(32118));
 
	print("  IsHangarTile():       " + AIAirport.IsHangarTile(32119));
 
	print("  IsAirportTile():      " + AIAirport.IsAirportTile(32119));
 
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 
	print("  BuildAirport():       " + AIAirport.BuildAirport(32116, 0, AIStation.STATION_JOIN_ADJACENT));
 
}
 

	
 
function Regression::Bridge()
 
{
 
	local j = 0;
 

	
 
	print("");
 
	print("--Bridge--");
 
	for (local i = -1; i < 14; i++) {
 
		if (AIBridge.IsValidBridge(i)) j++;
 
		print("  Bridge " + i);
 
		print("    IsValidBridge():    " + AIBridge.IsValidBridge(i));
 
		print("    GetName():");
 
		print("     VT_RAIL:           " + AIBridge.GetName(i, AIVehicle.VT_RAIL));
 
		print("     VT_ROAD:           " + AIBridge.GetName(i, AIVehicle.VT_ROAD));
 
		print("     VT_WATER:          " + AIBridge.GetName(i, AIVehicle.VT_WATER));
 
		print("     VT_AIR:            " + AIBridge.GetName(i, AIVehicle.VT_AIR));
 
		print("    GetMaxSpeed():      " + AIBridge.GetMaxSpeed(i));
 
		print("    GetPrice():         " + AIBridge.GetPrice(i, 5));
 
		print("    GetMaxLength():     " + AIBridge.GetMaxLength(i));
 
		print("    GetMinLength():     " + AIBridge.GetMinLength(i));
 
	}
 
	print("  Valid Bridges:        " + j);
 

	
 
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33160));
 
	print("  GetBridgeID():        " + AIBridge.GetBridgeID(33160));
 
	print("  RemoveBridge():       " + AIBridge.RemoveBridge(33155));
 
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
 
	print("  GetOtherBridgeEnd():  " + AIBridge.GetOtherBridgeEnd(33160));
 
	print("  BuildBridge():        " + AIBridge.BuildBridge(AIVehicle.VT_ROAD, 5, 33160, 33155));
 
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33160));
 
	print("  GetBridgeID():        " + AIBridge.GetBridgeID(33160));
 
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33155));
 
	print("  GetBridgeID():        " + AIBridge.GetBridgeID(33155));
 
	print("  GetOtherBridgeEnd():  " + AIBridge.GetOtherBridgeEnd(33160));
 
	print("  BuildBridge():        " + AIBridge.BuildBridge(AIVehicle.VT_ROAD, 5, 33160, 33155));
 
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
 
	print("  RemoveBridge():       " + AIBridge.RemoveBridge(33155));
 
	print("  IsBridgeTile():       " + AIBridge.IsBridgeTile(33160));
 
}
 

	
 
function Regression::BridgeList()
 
{
 
	local list = AIBridgeList();
 

	
 
	print("");
 
	print("--BridgeList--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIBridge.GetMaxSpeed);
 
	print("  MaxSpeed ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIBridge.GetPrice, 5);
 
	print("  Price ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIBridge.GetMaxLength);
 
	print("  MaxLength ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIBridge.GetMinLength);
 
	print("  MinLength ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AIBridgeList_Length(14);
 

	
 
	print("");
 
	print("--BridgeList_Length--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIBridge.GetMaxSpeed);
 
	print("  MaxSpeed ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIBridge.GetPrice, 14);
 
	print("  Price ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
}
 

	
 
function Regression::Cargo()
 
{
 
	print("");
 
	print("--AICargo--");
 
	for (local i = -1; i < 15; i++) {
 
		print("  Cargo " + i);
 
		print("    IsValidCargo():          " + AICargo.IsValidCargo(i));
 
		print("    GetName():               '" + AICargo.GetName(i) + "'");
 
		print("    GetCargoLabel():         '" + AICargo.GetCargoLabel(i) + "'");
 
		print("    IsFreight():             " + AICargo.IsFreight(i));
 
		print("    HasCargoClass():         " + AICargo.HasCargoClass(i, AICargo.CC_PASSENGERS));
 
		print("    GetTownEffect():         " + AICargo.GetTownEffect(i));
 
		print("    GetCargoIncome(0, 0):    " + AICargo.GetCargoIncome(i, 0, 0));
 
		print("    GetCargoIncome(10, 10):  " + AICargo.GetCargoIncome(i, 10, 10));
 
		print("    GetCargoIncome(100, 10): " + AICargo.GetCargoIncome(i, 100, 10));
 
		print("    GetCargoIncome(10, 100): " + AICargo.GetCargoIncome(i, 10, 100));
 
		print("    GetRoadVehicleTypeForCargo(): " + AIRoad.GetRoadVehicleTypeForCargo(i));
 
	}
 
}
 

	
 
function Regression::CargoList()
 
{
 
	local list = AICargoList();
 

	
 
	print("");
 
	print("--CargoList--");
 
	print("  Count():            " + list.Count());
 
	list.Valuate(AICargo.IsFreight);
 
	print("  IsFreight ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AICargo.GetCargoIncome, 100, 100);
 
	print("  CargoIncomes(100, 100) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AICargoList_IndustryAccepting(8);
 
	print("");
 
	print("--CargoList_IndustryAccepting--");
 
	print("  Count():            " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i);
 
	}
 

	
 
	list = AICargoList_IndustryProducing(4);
 
	print("");
 
	print("--CargoList_IndustryProducing--");
 
	print("  Count():            " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i);
 
	}
 
}
 

	
 
function Regression::Company()
 
{
 
	print("");
 
	print("--Company--");
 

	
 
	/* Test AIXXXMode() in scopes */
 
	{
 
		local test = AITestMode();
 
		print("  SetName():            " + AICompany.SetName("Regression"));
 
		print("  SetName():            " + AICompany.SetName("Regression"));
 
		{
 
			local exec = AIExecMode();
 
			print("  SetName():            " + AICompany.SetName("Regression"));
 
			print("  SetName():            " + AICompany.SetName("Regression"));
 
			print("  GetLastErrorString(): " + AIError.GetLastErrorString());
 
		}
 
	}
 

	
 
	print("  GetName():                         " + AICompany.GetName(AICompany.COMPANY_SELF));
 
	print("  GetPresidentName():                " + AICompany.GetPresidentName(AICompany.COMPANY_SELF));
 
	print("  SetPresidentName():                " + AICompany.SetPresidentName("Regression AI"));
 
	print("  GetPresidentName():                " + AICompany.GetPresidentName(AICompany.COMPANY_SELF));
 
	print("  GetBankBalance():                  " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 
	print("  GetName():                         " + AICompany.GetName(240));
 
	print("  GetLoanAmount():                   " + AICompany.GetLoanAmount());
 
	print("  GetMaxLoanAmount():                " + AICompany.GetMaxLoanAmount());
 
	print("  GetLoanInterval():                 " + AICompany.GetLoanInterval());
 
	print("  SetLoanAmount(1):                  " + AICompany.SetLoanAmount(1));
 
	print("  SetLoanAmount(100):                " + AICompany.SetLoanAmount(100));
 
	print("  SetLoanAmount(10000):              " + AICompany.SetLoanAmount(10000));
 
	print("  GetLastErrorString():              " + AIError.GetLastErrorString());
 
	print("  GetBankBalance():                  " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 
	print("  GetLoanAmount():                   " + AICompany.GetLoanAmount());
 
	print("  SetMinimumLoanAmount(31337):       " + AICompany.SetMinimumLoanAmount(31337));
 
	print("  GetBankBalance():                  " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 
	print("  GetLoanAmount():                   " + AICompany.GetLoanAmount());
 
	print("  SetLoanAmount(10000):              " + AICompany.SetLoanAmount(AICompany.GetMaxLoanAmount()));
 
	print("  GetBankBalance():                  " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 
	print("  GetLoanAmount():                   " + AICompany.GetLoanAmount());
 
	print("  GetCompanyHQ():                    " + AICompany.GetCompanyHQ(AICompany.COMPANY_SELF));
 
	print("  BuildCompanyHQ():                  " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(127, 129)));
 
	print("  GetCompanyHQ():                    " + AICompany.GetCompanyHQ(AICompany.COMPANY_SELF));
 
	print("  BuildCompanyHQ():                  " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(129, 129)));
 
	print("  GetCompanyHQ():                    " + AICompany.GetCompanyHQ(AICompany.COMPANY_SELF));
 
	print("  BuildCompanyHQ():                  " + AICompany.BuildCompanyHQ(AIMap.GetTileIndex(239, 76)));
 
	print("  GetLastErrorString():              " + AIError.GetLastErrorString());
 
	print("  GetAutoRenewStatus():              " + AICompany.GetAutoRenewStatus(AICompany.COMPANY_SELF));
 
	print("  SetAutoRenewStatus(true):          " + AICompany.SetAutoRenewStatus(true));
 
	print("  GetAutoRenewStatus():              " + AICompany.GetAutoRenewStatus(AICompany.COMPANY_SELF));
 
	print("  SetAutoRenewStatus(true):          " + AICompany.SetAutoRenewStatus(true));
 
	print("  SetAutoRenewStatus(false):         " + AICompany.SetAutoRenewStatus(false));
 
	print("  GetAutoRenewStatus():              " + AICompany.GetAutoRenewStatus(AICompany.COMPANY_SELF));
 
	print("  GetAutoRenewMonths():              " + AICompany.GetAutoRenewMonths(AICompany.COMPANY_SELF));
 
	print("  SetAutoRenewMonths(-12):           " + AICompany.SetAutoRenewMonths(-12));
 
	print("  GetAutoRenewMonths():              " + AICompany.GetAutoRenewMonths(AICompany.COMPANY_SELF));
 
	print("  SetAutoRenewMonths(-12):           " + AICompany.SetAutoRenewMonths(-12));
 
	print("  SetAutoRenewMonths(6):             " + AICompany.SetAutoRenewMonths(6));
 
	print("  GetAutoRenewMoney():               " + AICompany.GetAutoRenewMoney(AICompany.COMPANY_SELF));
 
	print("  SetAutoRenewMoney(200000):         " + AICompany.SetAutoRenewMoney(200000));
 
	print("  GetAutoRenewMoney():               " + AICompany.GetAutoRenewMoney(AICompany.COMPANY_SELF));
 
	print("  SetAutoRenewMoney(200000):         " + AICompany.SetAutoRenewMoney(200000));
 
	print("  SetAutoRenewMoney(100000):         " + AICompany.SetAutoRenewMoney(100000));
 
	for (local i = -1; i <= AICompany.EARLIEST_QUARTER; i++) {
 
		print("  Quarter: " + i);
 
		print("    GetQuarterlyIncome():            " + AICompany.GetQuarterlyIncome(AICompany.COMPANY_SELF, i));
 
		print("    GetQuarterlyExpenses():          " + AICompany.GetQuarterlyExpenses(AICompany.COMPANY_SELF, i));
 
		print("    GetQuarterlyCargoDelivered():    " + AICompany.GetQuarterlyCargoDelivered(AICompany.COMPANY_SELF, i));
 
		print("    GetQuarterlyPerformanceRating(): " + AICompany.GetQuarterlyPerformanceRating(AICompany.COMPANY_SELF, i));
 
		print("    GetQuarterlyCompanyValue():      " + AICompany.GetQuarterlyCompanyValue(AICompany.COMPANY_SELF, i));
 
	}
 
}
 

	
 
function Regression::Engine()
 
{
 
	local j = 0;
 

	
 
	print("");
 
	print("--Engine--");
 
	for (local i = -1; i < 257; i++) {
 
		if (AIEngine.IsValidEngine(i)) j++;
 
		print("  Engine " + i);
 
		print("    IsValidEngine():    " + AIEngine.IsValidEngine(i));
 
		print("    GetName():          " + AIEngine.GetName(i));
 
		print("    GetCargoType():     " + AIEngine.GetCargoType(i));
 
		print("    CanRefitCargo():    " + AIEngine.CanRefitCargo(i, 1));
 
		print("    GetCapacity():      " + AIEngine.GetCapacity(i));
 
		print("    GetReliability():   " + AIEngine.GetReliability(i));
 
		print("    GetMaxSpeed():      " + AIEngine.GetMaxSpeed(i));
 
		print("    GetPrice():         " + AIEngine.GetPrice(i));
 
		print("    GetMaxAge():        " + AIEngine.GetMaxAge(i));
 
		print("    GetRunningCost():   " + AIEngine.GetRunningCost(i));
 
		print("    GetPower():         " + AIEngine.GetPower(i));
 
		print("    GetWeight():        " + AIEngine.GetWeight(i));
 
		print("    GetMaxTractiveEffort(): " + AIEngine.GetMaxTractiveEffort(i));
 
		print("    GetVehicleType():   " + AIEngine.GetVehicleType(i));
 
		print("    GetRailType():      " + AIEngine.GetRailType(i));
 
		print("    GetRoadType():      " + AIEngine.GetRoadType(i));
 
		print("    GetPlaneType():     " + AIEngine.GetPlaneType(i));
 
	}
 
	print("  Valid Engines:        " + j);
 
}
 

	
 
function Regression::EngineList()
 
{
 
	local list = AIEngineList(AIVehicle.VT_ROAD);
 

	
 
	print("");
 
	print("--EngineList--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIEngine.GetCargoType);
 
	print("  CargoType ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIEngine.GetCapacity);
 
	print("  Capacity ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIEngine.GetReliability);
 
	print("  Reliability ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIEngine.GetMaxSpeed);
 
	print("  MaxSpeed ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIEngine.GetPrice);
 
	print("  Price ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
}
 

	
 
function Regression::Prices()
 
{
 
	print("");
 
	print("--Prices--");
 
	print(" -Rail-");
 
	print("  0,BT_TRACK:    " + AIRail.GetBuildCost(0, AIRail.BT_TRACK));
 
	print("  0,BT_SIGNAL:   " + AIRail.GetBuildCost(0, AIRail.BT_SIGNAL));
 
	print("  0,BT_DEPOT:    " + AIRail.GetBuildCost(0, AIRail.BT_DEPOT));
 
	print("  0,BT_STATION:  " + AIRail.GetBuildCost(0, AIRail.BT_STATION));
 
	print("  0,BT_WAYPOINT: " + AIRail.GetBuildCost(0, AIRail.BT_WAYPOINT));
 
	print("  1,BT_TRACK:    " + AIRail.GetBuildCost(1, AIRail.BT_TRACK));
 
	print("  1,BT_SIGNAL:   " + AIRail.GetBuildCost(1, AIRail.BT_SIGNAL));
 
	print("  1,BT_DEPOT:    " + AIRail.GetBuildCost(1, AIRail.BT_DEPOT));
 
	print("  1,BT_STATION:  " + AIRail.GetBuildCost(1, AIRail.BT_STATION));
 
	print("  1,BT_WAYPOINT: " + AIRail.GetBuildCost(1, AIRail.BT_WAYPOINT));
 
	print(" -Road-");
 
	print("  ROADTYPE_ROAD,BT_ROAD:       " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_ROAD));
 
	print("  ROADTYPE_ROAD,BT_DEPOT:      " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_DEPOT));
 
	print("  ROADTYPE_ROAD,BT_BUS_STOP:   " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_BUS_STOP));
 
	print("  ROADTYPE_ROAD,BT_TRUCK_STOP: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_ROAD, AIRoad.BT_TRUCK_STOP));
 
	print("  ROADTYPE_TRAM,BT_ROAD:       " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_ROAD));
 
	print("  ROADTYPE_TRAM,BT_DEPOT:      " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_DEPOT));
 
	print("  ROADTYPE_TRAM,BT_BUS_STOP:   " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_BUS_STOP));
 
	print("  ROADTYPE_TRAM,BT_TRUCK_STOP: " + AIRoad.GetBuildCost(AIRoad.ROADTYPE_TRAM, AIRoad.BT_TRUCK_STOP));
 
	print(" -Water-");
 
	print("  BT_DOCK:  " + AIMarine.GetBuildCost(AIMarine.BT_DOCK));
 
	print("  BT_DEPOT: " + AIMarine.GetBuildCost(AIMarine.BT_DEPOT));
 
	print("  BT_BUOY:  " + AIMarine.GetBuildCost(AIMarine.BT_BUOY));
 
	print("  BT_LOCK:  " + AIMarine.GetBuildCost(AIMarine.BT_LOCK));
 
	print("  BT_CANAL: " + AIMarine.GetBuildCost(AIMarine.BT_CANAL));
 
	print(" -Tile-");
 
	print("  BT_FOUNDATION:   " + AITile.GetBuildCost(AITile.BT_FOUNDATION));
 
	print("  BT_TERRAFORM:    " + AITile.GetBuildCost(AITile.BT_TERRAFORM));
 
	print("  BT_BUILD_TREES:  " + AITile.GetBuildCost(AITile.BT_BUILD_TREES));
 
	print("  BT_CLEAR_GRASS:  " + AITile.GetBuildCost(AITile.BT_CLEAR_GRASS));
 
	print("  BT_CLEAR_ROUGH:  " + AITile.GetBuildCost(AITile.BT_CLEAR_ROUGH));
 
	print("  BT_CLEAR_ROCKY:  " + AITile.GetBuildCost(AITile.BT_CLEAR_ROCKY));
 
	print("  BT_CLEAR_FIELDS: " + AITile.GetBuildCost(AITile.BT_CLEAR_FIELDS));
 
	print("  BT_CLEAR_HOUSE:  " + AITile.GetBuildCost(AITile.BT_CLEAR_HOUSE));
 
	print("  BT_CLEAR_WATER:  " + AITile.GetBuildCost(AITile.BT_CLEAR_WATER));
 
}
 

	
 
function cost_callback(old_path, new_tile, new_direction, self) { if (old_path == null) return 0; return old_path.GetCost() + 1; }
 
function estimate_callback(tile, direction, goals, self) { return goals[0] - tile; }
 
function neighbours_callback(path, cur_tile, self) { return [[cur_tile + 1, 1]]; }
 
function check_direction_callback(tile, existing_direction, new_direction, self) { return false; }
 

	
 
function Regression::Group()
 
{
 
	print ("");
 
	print("--Group--");
 
	print("  SetAutoReplace():         " + AIGroup.SetAutoReplace(AIGroup.GROUP_ALL, 116, 117));
 
	print("  GetEngineReplacement():   " + AIGroup.GetEngineReplacement(AIGroup.GROUP_ALL, 116));
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(AIGroup.GROUP_ALL, 116));
 
	print("  AIRoad.BuildRoadDepot():  " + AIRoad.BuildRoadDepot(10000, 10001));
 
	local vehicle = AIVehicle.BuildVehicle(10000, 116);
 
	print("  AIVehicle.BuildVehicle(): " + vehicle);
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(AIGroup.GROUP_ALL, 116));
 
	local group = AIGroup.CreateGroup(AIVehicle.VT_ROAD, AIGroup.GROUP_INVALID);
 
	print("  CreateGroup():            " + group);
 
	print("  MoveVehicle():            " + AIGroup.MoveVehicle(group, vehicle));
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(group, 116));
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(AIGroup.GROUP_ALL, 116));
 
	print("  GetNumEngines():          " + AIGroup.GetNumEngines(AIGroup.GROUP_DEFAULT, 116));
 
	print("  GetName():                " + AIGroup.GetName(0));
 
	print("  GetName():                " + AIGroup.GetName(1));
 
	print("  AIVehicle.SellVehicle():  " + AIVehicle.SellVehicle(vehicle));
 
	print("  AITile.DemolishTile():    " + AITile.DemolishTile(10000));
 
	print("  HasWagonRemoval():        " + AIGroup.HasWagonRemoval());
 
	print("  EnableWagonRemoval():     " + AIGroup.EnableWagonRemoval(true));
 
	print("  HasWagonRemoval():        " + AIGroup.HasWagonRemoval());
 
	print("  EnableWagonRemoval():     " + AIGroup.EnableWagonRemoval(false));
 
	print("  EnableWagonRemoval():     " + AIGroup.EnableWagonRemoval(false));
 
	print("  HasWagonRemoval():        " + AIGroup.HasWagonRemoval());
 
}
 

	
 
function Regression::Industry()
 
{
 
	local j = 0;
 

	
 
	print("");
 
	print("--Industry--");
 
	print("  GetIndustryCount():  " + AIIndustry.GetIndustryCount());
 
	local list = AIIndustryList();
 
	list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		if (AIIndustry.IsValidIndustry(i)) j++;
 
		print("  Industry " + i);
 
		print("    IsValidIndustry(): " + AIIndustry.IsValidIndustry(i));
 
		print("    GetName():         " + AIIndustry.GetName(i));
 
		print("    GetLocation():     " + AIIndustry.GetLocation(i));
 
		print("    IsCargoAccepted(): " + AIIndustry.IsCargoAccepted(i, 1));
 

	
 
		local cargo_list = AICargoList();
 
		for (local j = cargo_list.Begin(); !cargo_list.IsEnd(); j = cargo_list.Next()) {
 
			if (AIIndustry.IsCargoAccepted(i, j) || AIIndustry.GetLastMonthProduction(i,j) >= 0) {
 
				print("	   GetLastMonthProduction():  " + AIIndustry.GetLastMonthProduction(i, j));
 
				print("	   GetLastMonthTransported(): " + AIIndustry.GetLastMonthTransported(i, j));
 
				print("	   GetStockpiledCargo():      " + AIIndustry.GetStockpiledCargo(i, j));
 
			}
 
		}
 
	}
 
	print("  Valid Industries:    " + j);
 
	print("  GetIndustryCount():  " + AIIndustry.GetIndustryCount());
 
	print("  GetIndustryID():     " + AIIndustry.GetIndustryID(19694));
 
	print("  GetIndustryID():     " + AIIndustry.GetIndustryID(19695));
 
}
 

	
 
function Regression::IndustryList()
 
{
 
	local list = AIIndustryList();
 

	
 
	print("");
 
	print("--IndustryList--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIIndustry.GetLocation);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIIndustry.GetDistanceManhattanToTile, 30000);
 
	print("  DistanceManhattanToTile(30000) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIIndustry.GetDistanceSquareToTile, 30000);
 
	print("  DistanceSquareToTile(30000) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIIndustry.GetAmountOfStationsAround);
 
	print("  GetAmountOfStationsAround(30000) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIIndustry.IsCargoAccepted, 1);
 
	print("  CargoAccepted(1) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AIIndustryList_CargoAccepting(1);
 
	print("--IndustryList_CargoAccepting--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIIndustry.GetLocation);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AIIndustryList_CargoProducing(1);
 
	print("--IndustryList_CargoProducing--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIIndustry.GetLocation);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
}
 

	
 
function Regression::IndustryTypeList()
 
{
 
	local list = AIIndustryTypeList();
 

	
 
	print("");
 
	print("--IndustryTypeList--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIIndustry.GetLocation);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    Id:                      " + i);
 
		print("    IsRawIndustry():         " + AIIndustryType.IsRawIndustry(i));
 
		print("    ProductionCanIncrease(): " + AIIndustryType.ProductionCanIncrease(i));
 
		print("    GetConstructionCost():   " + AIIndustryType.GetConstructionCost(i));
 
		print("    GetName():               " + AIIndustryType.GetName(i));
 
		print("    CanBuildIndustry():      " + AIIndustryType.CanBuildIndustry(i));
 
		print("    CanProspectIndustry():   " + AIIndustryType.CanProspectIndustry(i));
 
		print("    IsBuiltOnWater():        " + AIIndustryType.IsBuiltOnWater(i));
 
		print("    HasHeliport():           " + AIIndustryType.HasHeliport(i));
 
		print("    HasDock():               " + AIIndustryType.HasDock(i));
 
	}
 
}
 

	
 
function CustomValuator(list_id)
 
{
 
	return list_id * 4343;
 
}
 

	
 
function Regression::List()
 
{
 
	local list = AIList();
 

	
 
	print("");
 
	print("--List--");
 

	
 
	print("  IsEmpty():     " + list.IsEmpty());
 
	list.AddItem(1, 1);
 
	list.AddItem(2, 2);
 
	for (local i = 1000; i < 1100; i++) {
 
		list.AddItem(i, i);
 
	}
 
	list.RemoveItem(1050);
 
	list.RemoveItem(1150);
 
	list.SetValue(1051, 12);
 
	print("  Count():       " + list.Count());
 
	print("  HasItem(1050): " + list.HasItem(1050));
 
	print("  HasItem(1051): " + list.HasItem(1051));
 
	print("  IsEmpty():     " + list.IsEmpty());
 
	list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
 
	print("  List Dump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(CustomValuator);
 
	print("  Custom ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(function (a) { return a * 42; });
 
	print("  Custom ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIBase.RandItem);
 
	print("  Randomize ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.KeepTop(10);
 
	print("  KeepTop(10):");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.KeepBottom(8);
 
	print("  KeepBottom(8):");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.RemoveBottom(2);
 
	print("  RemoveBottom(2):");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.RemoveTop(2);
 
	print("  RemoveTop(2):");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	local list2 = AIList();
 
	list2.AddItem(1003, 0);
 
	list2.AddItem(1004, 0);
 
	list.RemoveList(list2);
 
	print("  RemoveList({1003, 1004}):");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list2.AddItem(1005, 0);
 
	list.KeepList(list2);
 
	print("  KeepList({1003, 1004, 1005}):");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list2.Clear();
 
	for (local i = 4000; i < 4003; i++) {
 
		list2.AddItem(i, i * 2);
 
	}
 
	list2.AddItem(1005, 1005);
 
	list.AddList(list2);
 
	print("  AddList({1005, 4000, 4001, 4002}):");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list[4000] = 50;
 
	list[4006] = 12;
 

	
 
	print("  foreach():");
 
	foreach (idx, val in list) {
 
		print("    " + idx + " => " + val);
 
	}
 
	print("  []:");
 
	print("    4000 => " + list[4000]);
 

	
 
	list.Clear();
 
	print("  IsEmpty():     " + list.IsEmpty());
 

	
 
	for (local i = 0; i < 10; i++) {
 
		list.AddItem(i, 5 + i / 2);
 
	}
 

	
 
	local it = list.Begin();
 
	print("    " + it + " => " + list.GetValue(it) + "  (" + !list.IsEnd() + ")");
 
	list.Sort(list.SORT_BY_VALUE, list.SORT_ASCENDING);
 
	it = list.Next();
 
	print("    " + it + " => " + list.GetValue(it) + "  (" + !list.IsEnd() + ")");
 

	
 
	it = list.Begin();
 
	print("    " + it + " => " + list.GetValue(it) + "  (" + !list.IsEnd() + ")");
 

	
 
	list.SetValue(it + 1, -5);
 
	it = list.Next();
 
	print("    " + it + " => " + list.GetValue(it) + "  (" + !list.IsEnd() + ")");
 

	
 
	list.RemoveValue(list.GetValue(it) + 1);
 
	it = list.Next();
 
	print("    " + it + " => " + list.GetValue(it) + "  (" + !list.IsEnd() + ")");
 

	
 
	list.RemoveAboveValue(list.GetValue(it));
 
	it = list.Next();
 
	print("    " + it + " => " + list.GetValue(it) + "  (" + !list.IsEnd() + ")");
 

	
 
	while (!list.IsEnd()) {
 
		it = list.Next();
 
		print("    " + it + " => " + list.GetValue(it));
 
	}
 
}
 

	
 
function Regression::Map()
 
{
 
	print("");
 
	print("--Map--");
 
	print("  GetMapSize():     " + AIMap.GetMapSize());
 
	print("  GetMapSizeX():    " + AIMap.GetMapSizeX());
 
	print("  GetMapSizeY():    " + AIMap.GetMapSizeY());
 
	print("  GetTileX(123):    " + AIMap.GetTileX(123));
 
	print("  GetTileY(123):    " + AIMap.GetTileY(123));
 
	print("  GetTileIndex():   " + AIMap.GetTileIndex(123, 0));
 
	print("  GetTileIndex():   " + AIMap.GetTileIndex(0, 123));
 
	print("  GetTileIndex():   " + AIMap.GetTileIndex(0, 0));
 
	print("  GetTileIndex():   " + AIMap.GetTileIndex(-1, -1));
 
	print("  GetTileIndex():   " + AIMap.GetTileIndex(10000, 10000));
 
	print("  IsValidTile(123): " + AIMap.IsValidTile(123));
 
	print("  GetTileX(124):    " + AIMap.GetTileX(124));
 
	print("  GetTileY(124):    " + AIMap.GetTileY(124));
 
	print("  IsValidTile(124): " + AIMap.IsValidTile(124));
 
	print("  IsValidTile(0):   " + AIMap.IsValidTile(0));
 
	print("  IsValidTile(-1):  " + AIMap.IsValidTile(-1));
 
	print("  IsValidTile():    " + AIMap.IsValidTile(AIMap.GetMapSize()));
 
	print("  IsValidTile():    " + AIMap.IsValidTile(AIMap.GetMapSize() - AIMap.GetMapSizeX() - 2));
 
	print("  DemolishTile():   " + AITile.DemolishTile(19592));
 
	print("  DemolishTile():   " + AITile.DemolishTile(19335));
 
	print("  Distance");
 
	print("    DistanceManhattan(): " + AIMap.DistanceManhattan(1, 10000));
 
	print("    DistanceMax():       " + AIMap.DistanceMax(1, 10000));
 
	print("    DistanceSquare():    " + AIMap.DistanceSquare(1, 10000));
 
	print("    DistanceFromEdge():  " + AIMap.DistanceFromEdge(10000));
 
}
 

	
 
function Regression::Marine()
 
{
 
	print("");
 
	print("--AIMarine--");
 

	
 
	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(32116));
 
	print("  IsDockTile():         " + AIMarine.IsDockTile(32116));
 
	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(32116));
 
	print("  IsLockTile():         " + AIMarine.IsLockTile(32116));
 
	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32116));
 

	
 
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 
	print("  BuildWaterDepot():    " + AIMarine.BuildWaterDepot(28479, 28478));
 
	print("  BuildDock():          " + AIMarine.BuildDock(29253, AIStation.STATION_JOIN_ADJACENT));
 
	print("  BuildBuoy():          " + AIMarine.BuildBuoy(28481));
 
	print("  BuildLock():          " + AIMarine.BuildLock(28487));
 
	print("  HasTransportType():   " + AITile.HasTransportType(32127, AITile.TRANSPORT_WATER));
 
	print("  BuildCanal():         " + AIMarine.BuildCanal(32127));
 
	print("  HasTransportType():   " + AITile.HasTransportType(32127, AITile.TRANSPORT_WATER));
 
	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(28479));
 
	print("  IsDockTile():         " + AIMarine.IsDockTile(29253));
 
	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(28481));
 
	print("  IsLockTile():         " + AIMarine.IsLockTile(28487));
 
	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32127));
 
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 

	
 
	local list = AIWaypointList(AIWaypoint.WAYPOINT_BUOY);
 
	print("");
 
	print("--AIWaypointList(BUOY)--");
 
	print("  Count():             " + list.Count());
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + AIWaypoint.GetLocation(i));
 
	}
 
	print("  HasWaypointType:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_RAIL) + "  " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_BUOY) + "  " + AIWaypoint.HasWaypointType(i, AIWaypoint.WAYPOINT_ANY));
 
	}
 
	print("");
 

	
 
	print("  RemoveWaterDepot():   " + AIMarine.RemoveWaterDepot(28479));
 
	print("  RemoveDock():         " + AIMarine.RemoveDock(29253));
 
	print("  RemoveBuoy():         " + AIMarine.RemoveBuoy(28481));
 
	print("  RemoveLock():         " + AIMarine.RemoveLock(28487));
 
	print("  RemoveCanal():        " + AIMarine.RemoveCanal(32127));
 
	print("  IsWaterDepotTile():   " + AIMarine.IsWaterDepotTile(28479));
 
	print("  IsDockTile():         " + AIMarine.IsDockTile(29253));
 
	print("  IsBuoyTile():         " + AIMarine.IsBuoyTile(28481));
 
	print("  IsLockTile():         " + AIMarine.IsLockTile(28487));
 
	print("  IsCanalTile():        " + AIMarine.IsCanalTile(32127));
 
	print("  GetBankBalance():     " + AICompany.GetBankBalance(AICompany.COMPANY_SELF));
 

	
 
	print("  BuildWaterDepot():    " + AIMarine.BuildWaterDepot(28479, 28480));
 
	print("  BuildDock():          " + AIMarine.BuildDock(29253, AIStation.STATION_JOIN_ADJACENT));
 
	print("  BuildBuoy():          " + AIMarine.BuildBuoy(28481));
 
	print("  BuildLock():          " + AIMarine.BuildLock(28487));
 
	print("  BuildCanal():         " + AIMarine.BuildCanal(28744));
 
}
 

	
 
function Regression::Order()
 
{
 
	print("");
 
	print("--Order--");
 
	print("  GetOrderCount():       " + AIOrder.GetOrderCount(12));
 
	print("  GetOrderDestination(): " + AIOrder.GetOrderDestination(12, 1));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33416, AIOrder.OF_TRANSFER));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33416, AIOrder.OF_TRANSFER | AIOrder.OF_UNLOAD));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33416, AIOrder.OF_TRANSFER | AIOrder.OF_FULL_LOAD));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33417, AIOrder.OF_SERVICE_IF_NEEDED));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(33417, AIOrder.OF_STOP_IN_DEPOT));
 
	print("  AreOrderFlagsValid():  " + AIOrder.AreOrderFlagsValid(0, AIOrder.OF_SERVICE_IF_NEEDED | AIOrder.OF_GOTO_NEAREST_DEPOT));
 
	print("  IsValidConditionalOrder(): " + AIOrder.IsValidConditionalOrder(AIOrder.OC_LOAD_PERCENTAGE, AIOrder.CF_EQUALS));
 
	print("  IsValidConditionalOrder(): " + AIOrder.IsValidConditionalOrder(AIOrder.OC_RELIABILITY, AIOrder.CF_IS_TRUE));
 
	print("  IsValidConditionalOrder(): " + AIOrder.IsValidConditionalOrder(AIOrder.OC_REQUIRES_SERVICE, AIOrder.CF_IS_FALSE));
 
	print("  IsValidConditionalOrder(): " + AIOrder.IsValidConditionalOrder(AIOrder.OC_AGE, AIOrder.CF_INVALID));
 
	print("  IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(12, 1));
 
	print("  IsGotoStationOrder():  " + AIOrder.IsGotoStationOrder(12, 1));
 
	print("  IsGotoDepotOrder():    " + AIOrder.IsGotoDepotOrder(12, 1));
 
	print("  IsGotoWaypointOrder(): " + AIOrder.IsGotoWaypointOrder(12, 1));
 
	print("  IsConditionalOrder():  " + AIOrder.IsConditionalOrder(12, 1));
 
	print("  IsCurrentOrderPartOfOrderList(): " + AIOrder.IsCurrentOrderPartOfOrderList(12));
 
	print("  GetOrderFlags():       " + AIOrder.GetOrderFlags(12, 1));
 
	print("  AppendOrder():         " + AIOrder.AppendOrder(12, 33416, AIOrder.OF_TRANSFER));
 
	print("  InsertOrder():         " + AIOrder.InsertOrder(12, 0, 33416, AIOrder.OF_TRANSFER));
 
	print("  GetOrderCount():       " + AIOrder.GetOrderCount(12));
 
	print("  IsValidVehicleOrder(): " + AIOrder.IsValidVehicleOrder(12, 1));
 
	print("  IsGotoStationOrder():  " + AIOrder.IsGotoStationOrder(12, 1));
 
	print("  IsGotoDepotOrder():    " + AIOrder.IsGotoDepotOrder(12, 1));
 
	print("  IsGotoWaypointOrder(): " + AIOrder.IsGotoWaypointOrder(12, 1));
 
	print("  IsConditionalOrder():  " + AIOrder.IsConditionalOrder(12, 1));
 
	print("  IsCurrentOrderPartOfOrderList(): " + AIOrder.IsCurrentOrderPartOfOrderList(12));
 
	print("  GetOrderFlags():       " + AIOrder.GetOrderFlags(12, 0));
 
	print("  GetOrderFlags():       " + AIOrder.GetOrderFlags(12, 1));
 
	print("  GetOrderJumpTo():      " + AIOrder.GetOrderJumpTo(12, 1));
 
	print("  RemoveOrder():         " + AIOrder.RemoveOrder(12, 0));
 
	print("  SetOrderFlags():       " + AIOrder.SetOrderFlags(12, 0, AIOrder.OF_FULL_LOAD));
 
	print("  GetOrderFlags():       " + AIOrder.GetOrderFlags(12, 0));
 
	print("  GetOrderDestination(): " + AIOrder.GetOrderDestination(12, 0));
 
	print("  CopyOrders():          " + AIOrder.CopyOrders(12, 1));
 
	print("  CopyOrders():          " + AIOrder.CopyOrders(13, 12));
 
	print("  ShareOrders():         " + AIOrder.ShareOrders(13, 1));
 
	print("  ShareOrders():         " + AIOrder.ShareOrders(13, 12));
 
	print("  UnshareOrders():       " + AIOrder.UnshareOrders(13));
 
	print("  AppendOrder():         " + AIOrder.AppendOrder(12, 33421, AIOrder.OF_NONE));
 

	
 
	print("  GetStopLocation():     " + AIOrder.GetStopLocation(13, 0));
 
	print("  BuildVehicle():        " + AIVehicle.BuildVehicle(23596, 8));
 
	print("  BuildRailStation():    " + AIRail.BuildRailStation(7958, AIRail.RAILTRACK_NE_SW, 1, 1, AIStation.STATION_NEW));
 
	print("  AppendOrder():         " + AIOrder.AppendOrder(20, 7958, AIOrder.OF_NONE));
 
	print("  GetOrderCount():       " + AIOrder.GetOrderCount(20));
 
	print("  GetStopLocation():     " + AIOrder.GetStopLocation(20, 0));
 
	print("  SetStopLocation():     " + AIOrder.SetStopLocation(20, 0, AIOrder.STOPLOCATION_MIDDLE));
 
	print("  GetStopLocation():     " + AIOrder.GetStopLocation(20, 0));
 

	
 
	local list = AIVehicleList_Station(3);
 

	
 
	print("");
 
	print("--VehicleList_Station--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIVehicle.GetLocation);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	print("  foreach():");
 
	foreach (idx, val in list) {
 
		print("    " + idx + " => " + val);
 
	}
 
}
 

	
 
function Regression::RailTypeList()
 
{
 
	local list = AIRailTypeList();
 

	
 
	print("");
 
	print("--RailTypeList--");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    RailType:                " + i);
 
		print("    GetName():               " + AIRail.GetName(i));
 
		print("    IsRailTypeAvailable():   " + AIRail.IsRailTypeAvailable(i));
 
		print("    GetMaxSpeed():           " + AIRail.GetMaxSpeed(i));
 
	}
 
}
 

	
 
function Regression::Rail()
 
{
 
	AIRail.SetCurrentRailType(0);
 

	
 
	print("");
 
	print("--Rail--");
 
	print("    IsRailTile():                  " + AIRail.IsRailTile(10002));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(10002, AIRail.RAILTRACK_NW_SE));
 
	print("    BuildSignal():                 " + AIRail.BuildSignal(10002, 10258, AIRail.SIGNALTYPE_PBS));
 
	print("    RemoveRailTrack():             " + AIRail.RemoveRailTrack(10002, AIRail.RAILTRACK_NW_NE));
 
	print("    RemoveRailTrack():             " + AIRail.RemoveRailTrack(10002, AIRail.RAILTRACK_NW_SE));
 
	print("    BuildRail():                   " + AIRail.BuildRail(10002, 10003, 10006));
 
	print("    HasTransportType():            " + AITile.HasTransportType(10005, AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(10006, AITile.TRANSPORT_RAIL));
 
	print("    RemoveRail():                  " + AIRail.RemoveRail(10006, 10005, 10002));
 
	print("    HasTransportType():            " + AITile.HasTransportType(10004, AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(10005, AITile.TRANSPORT_RAIL));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(6200, AIRail.RAILTRACK_NE_SW));
 
	print("    RemoveRailTrack():             " + AIRail.RemoveRailTrack(6200, AIRail.RAILTRACK_NW_NE));
 
	print("    RemoveRailTrack():             " + AIRail.RemoveRailTrack(6200, AIRail.RAILTRACK_NE_SW));
 
	print("    BuildRail():                   " + AIRail.BuildRail(6200, 6200 + 256, 6200 + (256 * 4)));
 
	print("    HasTransportType():            " + AITile.HasTransportType(6200 + (256 * 3), AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(6200 + (256 * 4), AITile.TRANSPORT_RAIL));
 
	print("    RemoveRail():                  " + AIRail.RemoveRail(6200 + (256 * 3), 6200 + (256 * 2), 6200 - 256));
 
	print("    HasTransportType():            " + AITile.HasTransportType(6200 + (256 * 3), AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(6200 + (256 * 4), AITile.TRANSPORT_RAIL));
 
	print("    BuildRailTrack():              " + AIRail.BuildRail(14706, 14705, 12907));
 
	print("    HasTransportType():            " + AITile.HasTransportType(13421, AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(14191, AITile.TRANSPORT_RAIL));
 
	print("    RemoveRail():                  " + AIRail.RemoveRail(12907, 13163, 14706));
 
	print("    HasTransportType():            " + AITile.HasTransportType(13421, AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(14191, AITile.TRANSPORT_RAIL));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_NW_SW));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_NE_SE));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_NW_NE));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_SW_SE));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_NE_SW));
 
	print("    DemolishTile():                " + AITile.DemolishTile(61533));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_NE_SW));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_NW_SE));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_NW_NE));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_SW_SE));
 
	print("    DemolishTile():                " + AITile.DemolishTile(61533));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(61533, AIRail.RAILTRACK_NW_SE));
 

	
 
	print("  Depot");
 
	print("    IsRailTile():                  " + AIRail.IsRailTile(33411));
 
	print("    BuildRailDepot():              " + AIRail.BuildRailDepot(0, 1));
 
	print("    BuildRailDepot():              " + AIRail.BuildRailDepot(33411, 33411));
 
	print("    BuildRailDepot():              " + AIRail.BuildRailDepot(33411, 33414));
 
	print("    BuildRailDepot():              " + AIRail.BuildRailDepot(33411, 33412));
 
	print("    GetRailDepotFrontTile():       " + AIRail.GetRailDepotFrontTile(33411));
 
	print("    IsBuildable():                 " + AITile.IsBuildable(33411));
 
	local list = AIDepotList(AITile.TRANSPORT_RAIL);
 
	print("    DepotList");
 
	print("      Count():                     " + list.Count());
 
	list.Valuate(AITile.GetDistanceManhattanToTile, 0);
 
	print("      Depot distance from (0,0) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("        " + i + " => " + list.GetValue(i));
 
	}
 
	print("    RemoveDepot():                 " + AITile.DemolishTile(33411));
 
	print("    BuildRailDepot():              " + AIRail.BuildRailDepot(23596, 23597));
 

	
 
	print("  Station");
 
	print("    BuildRailStation():            " + AIRail.BuildRailStation(0, AIRail.RAILTRACK_NE_SW, 1, 1, AIStation.STATION_NEW));
 
	print("    BuildRailStation():            " + AIRail.BuildRailStation(7958, AIRail.RAILTRACK_NE_SW, 4, 5, AIStation.STATION_NEW));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7957));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7958));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7959));
 
	print("    RemoveRailStationTileRectangle():" + AIRail.RemoveRailStationTileRectangle(7959, 7959, false));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7957));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7958));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7959));
 
	print("    DemolishTile():                " + AITile.DemolishTile(7960));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7957));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7958));
 
	print("    IsRailStationTile():           " + AIRail.IsRailStationTile(7959));
 

	
 
	print("  Waypoint");
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(12646, AIRail.RAILTRACK_NW_SE));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(12648, AIRail.RAILTRACK_NE_SW));
 
	print("    BuildRailTrack():              " + AIRail.BuildRailTrack(12650, AIRail.RAILTRACK_NW_NE));
 
	print("    BuildRailWaypoint():           " + AIRail.BuildRailWaypoint(12644));
 
	print("    BuildRailWaypoint():           " + AIRail.BuildRailWaypoint(12646));
 
	print("    BuildRailWaypoint():           " + AIRail.BuildRailWaypoint(12648));
 
	print("    BuildRailWaypoint():           " + AIRail.BuildRailWaypoint(12650));
 
	print("    IsRailWaypointTile():          " + AIRail.IsRailWaypointTile(12644));
 
	print("    IsRailWaypointTile():          " + AIRail.IsRailWaypointTile(12646));
 
	print("    IsRailWaypointTile():          " + AIRail.IsRailWaypointTile(12648));
 
	print("    IsRailWaypointTile():          " + AIRail.IsRailWaypointTile(12650));
 
	print("    RemoveRailWaypointTileRectangle():" + AIRail.RemoveRailWaypointTileRectangle(12644, 12646, false));
 
	print("    RemoveRailWaypointTileRectangle():" + AIRail.RemoveRailWaypointTileRectangle(12648, 12650, true));
 
	print("    IsRailWaypointTile():          " + AIRail.IsRailWaypointTile(12644));
 
	print("    IsRailWaypointTile():          " + AIRail.IsRailWaypointTile(12646));
 
	print("    IsRailWaypointTile():          " + AIRail.IsRailWaypointTile(12648));
 
	print("    IsRailWaypointTile():          " + AIRail.IsRailWaypointTile(12650));
 
	print("    HasTransportType():            " + AITile.HasTransportType(12644, AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(12646, AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(12648, AITile.TRANSPORT_RAIL));
 
	print("    HasTransportType():            " + AITile.HasTransportType(12650, AITile.TRANSPORT_RAIL));
 
	print("    DemolishTile():                " + AITile.DemolishTile(12648));
 
	print("    DemolishTile():                " + AITile.DemolishTile(12650));
 
}
 

	
 
function Regression::Road()
 
{
 
	print("");
 
	print("--Road--");
 
	print("  Road");
 
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
 
	print("    BuildRoad():                   " + AIRoad.BuildRoad(0, 1));
 
	print("    BuildRoad():                   " + AIRoad.BuildRoad(33411, 33411));
 
	print("    HasTransportType():            " + AITile.HasTransportType(33413, AITile.TRANSPORT_ROAD));
 
	print("    BuildRoad():                   " + AIRoad.BuildRoad(33411, 33414));
 
	print("    HasTransportType():            " + AITile.HasTransportType(33413, AITile.TRANSPORT_ROAD));
 
	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33412, 33413));
 
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
 
	print("    HasRoadType(Road):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));
 
	print("    HasRoadType(Tram):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM));
 
	print("    GetNeighbourRoadCount():       " + AIRoad.GetNeighbourRoadCount(33412));
 
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(33411, 33411));
 
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(33411, 33412));
 
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(19590, 19590));
 
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(33411, 33414));
 
	print("    BuildOneWayRoad():             " + AIRoad.BuildOneWayRoad(33411, 33414));
 
	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33412, 33413));
 
	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33413, 33412));
 
	print("    BuildOneWayRoad():             " + AIRoad.BuildOneWayRoad(33413, 33412));
 
	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33412, 33413));
 
	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33413, 33412));
 
	print("    BuildOneWayRoad():             " + AIRoad.BuildOneWayRoad(33412, 33413));
 
	print("    BuildOneWayRoad():             " + AIRoad.BuildOneWayRoad(33413, 33412));
 
	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33412, 33413));
 
	print("    AreRoadTilesConnected():       " + AIRoad.AreRoadTilesConnected(33413, 33412));
 
	print("    RemoveRoad():                  " + AIRoad.RemoveRoad(33411, 33412));
 
	print("    IsRoadTypeAvailable(Road):     " + AIRoad.IsRoadTypeAvailable(AIRoad.ROADTYPE_ROAD));
 
	print("    IsRoadTypeAvailable(Tram):     " + AIRoad.IsRoadTypeAvailable(AIRoad.ROADTYPE_TRAM));
 
	print("    SetCurrentRoadType(Tram):      " + AIRoad.SetCurrentRoadType(AIRoad.ROADTYPE_TRAM));
 
	print("    GetCurrentRoadType():          " + AIRoad.GetCurrentRoadType());
 

	
 
	print("  Depot");
 
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
 
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(0, 1));
 
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33411));
 
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33414));
 
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33411, 33412));
 
	print("    HasRoadType(Road):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));
 
	print("    HasRoadType(Tram):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM));
 
	print("    GetLastError():                " + AIError.GetLastError());
 
	print("    GetLastErrorString():          " + AIError.GetLastErrorString());
 
	print("    GetErrorCategory():            " + AIError.GetErrorCategory());
 
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
 
	print("    GetRoadDepotFrontTile():       " + AIRoad.GetRoadDepotFrontTile(33411));
 
	print("    IsRoadDepotTile():             " + AIRoad.IsRoadDepotTile(33411));
 
	print("    IsBuildable():                 " + AITile.IsBuildable(33411));
 
	local list = AIDepotList(AITile.TRANSPORT_ROAD);
 
	print("    DepotList");
 
	print("      Count():                     " + list.Count());
 
	list.Valuate(AITile.GetDistanceManhattanToTile, 0);
 
	print("      Depot distance from (0,0) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("        " + i + " => " + list.GetValue(i));
 
	}
 
	print("    RemoveRoadDepot():             " + AIRoad.RemoveRoadDepot(33411));
 
	print("    RemoveRoadDepot():             " + AIRoad.RemoveRoadDepot(33411));
 

	
 
	print("  Station");
 
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
 
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(0, 1, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33411, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33414, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildRoadStation():            " + AIRoad.BuildRoadStation(33411, 33412, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_JOIN_ADJACENT));
 
	print("    IsStationTile():               " + AITile.IsStationTile(33411));
 
	print("    IsStationTile():               " + AITile.IsStationTile(33412));
 
	print("    HasRoadType(Road):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));
 
	print("    HasRoadType(Tram):             " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM));
 
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33411));
 
	print("    GetDriveThroughBackTile():     " + AIRoad.GetDriveThroughBackTile(33411));
 
	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33411));
 
	print("    IsRoadStationTile():           " + AIRoad.IsRoadStationTile(33411));
 
	print("    IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33411));
 
	print("    RemoveRoadStation():           " + AIRoad.RemoveRoadStation(33411));
 
	print("    RemoveRoadStation():           " + AIRoad.RemoveRoadStation(33411));
 

	
 
	print("  Station Types");
 
	print("    BuildRoadStation(bus):         " + AIRoad.BuildRoadStation(33411, 33410, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33421, 33422, AIRoad.ROADVEHTYPE_TRUCK, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33412, 33413, AIRoad.ROADVEHTYPE_TRUCK, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildRoadStation(bus):         " + AIRoad.BuildRoadStation(33411 + 256, 33411, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildRoadStation(truck):       " + AIRoad.BuildRoadStation(33412 + 256, 33412 + 256 + 256, AIRoad.ROADVEHTYPE_TRUCK, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildDriveThroughRoadStation(bus-drive):   " + AIRoad.BuildDriveThroughRoadStation(33413, 33412, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildDriveThroughRoadStation(truck-drive): " + AIRoad.BuildDriveThroughRoadStation(33414, 33413, AIRoad.ROADVEHTYPE_TRUCK, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildDriveThroughRoadStation(bus-drive):   " + AIRoad.BuildDriveThroughRoadStation(33415, 33414, AIRoad.ROADVEHTYPE_BUS, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildDriveThroughRoadStation(truck-drive): " + AIRoad.BuildDriveThroughRoadStation(33416, 33415, AIRoad.ROADVEHTYPE_TRUCK, AIStation.STATION_JOIN_ADJACENT));
 
	print("    BuildRoadDepot():              " + AIRoad.BuildRoadDepot(33417, 33418));
 
	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33411 + 256));
 
	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33412 + 256));
 
	print("    IsDriveThroughRoadStationTile: " + AIRoad.IsDriveThroughRoadStationTile(33415));
 
	print("    IsBuildable():                 " + AITile.IsBuildable(33415));
 
	print("    GetDriveThroughBackTile():     " + AIRoad.GetDriveThroughBackTile(33415));
 
	print("    GetRoadStationFrontTile():     " + AIRoad.GetRoadStationFrontTile(33415));
 
	print("    IsRoadTile():                  " + AIRoad.IsRoadTile(33415));
 
}
 

	
 
function Regression::Sign()
 
{
 
	local j = 0;
 

	
 
	print("");
 
	print("--Sign--");
 
	print("  BuildSign(33410, 'Some Sign'):       " + AISign.BuildSign(33410, "Some Sign"));
 
	print("  BuildSign(33411, 'Test'):            " + AISign.BuildSign(33411, "Test"));
 
	print("  SetName(1, 'Test2'):                 " + AISign.SetName(1, "Test2"));
 
	local sign_id = AISign.BuildSign(33409, "Some other Sign");
 
	print("  BuildSign(33409, 'Some other Sign'): " + sign_id);
 
	print("  RemoveSign(" + sign_id + "):                       " + AISign.RemoveSign(sign_id));
 
	print("");
 
	local list = AISignList();
 
	list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		j++;
 
		print("  Sign " + i);
 
		print("    IsValidSign():   " + AISign.IsValidSign(i));
 
		print("    GetName():       " + AISign.GetName(i));
 
		print("    GetLocation():   " + AISign.GetLocation(i));
 
	}
 
	print("  Valid Signs:       " + j);
 
}
 

	
 
function Regression::Station()
 
{
 
	print("");
 
	print("--Station--");
 
	print("  IsValidStation(0):        " + AIStation.IsValidStation(0));
 
	print("  IsValidStation(1000):     " + AIStation.IsValidStation(1000));
 
	print("  GetName(0):               " + AIStation.GetName(0));
 
	print("  SetName(0):               " + AIStation.SetName(0, "Look, a station"));
 
	print("  GetName(0):               " + AIStation.GetName(0));
 
	print("  GetLocation(1):           " + AIStation.GetLocation(1));
 
	print("  GetLocation(1000):        " + AIStation.GetLocation(1000));
 
	print("  GetStationID(33411):      " + AIStation.GetStationID(33411));
 
	print("  GetStationID(34411):      " + AIStation.GetStationID(34411));
 
	print("  GetStationID(33411):      " + AIStation.GetStationID(33411));
 
	print("  HasRoadType(3, TRAM):     " + AIStation.HasRoadType(3, AIRoad.ROADTYPE_TRAM));
 
	print("  HasRoadType(3, ROAD):     " + AIStation.HasRoadType(3, AIRoad.ROADTYPE_ROAD));
 
	print("  HasRoadType(33411, TRAM): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_TRAM));
 
	print("  HasRoadType(33411, ROAD): " + AIRoad.HasRoadType(33411, AIRoad.ROADTYPE_ROAD));
 
	print("  HasStationType(3, BUS):   " + AIStation.HasStationType(3, AIStation.STATION_BUS_STOP));
 
	print("  HasStationType(3, TRAIN): " + AIStation.HasStationType(3, AIStation.STATION_TRAIN));
 

	
 
	print("  GetCoverageRadius(BUS):   " + AIStation.GetCoverageRadius(AIStation.STATION_BUS_STOP));
 
	print("  GetCoverageRadius(TRUCK): " + AIStation.GetCoverageRadius(AIStation.STATION_TRUCK_STOP));
 
	print("  GetCoverageRadius(TRAIN): " + AIStation.GetCoverageRadius(AIStation.STATION_TRAIN));
 

	
 
	print("  GetNearestTown():         " + AIStation.GetNearestTown(0));
 
	print("  GetNearestTown():         " + AIStation.GetNearestTown(10000));
 
	print("  GetNearestTown():         " + AIStation.GetNearestTown(3));
 

	
 
	print("");
 
	print("--CargoWaiting--");
 
	for (local cargo = 0; cargo <= 1000; cargo += 1000) {
 
		for (local station0 = 0; station0 <= 1000; station0 += 1000) {
 
			print("  GetCargoWaiting(" + station0 + ", " + cargo + "): " +
 
					AIStation.GetCargoWaiting(station0, cargo));
 
			for (local station1 = 0; station1 <= 1000; station1 += 1000) {
 
				print("  GetCargoWaitingFrom(" + station0 + ", " + station1 + ", " + cargo + "): " +
 
						AIStation.GetCargoWaitingFrom(station0, station1, cargo));
 
				print("  GetCargoWaitingVia(" + station0 + ", " + station1 + ", " + cargo + "): " +
 
						AIStation.GetCargoWaitingFrom(station0, station1, cargo));
 
				for (local station2 = 0; station2 <= 1000; station2 += 1000) {
 
					print("  GetCargoWaitingFromVia(" + station0 + ", " + station1 + ", " + station2 + ", " + cargo + "): " +
 
							AIStation.GetCargoWaitingFromVia(station0, station1, station2, cargo));
 
				}
 
			}
 
		}
 
	}
 

	
 
	print("");
 
	print("--CargoPlanned--");
 
	for (local cargo = 0; cargo <= 1000; cargo += 1000) {
 
		for (local station0 = 0; station0 <= 1000; station0 += 1000) {
 
			print("  GetCargoPlanned(" + station0 + ", " + cargo + "): " +
 
					AIStation.GetCargoPlanned(station0, cargo));
 
			for (local station1 = 0; station1 <= 1000; station1 += 1000) {
 
				print("  GetCargoPlannedFrom(" + station0 + ", " + station1 + ", " + cargo + "): " +
 
						AIStation.GetCargoPlannedFrom(station0, station1, cargo));
 
				print("  GetCargoPlannedVia(" + station0 + ", " + station1 + ", " + cargo + "): " +
 
						AIStation.GetCargoPlannedFrom(station0, station1, cargo));
 
				for (local station2 = 0; station2 <= 1000; station2 += 1000) {
 
					print("  GetCargoPlannedFromVia(" + station0 + ", " + station1 + ", " + station2 + ", " + cargo + "): " +
 
							AIStation.GetCargoPlannedFromVia(station0, station1, station2, cargo));
 
				}
 
			}
 
		}
 
	}
 
}
 

	
 
function Regression::Tile()
 
{
 
	print("");
 
	print("--Tile--");
 
	print("  HasTreeOnTile():      " + AITile.HasTreeOnTile(33148));
 
	print("  IsFarmTile():         " + AITile.IsFarmTile(32892));
 
	print("  IsRockTile():         " + AITile.IsRockTile(31606));
 
	print("  IsRoughTile():        " + AITile.IsRoughTile(33674));
 
	print("  HasTreeOnTile():      " + AITile.HasTreeOnTile(33404));
 
	print("  IsFarmTile():         " + AITile.IsFarmTile(33404));
 
	print("  IsRockTile():         " + AITile.IsRockTile(33404));
 
	print("  IsRoughTile():        " + AITile.IsRoughTile(33404));
 
	print("  IsSnowTile():         " + AITile.IsSnowTile(33404));
 
	print("  IsDesertTile():       " + AITile.IsDesertTile(33404));
 
	print("  PlantTree():          " + AITile.PlantTree(33404));
 
	print("  HasTreeOnTile():      " + AITile.HasTreeOnTile(33404));
 
	print("  PlantTree():          " + AITile.PlantTree(33404));
 
	print("  HasTreeOnTile():      " + AITile.HasTreeOnTile(33661));
 
	print("  PlantTreeRectangle(): " + AITile.PlantTreeRectangle(33404, 2, 2));
 
	print("  HasTreeOnTile():      " + AITile.HasTreeOnTile(33661));
 
}
 

	
 
function Regression::TileList()
 
{
 
	local list = AITileList();
 

	
 
	print("");
 
	print("--TileList--");
 
	print("  Count():             " + list.Count());
 
	list.AddRectangle(27631 - 256 * 1, 256 * 1 + 27631 + 2);
 
	print("  Count():             " + list.Count());
 

	
 
	list.Valuate(AITile.GetSlope);
 
	print("  Slope():             done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
		print("    " + i + " => " + AITile.GetComplementSlope(list.GetValue(i)));
 
		print("    " + i + " => " + AITile.IsSteepSlope(list.GetValue(i)));
 
		print("    " + i + " => " + AITile.IsHalftileSlope(list.GetValue(i)));
 
	}
 
	list.Clear();
 

	
 
	print("");
 
	print("--TileList--");
 
	print("  Count():             " + list.Count());
 
	list.AddRectangle(34436, 256 * 2 + 34436 + 8);
 
	print("  Count():             " + list.Count());
 

	
 
	list.Valuate(AITile.GetCornerHeight, AITile.CORNER_N);
 
	print("  Height():            done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.GetCornerHeight, AITile.CORNER_N);
 
	print("  CornerHeight(North): done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.GetMinHeight);
 
	print("  MinHeight():         done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.GetMaxHeight);
 
	print("  MaxHeight():         done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.GetSlope);
 
	list.KeepValue(0);
 
	print("  Slope():             done");
 
	print("  KeepValue(0):        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Clear();
 
	list.AddRectangle(41895 - 256 * 2, 256 * 2 + 41895 + 8);
 
	list.Valuate(AITile.IsBuildable);
 
	list.KeepValue(1);
 
	print("  Buildable():         done");
 
	print("  KeepValue(1):        done");
 
	print("  Count():             " + list.Count());
 

	
 
	list.Valuate(AITile.IsBuildableRectangle, 3, 3);
 
	print("  BuildableRectangle(3, 3) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITile.GetDistanceManhattanToTile, 30000);
 
	print("  DistanceManhattanToTile(30000) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITile.GetDistanceSquareToTile, 30000);
 
	print("  DistanceSquareToTile(30000) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.AddRectangle(31895 - 256 * 5, 256 * 5 + 31895 + 8);
 

	
 
	list.Valuate(AITile.GetOwner);
 
	print("  GetOwner() ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITile.GetTownAuthority);
 
	print("  GetTownAuthority() ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITile.GetClosestTown);
 
	print("  GetClosestTown() ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.GetCargoAcceptance, 0, 1, 1, 3);
 
	list.KeepAboveValue(10);
 
	print("  CargoAcceptance():   done");
 
	print("  KeepAboveValue(10):  done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AIRoad.IsRoadTile);
 
	list.KeepValue(1);
 
	print("  RoadTile():          done");
 
	print("  KeepValue(1):        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AIRoad.GetNeighbourRoadCount);
 
	list.KeepValue(1);
 
	print("  NeighbourRoadCount():done");
 
	print("  KeepValue(1):        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.AddRectangle(0x6F3F, 0x7248);
 
	list.Valuate(AITile.IsWaterTile);
 
	print("  IsWaterTile():       done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.IsSeaTile);
 
	print("  IsSeaTile():         done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.IsRiverTile);
 
	print("  IsRiverTile()        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AIMarine.IsCanalTile);
 
	print("  IsCanalTile()        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list.Valuate(AITile.IsCoastTile);
 
	print("  IsCoastTile()        done");
 
	print("  Count():             " + list.Count());
 
	print("  ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AITileList_IndustryAccepting(0, 3);
 
	print("");
 
	print("--TileList_IndustryAccepting--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AITile.GetCargoAcceptance, 3, 1, 1, 3);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AITileList_IndustryProducing(1, 3);
 
	print("");
 
	print("--TileList_IndustryProducing--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AITile.GetCargoProduction, 7, 1, 1, 3);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	list = AITileList_StationType(6, AIStation.STATION_BUS_STOP);
 
	print("");
 
	print("--TileList_StationType--");
 
	print("  Count():             " + list.Count());
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
}
 

	
 
function Regression::Town()
 
{
 
	local j = 0;
 

	
 
	print("");
 
	print("--Town--");
 
	print("  GetTownCount():    " + AITown.GetTownCount());
 
	local list = AITownList();
 
	list.Sort(AIList.SORT_BY_ITEM, AIList.SORT_ASCENDING);
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		if (AITown.IsValidTown(i)) j++;
 
		print("  Town " + i);
 
		print("    IsValidTown():   " + AITown.IsValidTown(i));
 
		print("    GetName():       " + AITown.GetName(i));
 
		print("    GetPopulation(): " + AITown.GetPopulation(i));
 
		print("    GetLocation():   " + AITown.GetLocation(i));
 
		print("    GetHouseCount(): " + AITown.GetHouseCount(i));
 
		print("    GetRating():     " + AITown.GetRating(i, AICompany.COMPANY_SELF));
 
		print("    IsCity():        " + AITown.IsCity(i));
 
	}
 
	print("  Valid Towns:       " + j);
 
	print("  GetTownCount():    " + AITown.GetTownCount());
 
}
 

	
 
function Regression::TownList()
 
{
 
	local list = AITownList();
 

	
 
	print("");
 
	print("--TownList--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AITown.GetLocation);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITown.GetDistanceManhattanToTile, 30000);
 
	print("  DistanceManhattanToTile(30000) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITown.GetDistanceSquareToTile, 30000);
 
	print("  DistanceSquareToTile(30000) ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITown.IsWithinTownInfluence, AITown.GetLocation(0));
 
	print("  IsWithinTownInfluence(" + AITown.GetLocation(0) + ") ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITown.GetAllowedNoise);
 
	print("  GetAllowedNoise() ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AITown.GetPopulation);
 
	list.KeepAboveValue(500);
 
	print("  KeepAboveValue(500): done");
 
	print("  Count():             " + list.Count());
 
	print("  Population ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 

	
 
	print("  HasStatue():                     " + AITown.HasStatue(list.Begin()));
 
	print("  GetRoadReworkDuration():         " + AITown.GetRoadReworkDuration(list.Begin()));
 
	print("  GetExclusiveRightsCompany():     " + AITown.GetExclusiveRightsCompany(list.Begin()));
 
	print("  GetExclusiveRightsDuration():    " + AITown.GetExclusiveRightsDuration(list.Begin()));
 
	print("  IsActionAvailable(BUILD_STATUE): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
 
	print("  PerformTownAction(BUILD_STATUE): " + AITown.PerformTownAction(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
 
	print("  IsActionAvailable(BUILD_STATUE): " + AITown.IsActionAvailable(list.Begin(), AITown.TOWN_ACTION_BUILD_STATUE));
 
	print("  HasStatue():                     " + AITown.HasStatue(list.Begin()));
 
}
 

	
 
function Regression::Tunnel()
 
{
 
	print("");
 
	print("--Tunnel--");
 
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(29050));
 
	print("  RemoveTunnel():       " + AITunnel.RemoveTunnel(29050));
 
	print("  GetOtherTunnelEnd():  " + AITunnel.GetOtherTunnelEnd(29050));
 
	print("  BuildTunnel():        " + AITunnel.BuildTunnel(AIVehicle.VT_ROAD, 29050));
 
	print("  GetOtherTunnelEnd():  " + AITunnel.GetOtherTunnelEnd(29050));
 
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(29050));
 
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(28026));
 
	print("  RemoveTunnel():       " + AITunnel.RemoveTunnel(29050));
 
	print("  IsTunnelTile():       " + AITunnel.IsTunnelTile(29050));
 

	
 
	print("  --Errors--");
 
	print("  BuildTunnel():        " + AITunnel.BuildTunnel(AIVehicle.VT_ROAD, 7529));
 
	print("  BuildTunnel():        " + AITunnel.BuildTunnel(AIVehicle.VT_ROAD, 8043));
 
	print("  GetLastErrorString(): " + AIError.GetLastErrorString());
 
	print("  RemoveTunnel():       " + AITunnel.RemoveTunnel(7529));
 
}
 

	
 
function Regression::Vehicle()
 
{
 
	local accounting = AIAccounting();
 

	
 
	print("");
 
	print("--Vehicle--");
 
	print("  IsValidVehicle(-1):   " + AIVehicle.IsValidVehicle(-1));
 
	print("  IsValidVehicle(0):    " + AIVehicle.IsValidVehicle(0));
 
	print("  IsValidVehicle(12):   " + AIVehicle.IsValidVehicle(12));
 
	print("  ISValidVehicle(9999): " + AIVehicle.IsValidVehicle(9999));
 

	
 
	local bank = AICompany.GetBankBalance(AICompany.COMPANY_SELF);
 

	
 
	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(33417, 153));
 
	print("  IsValidVehicle(12):   " + AIVehicle.IsValidVehicle(12));
 
	print("  CloneVehicle():       " + AIVehicle.CloneVehicle(33417, 12, true));
 

	
 
	local bank_after = AICompany.GetBankBalance(AICompany.COMPANY_SELF);
 

	
 
	print("  --Accounting--");
 
	print("    GetCosts():         " + accounting.GetCosts());
 
	print("    Should be:          " + (bank - bank_after));
 
	print("    ResetCosts():       " + accounting.ResetCosts());
 

	
 
	bank = AICompany.GetBankBalance(AICompany.COMPANY_SELF);
 

	
 
	print("  SellVehicle(13):      " + AIVehicle.SellVehicle(13));
 
	print("  IsInDepot():          " + AIVehicle.IsInDepot(12));
 
	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(12));
 
	print("  StartStopVehicle():   " + AIVehicle.StartStopVehicle(12));
 
	print("  IsInDepot():          " + AIVehicle.IsInDepot(12));
 
	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(12));
 
	print("  SendVehicleToDepot(): " + AIVehicle.SendVehicleToDepot(12));
 
	print("  IsInDepot():          " + AIVehicle.IsInDepot(12));
 
	print("  IsStoppedInDepot():   " + AIVehicle.IsStoppedInDepot(12));
 

	
 
	bank_after = AICompany.GetBankBalance(AICompany.COMPANY_SELF);
 

	
 
	print("  --Accounting--");
 
	print("    GetCosts():         " + accounting.GetCosts());
 
	print("    Should be:          " + (bank - bank_after));
 

	
 
	print("  GetName():            " + AIVehicle.GetName(12));
 
	print("  SetName():            " + AIVehicle.SetName(12, "MyVehicleName"));
 
	print("  GetName():            " + AIVehicle.GetName(12));
 
	print("  CloneVehicle():       " + AIVehicle.CloneVehicle(33417, 12, true));
 

	
 
	print("  --VehicleData--");
 
	print("    GetLocation():       " + AIVehicle.GetLocation(12));
 
	print("    GetEngineType():     " + AIVehicle.GetEngineType(12));
 
	print("    GetUnitNumber():     " + AIVehicle.GetUnitNumber(12));
 
	print("    GetAge():            " + AIVehicle.GetAge(12));
 
	print("    GetMaxAge():         " + AIVehicle.GetMaxAge(12));
 
	print("    GetAgeLeft():        " + AIVehicle.GetAgeLeft(12));
 
	print("    GetCurrentSpeed():   " + AIVehicle.GetCurrentSpeed(12));
 
	print("    GetRunningCost():    " + AIVehicle.GetRunningCost(12));
 
	print("    GetProfitThisYear(): " + AIVehicle.GetProfitThisYear(12));
 
	print("    GetProfitLastYear(): " + AIVehicle.GetProfitLastYear(12));
 
	print("    GetCurrentValue():   " + AIVehicle.GetCurrentValue(12));
 
	print("    GetVehicleType():    " + AIVehicle.GetVehicleType(12));
 
	print("    GetRoadType():       " + AIVehicle.GetRoadType(12));
 
	print("    GetCapacity():       " + AIVehicle.GetCapacity(12, 10));
 
	print("    GetCargoLoad():      " + AIVehicle.GetCargoLoad(12, 10));
 
	print("    IsInDepot():         " + AIVehicle.IsInDepot(12));
 
	print("    GetNumWagons():      " + AIVehicle.GetNumWagons(12));
 
	print("    GetWagonEngineType(): " + AIVehicle.GetWagonEngineType(12, 0));
 
	print("    GetWagonAge():       " + AIVehicle.GetWagonAge(12, 0));
 
	print("    GetLength():         " + AIVehicle.GetLength(12));
 

	
 
	print("  GetOwner():           " + AITile.GetOwner(32119));
 
	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(32119, 219));
 
	print("  IsValidVehicle(14):   " + AIVehicle.IsValidVehicle(14));
 
	print("  IsInDepot(14):        " + AIVehicle.IsInDepot(14));
 
	print("  IsStoppedInDepot(14): " + AIVehicle.IsStoppedInDepot(14));
 
	print("  IsValidVehicle(15):   " + AIVehicle.IsValidVehicle(15));
 
	print("  IsInDepot(15):        " + AIVehicle.IsInDepot(15));
 
	print("  IsStoppedInDepot(15): " + AIVehicle.IsStoppedInDepot(15));
 

	
 
	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(28479, 204));
 
	print("  IsValidVehicle(16):   " + AIVehicle.IsValidVehicle(16));
 
	print("  IsInDepot(16):        " + AIVehicle.IsInDepot(16));
 
	print("  IsStoppedInDepot(16): " + AIVehicle.IsStoppedInDepot(16));
 

	
 
	print("  BuildRailDepot():     " + AIRail.BuildRailDepot(10008, 10000));
 
	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(10008, 9));
 
	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(10008, 27));
 
	print("  BuildVehicle():       " + AIVehicle.BuildVehicle(10008, 27));
 
	print("  IsValidVehicle(17):   " + AIVehicle.IsValidVehicle(17));
 
	print("  IsValidVehicle(18):   " + AIVehicle.IsValidVehicle(18));
 
	print("  IsValidVehicle(19):   " + AIVehicle.IsValidVehicle(19)); // 19 is immediately joined to 18
 
	print("  MoveWagonChain():     " + AIVehicle.MoveWagonChain(18, 0, 17, 0));
 
	print("  GetNumWagons():       " + AIVehicle.GetNumWagons(17));
 
	print("  GetLength():          " + AIVehicle.GetLength(17));
 
	print("  GetWagonEngineType(): " + AIVehicle.GetWagonEngineType(17, 0));
 
	print("  GetWagonAge():        " + AIVehicle.GetWagonAge(17, 0));
 
	print("  GetWagonEngineType(): " + AIVehicle.GetWagonEngineType(17, 1));
 
	print("  GetWagonAge():        " + AIVehicle.GetWagonAge(17, 1));
 
	print("  GetWagonEngineType(): " + AIVehicle.GetWagonEngineType(17 2));
 
	print("  GetWagonAge():        " + AIVehicle.GetWagonAge(17, 2));
 
	print("  GetWagonEngineType(): " + AIVehicle.GetWagonEngineType(17 3));
 
	print("  GetWagonAge():        " + AIVehicle.GetWagonAge(17, 3));
 

	
 
	print("  --Refit--");
 
	print("    GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 255));
 
	print("    GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 0));
 
	print("    GetBuildWithRefitCapacity(): " + AIVehicle.GetBuildWithRefitCapacity(28479, 211, 9));
 
	print("    BuildVehicleWithRefit():     " + AIVehicle.BuildVehicleWithRefit(28479, 211, 9));
 
	print("    GetCapacity():               " + AIVehicle.GetCapacity(20, 9));
 
	print("    GetCapacity():               " + AIVehicle.GetCapacity(20, 5));
 
	print("    GetRefitCapacity():          " + AIVehicle.GetRefitCapacity(20, 5));
 
	print("    RefitVehicle():              " + AIVehicle.RefitVehicle(20, 5));
 
	print("    GetCapacity():               " + AIVehicle.GetCapacity(20, 9));
 
	print("    GetCapacity():               " + AIVehicle.GetCapacity(20, 5));
 
	print("    SellVehicle():               " + AIVehicle.SellVehicle(20));
 

	
 
	print("  --Errors--");
 
	print("    RefitVehicle():        " + AIVehicle.RefitVehicle(12, 0));
 
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
 
	print("    SellVehicle():         " + AIVehicle.SellVehicle(12));
 
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
 
	print("    SendVehicleToDepot():  " + AIVehicle.SendVehicleToDepot(13));
 
	print("    GetLastErrorString():  " + AIError.GetLastErrorString());
 

	
 
	local list = AIVehicleList();
 

	
 
	print("");
 
	print("--VehicleList--");
 
	print("  Count():             " + list.Count());
 
	list.Valuate(AIVehicle.GetLocation);
 
	print("  Location ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetEngineType);
 
	print("  EngineType ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetUnitNumber);
 
	print("  UnitNumber ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetAge);
 
	print("  Age ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetMaxAge);
 
	print("  MaxAge ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetAgeLeft);
 
	print("  AgeLeft ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetCurrentSpeed);
 
	print("  CurrentSpeed ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetRunningCost);
 
	print("  RunningCost ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetProfitThisYear);
 
	print("  ProfitThisYear ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetProfitLastYear);
 
	print("  ProfitLastYear ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetCurrentValue);
 
	print("  CurrentValue ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetVehicleType);
 
	print("  VehicleType ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetRoadType);
 
	print("  RoadType ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetCapacity, 10);
 
	print("  VehicleType ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
	list.Valuate(AIVehicle.GetCargoLoad, 10);
 
	print("  VehicleType ListDump:");
 
	for (local i = list.Begin(); !list.IsEnd(); i = list.Next()) {
 
		print("    " + i + " => " + list.GetValue(i));
 
	}
 
}
 

	
 
function Regression::PrintSubsidy(subsidy_id)
 
{
 
	print("      --Subsidy (" + subsidy_id + ") --");
 
	print("        IsValidSubsidy():      " + AISubsidy.IsValidSubsidy(subsidy_id));
 
	print("        IsAwarded():           " + AISubsidy.IsAwarded(subsidy_id));
 
	print("        GetAwardedTo():        " + AISubsidy.GetAwardedTo(subsidy_id));
 
	print("        GetExpireDate():       " + AISubsidy.GetExpireDate(subsidy_id));
 
	print("        GetSourceType():       " + AISubsidy.GetSourceType(subsidy_id));
 
	print("        GetSourceIndex():      " + AISubsidy.GetSourceIndex(subsidy_id));
 
	print("        GetDestinationType():  " + AISubsidy.GetDestinationType(subsidy_id));
 
	print("        GetDestinationIndex(): " + AISubsidy.GetDestinationIndex(subsidy_id));
 
	print("        GetCargoType():        " + AISubsidy.GetCargoType(subsidy_id));
 
}
 

	
 
function Regression::Math()
 
{
 
	print("");
 
	print("--Math--");
 
	print("  -2147483648 < -2147483647:   " + (-2147483648 < -2147483647));
 
	print("  -2147483648 < -1         :   " + (-2147483648 < -1         ));
 
	print("  -2147483648 <  0         :   " + (-2147483648 <  0         ));
 
	print("  -2147483648 <  1         :   " + (-2147483648 <  1         ));
 
	print("  -2147483648 <  2147483647:   " + (-2147483648 <  2147483647));
 

	
 
	print("  -2147483647 < -2147483648:   " + (-2147483647 < -2147483648));
 
	print("  -1          < -2147483648:   " + (-1          < -2147483648));
 
	print("   0          < -2147483648:   " + ( 0          < -2147483648));
 
	print("   1          < -2147483648:   " + ( 1          < -2147483648));
 
	print("   2147483647 < -2147483648:   " + ( 2147483647 < -2147483648));
 

	
 
	print("  -1          >  2147483647:   " + (-1          >  2147483647));
 
	print("  -1          >  1         :   " + (-1          >  1         ));
 
	print("  -1          >  0         :   " + (-1          >  0         ));
 
	print("  -1          > -1         :   " + (-1          > -1         ));
 
	print("  -1          > -2147483648:   " + (-1          > -2147483648));
 

	
 
	print("   1          >  2147483647:   " + ( 1          >  2147483647));
 
	print("   1          >  1         :   " + ( 1          >  1         ));
 
	print("   1          >  0         :   " + ( 1          >  0         ));
 
	print("   1          > -1         :   " + ( 1          > -1         ));
 
	print("   1          > -2147483648:   " + ( 1          > -2147483648));
 

	
 
	print("   2147483647 >  2147483646:   " + ( 2147483647 >  2147483646));
 
	print("   2147483647 >  1         :   " + ( 2147483647 >  1         ));
 
	print("   2147483647 >  0         :   " + ( 2147483647 >  0         ));
 
	print("   2147483647 > -1         :   " + ( 2147483647 > -1         ));
 
	print("   2147483647 > -2147483648:   " + ( 2147483647 > -2147483648));
 

	
 
	print("   2147483646 >  2147483647:   " + ( 2147483646 >  2147483647));
 
	print("   1          >  2147483647:   " + ( 1          >  2147483647));
 
	print("   0          >  2147483647:   " + ( 0          >  2147483647));
 
	print("  -1          >  2147483647:   " + (-1          >  2147483647));
 
	print("  -2147483648 >  2147483647:   " + (-2147483648 >  2147483647));
 

	
 
	print("   13725      > -2147483648:   " + ( 13725      > -2147483648));
 
}
 

	
 
function Regression::Start()
 
{
 
	this.TestInit();
 
	this.Std();
 
	this.Base();
 
	this.List();
 

	
 
	/* Do this first as it gains maximum loan (which is faked to quite a lot). */
 
	this.Company();
 

	
 
	this.Airport();
 
	this.Bridge();
 
	this.BridgeList();
 
	this.Cargo();
 
	this.CargoList();
 
	this.Engine();
 
	this.EngineList();
 
	this.Group();
 
	this.Industry();
 
	this.IndustryList();
 
	this.IndustryTypeList();
 
	this.Map();
 
	this.Marine();
 
	this.Prices();
 
	this.Rail();
 
	this.RailTypeList();
 
	this.Road();
 
	this.Sign();
 
	this.Station();
 
	this.Tile();
 
	this.TileList();
 
	this.Town();
 
	this.TownList();
 
	this.Tunnel();
 
	this.Vehicle();
 
	/* Order has to be after Vehicle */
 
	this.Order();
 
	print("");
 
	print("  First Subsidy Test");
 
	PrintSubsidy(0);
 

	
 
	while (AIEventController.IsEventWaiting()) {
 
		local e = AIEventController.GetNextEvent();
 
		print("  GetNextEvent:          " + (e == null ? "null" : "instance"));
 
		print("    GetEventType:        " + e.GetEventType());
 
		switch (e.GetEventType()) {
 
			case AIEvent.ET_SUBSIDY_OFFER: {
 
				local c = AIEventSubsidyOffer.Convert(e);
 
				print("      EventName:         SubsidyOffer");
 
				PrintSubsidy(c.GetSubsidyID());
 
			} break;
 

	
 
			case AIEvent.ET_VEHICLE_WAITING_IN_DEPOT: {
 
				local c = AIEventVehicleWaitingInDepot.Convert(e);
 
				print("      EventName:         VehicleWaitingInDepot");
 
				print("      VehicleID:         " + c.GetVehicleID());
 
			} break;
 

	
 
			default:
 
				print("      Unknown Event");
 
				break;
 
		}
 
	}
 
	print("  IsEventWaiting:        false");
 

	
 
	this.Math();
 
}
 

	
ai/regression/require.nut
Show inline comments
 
new file 100644
 
print("  Required this file");
 

	

Changeset was too big and was cut off... Show full diff anyway

0 comments (0 inline, 0 general)