Пример #1
0
 public WithParam(Animal p_enumeratedOne, KaitaiStream p__io, ParamsEnum p__parent = null, ParamsEnum p__root = null) : base(p__io)
 {
     m_parent       = p__parent;
     m_root         = p__root;
     _enumeratedOne = p_enumeratedOne;
     f_isCat        = false;
     _read();
 }
        /// <summary>
        /// Truck routing only, list of hazardous materials in the vehicle. Please refer to the enumeration type HazardousGoodTypeType for available values.
        /// </summary>
        /// <param name="tpParams"></param>
        /// <param name="valeur">Enum [explosive | gas | flammable | combustible | organic | poison | radioActive | corrosive | poisonousInhalation | harmfulToWater | other]</param>
        public static void AddShippedHazardousGoods(this RouteTruckOptions tpParams, ShippedHazardousGoods valeur)
        {
            if (tpParams == null)
            {
                throw new ArgumentNullException(nameof(tpParams));
            }
            string nom   = "shippedHazardousGoods";
            var    param = new ParamsEnum <ShippedHazardousGoods>(nom, valeur);

            if (!tpParams.Parametres.TryAdd(nom, param))
            {
                tpParams.Parametres.Remove(nom);
                tpParams.Parametres.Add(nom, param);
            }
        }
        /// <summary>
        /// Truck routing only, specifies the penalty type on violated truck restrictions.
        /// Defaults to strict.
        /// Refer to the enumeration type TruckRestrictionPenaltyType for details on available values.
        /// Note that the route computed with the penalty type soft will use links with a violated truck restriction if there is no alternative to avoid them.
        /// The route violating truck restrictions is then indicated with dedicated route and maneuver notes in the response
        /// </summary>
        /// <param name="tpParams"></param>
        /// <param name="valeur">Enum [ strict | soft ]</param>
        public static void AddTruckRestrictionPenalty(this RouteTruckOptions tpParams, TruckRestrictionPenalty valeur)
        {
            if (tpParams == null)
            {
                throw new ArgumentNullException(nameof(tpParams));
            }
            string nom   = "truckRestrictionPenalty";
            var    param = new ParamsEnum <TruckRestrictionPenalty>(nom, valeur);

            if (!tpParams.Parametres.TryAdd(nom, param))
            {
                tpParams.Parametres.Remove(nom);
                tpParams.Parametres.Add(nom, param);
            }
        }
Пример #4
0
 public ParamsEnum(KaitaiStream p__io, KaitaiStruct p__parent = null, ParamsEnum p__root = null) : base(p__io)
 {
     m_parent = p__parent;
     m_root   = p__root ?? this;
     _read();
 }