예제 #1
0
        /// <summary>
        /// 座席の乗客数ボーナス取得
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static int ToPassengerNumBonus(this SeatEnum value)
        {
            ComfortLevelAttribute attribute = value.GetAttribute <ComfortLevelAttribute>();

            return(attribute?.PasserngerNumBonus ?? throw new InvalidOperationException("座席の乗客数ボーナスが未定義"));
        }
예제 #2
0
        /// <summary>
        /// 座席の乗り心地レベル取得
        /// </summary>
        /// <param name="value"></param>
        /// <returns></returns>
        public static int ToComfortLevel(this SeatEnum value)
        {
            ComfortLevelAttribute attribute = value.GetAttribute <ComfortLevelAttribute>();

            return(attribute?.Level ?? throw new InvalidOperationException("座席の乗り心地レベルが未定義"));
        }