MinchinWeb's MetaLibrary  v.9
Library functions of OpenTTD AI writers.
_MinchinWeb_C_ Class Reference

Constants. More...

Static Public Member Functions

function Infinity ()
 A number close enough to infinity to work for our purposes here. More...
 
function FloatOffset ()
 Used to compare floating point numbers to determine if they are "equal". More...
 
function Pi ()
 Pi (π = 3.14...) to 31 decimal places. More...
 
function e ()
 Euler's number (e = 2.718...) to 31 decimal places. More...
 
function IndustrySize ()
 Industries are assumed to fit within a 4x4 box. More...
 
function InvalidIndustry ()
 Number returned by OpenTTD for an invalid industry (65535) More...
 
function InvalidTile ()
 A number beyond the a valid TileIndex. More...
 
function BuoyOffset ()
 This is the assumed minimum desired spacing between buoys. More...
 
function WaterDepotOffset ()
 This is the maximum desired spacing between docks and depots. More...
 
function MaxStationSpread ()
 Returns the OpenTTD setting for maximum station spread. More...
 

Detailed Description

Constants.

Version
v.1
Author
W. Minchin (MinchinWeb)
Since
MetaLibrary v.2

In general, these are constants used by other sub-libraries within MetaLibrary.

Definition at line 42 of file Constants.nut.

Member Function Documentation

function _MinchinWeb_C_::BuoyOffset ( )
inlinestatic

This is the assumed minimum desired spacing between buoys.

Returns
3

Definition at line 108 of file Constants.nut.

function _MinchinWeb_C_::e ( )
inlinestatic

Euler's number (e = 2.718...) to 31 decimal places.

Definition at line 81 of file Constants.nut.

function _MinchinWeb_C_::FloatOffset ( )
inlinestatic

Used to compare floating point numbers to determine if they are "equal".

Two floating point numbers (i.e. numbers with decimal points) are considered to be equal if they differ by less than this value.

Note
Floating points, due to the imprecision is translating binary numbers (as they are stored by the computer) to decimal numbers, and then performing math with these imperfectly translated numbers, can result in numbers than are otherwise equal, except for very small remainders. This is an attempt to sidestep this issue.
Returns
0.000,5 (or 1/2,000)
Todo:
Convert from an absolute number to a percentage.

Definition at line 71 of file Constants.nut.

function _MinchinWeb_C_::IndustrySize ( )
inlinestatic

Industries are assumed to fit within a 4x4 box.

Returns
4

Definition at line 87 of file Constants.nut.

function _MinchinWeb_C_::Infinity ( )
inlinestatic

A number close enough to infinity to work for our purposes here.

Returns
10,000
Note
Slopes are capped at 10,000 and 1/10,000
A tile that is a Manhattan Distance of 'infinity' tiles away will always be outside of the defined map.

Definition at line 53 of file Constants.nut.

function _MinchinWeb_C_::InvalidIndustry ( )
inlinestatic

Number returned by OpenTTD for an invalid industry (65535)

Returns
0xFFFF

Definition at line 93 of file Constants.nut.

function _MinchinWeb_C_::InvalidTile ( )
inlinestatic

A number beyond the a valid TileIndex.

Valid (or invalid, if you prefer) for at least up to 2048x2048 maps.

Returns
0xFFFFFF
Todo:
Check that this is still valid on 4096x4096 maps.

Definition at line 102 of file Constants.nut.

function _MinchinWeb_C_::MaxStationSpread ( )
static

Returns the OpenTTD setting for maximum station spread.

Definition at line 124 of file Constants.nut.

function _MinchinWeb_C_::Pi ( )
inlinestatic

Pi (π = 3.14...) to 31 decimal places.

Definition at line 76 of file Constants.nut.

function _MinchinWeb_C_::WaterDepotOffset ( )
inlinestatic

This is the maximum desired spacing between docks and depots.

Returns
4

Definition at line 114 of file Constants.nut.


The documentation for this class was generated from the following file: