Exemplo n.º 1
0
        private void FetchFieldValue(DateFile dateFileInstance, ActorMenu actorMenuInstance, Dictionary <int, string> actorDate, int resid)
        {
            switch (resid)
            {
            case -1:
                fieldValues[resid] = dateFileInstance.gongFaExperienceP.ToString();
                break;

            case 12:
                if (actorMenuInstance != null)
                {
                    fieldValues[resid] = actorMenuInstance.Health(lastActorId).ToString();
                }
                else
                {
                    fieldValues.Remove(resid);
                }
                break;

            default:
                if (!actorDate.TryGetValue(resid, out string text))
                {
                    if (!dateFileInstance.presetActorDate.TryGetValue(lastActorId, out Dictionary <int, string> presetActorData) || !presetActorData.TryGetValue(resid, out text))
                    {
                        text = "0";
                    }
                }
                fieldValues[resid] = text;
                break;
            }
        }
        private void FetchFieldValueHelper(DateFile dateFileInstance, ActorMenu actorMenuInstance, Dictionary <int, string> actorDate, int resid)
        {
            switch (resid)
            {
            case -1:
                fieldValuesCache[resid] = dateFileInstance.gongFaExperienceP.ToString();
                break;

            case 12:     // 获取健康数据
                fieldValuesCache[resid] = actorMenuInstance.Health(currentActorId).ToString();
                break;

            default:
                if (!actorDate.TryGetValue(resid, out string text))
                {
                    if (!dateFileInstance.presetActorDate.TryGetValue(currentActorId, resid, out text, actorDate))
                    {
                        text = "0";
                    }
                }
                fieldValuesCache[resid] = text;
                break;
            }
        }