Add CargoTypesBit helper method to CargoSpec
This commit is contained in:
@@ -90,6 +90,15 @@ struct CargoSpec {
|
|||||||
return this - CargoSpec::array;
|
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
|
* Tests for validity of this cargospec
|
||||||
* @return is this cargospec valid?
|
* @return is this cargospec valid?
|
||||||
|
Reference in New Issue
Block a user