Exemplo n.º 1
0
        /// <summary>
        /// コンストラクタ
        /// </summary>
        /// <param name="requirements">検索条件</param>
        public CandidateSet(Requirement requirements)
        {
            // 検索処理の実施前に各装備の候補リスト最低限絞り込んだオリジナルリストを生成してデータ化しておく
            // 検索処理中ではオリジナルリストをさらにその検索中の状態に合わせて絞り込んだデータに複製して利用する.

            // 候補装備リスト辞書を生成.
            this.OrgCandidateListDic = new Dictionary <Part, CandidateCreator>
            {
                { Part.Wepon, new CandidateCreator(new CandidateWepon(), requirements) },
                { Part.Head, new CandidateCreator(new CandidateArmor(Part.Head), requirements) },
                { Part.Body, new CandidateCreator(new CandidateArmor(Part.Body), requirements) },
                { Part.Arm, new CandidateCreator(new CandidateArmor(Part.Arm), requirements) },
                { Part.Waist, new CandidateCreator(new CandidateArmor(Part.Waist), requirements) },
                { Part.Leg, new CandidateCreator(new CandidateArmor(Part.Leg), requirements) },
                { Part.Amulet, new CandidateCreator(new CandidateAmulet(), requirements) },
                { Part.Accessory, new CandidateCreator(new CandidateAccessory(), requirements) },
            };


            // 抽象化防具もあらかじめリスト辞書を生成しておく.
            this.OrgAbstractListDic = new Dictionary <Part, CandidateCreator>
            {
                { Part.Head, new CandidateCreator(new CandidateArmorAbstract(Part.Head), requirements) },
                { Part.Body, new CandidateCreator(new CandidateArmorAbstract(Part.Body), requirements) },
                { Part.Arm, new CandidateCreator(new CandidateArmorAbstract(Part.Arm), requirements) },
                { Part.Waist, new CandidateCreator(new CandidateArmorAbstract(Part.Waist), requirements) },
                { Part.Leg, new CandidateCreator(new CandidateArmorAbstract(Part.Leg), requirements) },
            };

            // 必要空きスロットLvリストを生成.
            var blankSlotList = requirements.RequirementBlankSlot.GetBlankSlotList();

            this.NeedBlankSlotLvList = MasterAccessoryData.GetSlotLvList(blankSlotList);
        }
        /// <summary>
        /// 必要スロットリストを取得.
        /// </summary>
        /// <returns></returns>
        public List <int> GetNeedSlotLvList()
        {
            if (null == this.CacheNeedSlotLvList)
            {
                this.CacheNeedSlotLvList = MasterAccessoryData.GetSlotLvList(this.MasterList);
            }

            return(this.CacheNeedSlotLvList);
        }