コード例 #1
0
        /// <summary>
        /// 全てのクエストを読み込む
        /// </summary>
        private List <QuestVO> LoadAllQuestFromMaster()
        {
            var idValues = Enum.GetValues(typeof(QuestMaster.rowIds))
                           .Cast <QuestMaster.rowIds>()
                           .ToList();

            return(idValues.Select(id => QuestVO.Create(id.ToString()))
                   .ToList());
        }
コード例 #2
0
        private void Load()
        {
            var offeredIdList = ES3.Load <List <string> >(OfferedQuestListSaveKey
                                                          , defaultValue: new List <string>());
            var completedIdList = ES3.Load <List <string> >(CompletedQuestListSaveKey
                                                            , defaultValue: new List <string>());

            offeredQuestList = offeredIdList.Select(id => QuestVO.Create(id))
                               .ToList();
            completedQuestList = completedIdList.Select(id => QuestVO.Create(id))
                                 .ToList();
        }
コード例 #3
0
        public static QuestVO Create(string id)
        {
            var row = QuestMaster.Instance.GetRow(id);

            var vo = new QuestVO();

            vo.id          = id;
            vo.idInt       = ConvertRowIdToInt(id);
            vo.name        = row._Name;
            vo.type        = row._Type;
            vo.target      = row._Target;
            vo.description = row._Description;

            return(vo);
        }
コード例 #4
0
        /// <summary>
        /// クエストを受領
        /// </summary>
        public void OfferQuest(string rowId)
        {
            if (offeredQuestList == null)
            {
                offeredQuestList = new List <QuestVO>();
            }

            var isOffered = offeredQuestList.Any(offered => offered.id == rowId);

            if (isOffered)
            {
                Debug.Log("既に受領しているクエストです");
                return;
            }

            var vo = QuestVO.Create(rowId);

            offeredQuestList.Add(vo);

            Debug.Log($"Offered Quest {rowId}");

            Save();
        }