Merge branch 'departure-boards' into jgrpp

VehicleListIdentifier API changes.

# Conflicts:
#	src/departures.cpp
#	src/vehicle_gui.cpp
This commit is contained in:
Jonathan G Rennison
2016-11-11 18:46:15 +00:00
18 changed files with 96 additions and 66 deletions

View File

@@ -37,7 +37,7 @@ uint32 VehicleListIdentifier::Pack() const
* @param data The data to unpack.
* @return true iff the data was valid (enough).
*/
bool VehicleListIdentifier::Unpack(uint32 data)
bool VehicleListIdentifier::UnpackIfValid(uint32 data)
{
byte c = GB(data, 28, 4);
this->company = c == 0xF ? OWNER_NONE : (CompanyID)c;
@@ -52,10 +52,12 @@ bool VehicleListIdentifier::Unpack(uint32 data)
* Decode a packed vehicle list identifier into a new one.
* @param data The data to unpack.
*/
VehicleListIdentifier::VehicleListIdentifier(uint32 data)
/* static */ VehicleListIdentifier VehicleListIdentifier::UnPack(uint32 data)
{
bool ret = this->Unpack(data);
VehicleListIdentifier result;
bool ret = result.UnpackIfValid(data);
assert(ret);
return result;
}
/**