OpenTTD AI API
20241117-master-ga6c526cfa0
|
Class that handles some basic functions. More...
Static Public Member Functions | |
static int | Rand () |
Get a random value. More... | |
static int | RandItem (int unused_param) |
Get a random value. More... | |
static int | RandRange (int max) |
Get a random value in a range. More... | |
static int | RandRangeItem (int unused_param, int max) |
Get a random value in a range. More... | |
static bool | Chance (int out, int max) |
Returns approximately 'out' times true when called 'max' times. More... | |
static bool | ChanceItem (int unused_param, int out, int max) |
Returns approximately 'out' times true when called 'max' times. More... | |
Class that handles some basic functions.
|
static |
Returns approximately 'out' times true when called 'max' times.
After all, it is a random function.
out | How many times it should return true. The value will be clamped to 0 .. MAX(int). |
max | Out of this many times. The value will be clamped to 0 .. MAX(int). |
|
static |
Returns approximately 'out' times true when called 'max' times.
After all, it is a random function.
unused_param | This parameter is not used, but is needed to work with lists. |
out | How many times it should return true. The value will be clamped to 0 .. MAX(int). |
max | Out of this many times. The value will be clamped to 0 .. MAX(int). |
|
static |
Get a random value.
|
static |
Get a random value.
unused_param | This parameter is not used, but is needed to work with lists. |
|
static |
Get a random value in a range.
max | The first number this function will never return (the maximum it returns is max - 1). The value will be clamped to 0 .. MAX(int). |
|
static |
Get a random value in a range.
unused_param | This parameter is not used, but is needed to work with lists. |
max | The first number this function will never return (the maximum it returns is max - 1). The value will be clamped to 0 .. MAX(int). |