UnitTypeCharacteristics enum

Coordinator
Dec 23, 2008 at 2:31 AM
Edited Dec 23, 2008 at 2:44 AM
Please review and comment on the following UnitTypeCharacteristics enum.  The UnitType class currently has a ulong to contain these characteristics (flags) for denoting characteristics/special abilities.

    /// <summary>
    /// Contains attributes denoting characteristics, special abilities and restrictions for unit types.
    /// </summary>
    public enum UnitTypeCharacteristics : ulong 
    {
        // basic types (bit positions 1..16)
        IsAircraftType = 1L << 1,                                       // can fly like a bird
        IsArtillery = 1L << 2,                                          // defensive fire for adjacent units
        IsGroundType = 1L << 3,                                         // landlubber
        IsHardTarget = 1L << 4,                                         // armored ground init
        IsNavalType = 1L << 5,                                          // can walk on water
        IsSoftTarget = 1L << 6,                                         // susceptible to small arms fire

        // special abilities (17..48)
        CanBridgeRivers = 1L << 17,                                     // bridge engineers can span rivers
        CanProtectBombers = 1L << 18,                                   // fighters can protect adjacent bombers
        CanTransportGroundUnits = 1L << 19,
        CanUtilizeInterceptors = 1L << 20,                              // bombers can utilize friendly adjacent fighters
        CausesTurnSuppression = 1L << 21,                               // level bombers
        IgnoresEnrenchment = 1L << 22,                                  // engineers are close-combat specialists
        IsAirTransport = 1L << 23,                                      // cargo aircraft : can transport infantry
        IsAirTransportable = 1L << 24,                                  // can embark/debark at an airport
        IsGroundTransport = 1L << 25,                                   // truck/half-track : can transport infantry and tow guns
        IsGroundTransportable = 1L << 26,                               // can be transported by ground transport
        IsParatrooper = 1L << 27,                                       // can debark anywhere (not just at an airport)

        // restrictions (49..64)
        MustAttackBeforeMoving = 1L << 49                               // some units lose ability to attack after moving
    };