@@ -470,13 +470,18 @@ namespace SimRacing {
470470 */
471471 class Shifter : public Peripheral {
472472 public:
473+ /* *
474+ * Type alias for gear numbers
475+ */
476+ using Gear = int8_t ;
477+
473478 /* *
474479 * Class constructor
475480 *
476481 * @param min the lowest gear possible
477482 * @param max the highest gear possible
478483 */
479- Shifter (int8_t min, int8_t max);
484+ Shifter (Gear min, Gear max);
480485
481486 /* *
482487 * Returns the currently selected gear.
@@ -486,7 +491,7 @@ namespace SimRacing {
486491 *
487492 * @return current gear index
488493 */
489- int8_t getGear () const { return currentGear; }
494+ Gear getGear () const { return currentGear; }
490495
491496 /* *
492497 * Returns a character that represents the given gear.
@@ -537,21 +542,21 @@ namespace SimRacing {
537542 *
538543 * @return the lowest gear index
539544 */
540- int8_t getGearMin () { return MinGear; }
545+ Gear getGearMin () { return MinGear; }
541546
542547 /* *
543548 * Retrieves the maximum possible gear index.
544549 *
545550 * @return the highest gear index
546551 */
547- int8_t getGearMax () { return MaxGear; }
552+ Gear getGearMax () { return MaxGear; }
548553
549554 protected:
550- const int8_t MinGear; // /< the lowest selectable gear
551- const int8_t MaxGear; // /< the highest selectable gear
555+ const Gear MinGear; // /< the lowest selectable gear
556+ const Gear MaxGear; // /< the highest selectable gear
552557
553- int8_t currentGear; // /< index of the current gear
554- bool changed; // /< whether the gear has changed since the previous update
558+ Gear currentGear; // /< index of the current gear
559+ bool changed; // /< whether the gear has changed since the previous update
555560 };
556561
557562
0 commit comments