|
OpenTTD Source 20260311-master-g511d3794ce
|
Set containing 'items' items of 'tile and Tdir' No tree structure is used because it would cause slowdowns in most usual cases. More...
Data Structures | |
| struct | SSdata |
| Element of set. More... | |
Public Member Functions | |
| SmallSet (std::string_view name) | |
| Constructor - just set default values and 'name'. | |
| void | Reset () |
| Reset variables to default values. | |
| bool | Overflowed () |
| Returns value of 'overflowed'. | |
| bool | IsEmpty () |
| Checks for empty set. | |
| bool | IsFull () |
| Checks for full set. | |
| uint | Items () |
| Reads the number of items. | |
| bool | Remove (TileIndex tile, Tdir dir) |
| Tries to remove first instance of given tile and dir. | |
| bool | IsIn (TileIndex tile, Tdir dir) |
| Tries to find given tile and dir in the set. | |
| bool | Add (TileIndex tile, Tdir dir) |
| Adds tile & dir into the set, checks for full set Sets the 'overflowed' flag if the set was full. | |
| bool | Get (TileIndex *tile, Tdir *dir) |
| Reads the last added element into the set. | |
Private Attributes | |
| uint | n = 0 |
| Actual number of units. | |
| bool | overflowed = false |
| Did we try to overflow the set? | |
| const std::string_view | name |
| Name, used for debugging purposes... | |
| struct SmallSet::SSdata | data [items] |
Set containing 'items' items of 'tile and Tdir' No tree structure is used because it would cause slowdowns in most usual cases.
Definition at line 55 of file signal.cpp.
|
inline |
Constructor - just set default values and 'name'.
| name | The name of the set. |
Definition at line 72 of file signal.cpp.
References name.
|
inline |
Adds tile & dir into the set, checks for full set Sets the 'overflowed' flag if the set was full.
| tile | tile |
| dir | and dir to add |
Definition at line 158 of file signal.cpp.
|
inline |
Reads the last added element into the set.
| tile | pointer where tile is written to |
| dir | pointer where dir is written to |
Definition at line 179 of file signal.cpp.
|
inline |
|
inline |
Checks for full set.
Definition at line 103 of file signal.cpp.
References lengthof.
Referenced by Add().
|
inline |
Tries to find given tile and dir in the set.
| tile | tile |
| dir | and dir to find |
Definition at line 142 of file signal.cpp.
|
inline |
Reads the number of items.
Definition at line 112 of file signal.cpp.
|
inline |
Returns value of 'overflowed'.
Definition at line 85 of file signal.cpp.
|
inline |
Tries to remove first instance of given tile and dir.
| tile | tile |
| dir | and dir to remove |
Definition at line 124 of file signal.cpp.
|
inline |
Reset variables to default values.
Definition at line 75 of file signal.cpp.
|
private |
Actual number of units.
Definition at line 57 of file signal.cpp.
|
private |
Name, used for debugging purposes...
Definition at line 59 of file signal.cpp.
Referenced by Add(), and SmallSet().
|
private |
Did we try to overflow the set?
Definition at line 58 of file signal.cpp.