Add CargoTypesBit helper method to CargoSpec

This commit is contained in:
Jonathan G Rennison
2021-06-29 18:06:12 +01:00
parent 9b1783809d
commit f901da344e

View File

@@ -90,6 +90,15 @@ struct CargoSpec {
return this - CargoSpec::array;
}
/**
* Determine CargoTypes bit of this cargospec
* @return CargoTypes bit
*/
inline CargoTypes CargoTypesBit() const
{
return static_cast<CargoTypes>(1) << this->Index();
}
/**
* Tests for validity of this cargospec
* @return is this cargospec valid?