Пример #1
0
 public BinderList(string[] ids)
 {
     this.ids = new HashSet <Identify>();
     foreach (var id in ids)
     {
         this.ids.Add(Identify.Parse(id));
     }
 }
Пример #2
0
 /// <summary>
 /// 説明文
 /// </summary>
 /// <param name="identify"></param>
 /// <returns></returns>
 public static string Desc(Identify identify)
 {
     switch (identify.Type)
     {
     case IDType.Item:
         return(Array.Find(Instance.Items, (v) => v.Identify == identify).Desc);
     }
     return("");
 }
Пример #3
0
        /// <summary>
        /// 指定したステージがピリオト中クリアした
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool ClearThisPeriod(Identify id)
        {
            var item = items.Find(v => v.id == id.idWithType);

            if (item == null)
            {
                return(false);              // 存在しなかったため一度もクリアしたことない
            }
            return(item.clear >= (period - 3600 * 2));
        }
Пример #4
0
        /// <summary>
        /// 増減
        /// </summary>
        /// <param name="identify"></param>
        /// <param name="add"></param>
        public void Add(Identify identify, int add)
        {
            var item = items.Find(i => i.identify == identify);

            if (item != null)
            {
                item.num += add;
            }
            else
            {
                items.Add(new InventoryItem {
                    identify = identify, num = add
                });
            }
            // 0 以下のアイテムを非表示する
            items.RemoveAll(v => v.num <= 0);
        }
Пример #5
0
        /// <summary>
        /// 名前
        /// </summary>
        /// <param name="identify"></param>
        /// <returns></returns>
        public static string Name(Identify identify)
        {
            switch (identify.Type)
            {
            case IDType.Material:
                return(Array.Find(Instance.Materials, (v) => v.Identify == identify).Name);

            case IDType.Familiar:
                return(Array.Find(Instance.Familiars, (v) => v.Identify == identify).Name);

            case IDType.Item:
                return(Array.Find(Instance.Items, (v) => v.Identify == identify).Name);

            case IDType.Skill:
                return(Array.Find(Instance.Skills, (v) => v.Identify == identify).Name);

            case IDType.Stage:
                return(Array.Find(Instance.Stages, (v) => v.Identify == identify).Name);
            }
            return("");
        }
Пример #6
0
        public int Count(Identify identify)
        {
            var item = Find(identify);

            return((item != null) ? item.num : 0);
        }
Пример #7
0
 public InventoryItem Find(Identify identify)
 {
     return(items.Find(item => item.identify == identify));
 }
Пример #8
0
 /// <summary>
 /// 変更する
 /// </summary>
 /// <param name="id"></param>
 public void Modify(Identify id)
 {
     ids.Add(id);
 }
Пример #9
0
        /// <summary>
        /// 新規ステージ(一回もクリアしたことない)
        /// </summary>
        /// <param name="id"></param>
        /// <returns></returns>
        public bool IsNew(Identify id)
        {
            var item = items.Find(v => v.id == id.idWithType);

            return(item == null);
        }