コード例 #1
0
 /// <summary>
 /// 上方互換候補の除外処理.
 /// </summary>
 /// <param name="done">条件を満たすセットが見つかった装備</param>
 /// <param name="searchReport">現状の検索状況</param>
 public virtual void RemoveUpwardCompatibility(PartDataBase done, SearchReport searchReport)
 {
     // 処置不要.
 }
コード例 #2
0
        /// <summary>
        /// 部位データをセット.
        /// </summary>
        /// <param name="part">部位</param>
        /// <param name="candidate">データ</param>
        public void SetPart(Part part, PartDataBase candidate)
        {
            switch (part)
            {
            case Part.Wepon:
                this.Wepon = candidate as PartDataWepon;
                if (null == this.Wepon)
                {
                    throw new InvalidCastException();
                }
                break;

            case Part.Head:
                this.Head = candidate as PartDataArmor;
                if (null == this.Head)
                {
                    throw new InvalidCastException();
                }
                break;

            case Part.Body:
                this.Body = candidate as PartDataArmor;
                if (null == this.Body)
                {
                    throw new InvalidCastException();
                }
                break;

            case Part.Arm:
                this.Arm = candidate as PartDataArmor;
                if (null == this.Arm)
                {
                    throw new InvalidCastException();
                }
                break;

            case Part.Waist:
                this.Waist = candidate as PartDataArmor;
                if (null == this.Waist)
                {
                    throw new InvalidCastException();
                }
                break;

            case Part.Leg:
                this.Leg = candidate as PartDataArmor;
                if (null == this.Leg)
                {
                    throw new InvalidCastException();
                }
                break;

            case Part.Amulet:
                this.Amulet = candidate as PartDataAmulet;
                if (null == this.Amulet)
                {
                    throw new InvalidCastException();
                }
                break;

            case Part.Accessory:
                this.Accessory = candidate as PartDataAccessory;
                if (null == this.Accessory)
                {
                    throw new InvalidCastException();
                }
                break;

            default:
                throw new ArgumentOutOfRangeException("part", part, null);
            }
        }