Class for holding a CargoID and a boolean to be used in an anonymous union. More...
Public Member Functions | |
operator CargoID () const | |
CargoID | operator= (CargoID cargo) |
When setting the CargoID, initialize transfer. | |
bool | HasTransfer () const |
void | SetTransfer (bool transfer) |
Private Attributes | |
CargoID | cargo |
bool | transfer |
Class for holding a CargoID and a boolean to be used in an anonymous union.
Anonymous structs in anonymous unions are supported in most compilers, but not part of the standard. The problem here can not be cleanly solved with templates and inheritance as that would require separate types for each "column" of the station GUI (there is no way to recursively typedef template classes). With the general purpose CargoDataEntry I'm avoiding that and reducing code size significantly.
Definition at line 844 of file station_gui.cpp.
When setting the CargoID, initialize transfer.
We can't define a constructor as that could not be used in a union, either.
cargo | New CargoID. |
Definition at line 856 of file station_gui.cpp.