From f901da344e0da39bce1a283fbdcf51ca8d6bf258 Mon Sep 17 00:00:00 2001 From: Jonathan G Rennison Date: Tue, 29 Jun 2021 18:06:12 +0100 Subject: [PATCH] Add CargoTypesBit helper method to CargoSpec --- src/cargotype.h | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/cargotype.h b/src/cargotype.h index e56e3c5955..511fa8c23e 100644 --- a/src/cargotype.h +++ b/src/cargotype.h @@ -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(1) << this->Index(); + } + /** * Tests for validity of this cargospec * @return is this cargospec valid?