Ejemplo n.º 1
0
        private static bool ParseAreaEvent(PgQuestRequirementAreaEventOn newItem, object value, string parsedFile, string parsedKey)
        {
            if (!ParseAreaEvent(value, parsedFile, parsedKey, out MapAreaName AreaName))
            {
                return(false);
            }

            newItem.AreaName = AreaName;
            return(true);
        }
Ejemplo n.º 2
0
        private static bool FinishItemAreaEventOn(ref object?item, Dictionary <string, object> contentTable, Dictionary <string, Json.Token> contentTypeTable, List <object> itemCollection, Json.Token lastItemType, List <string> knownFieldList, List <string> usedFieldList, string parsedFile, string parsedKey)
        {
            PgQuestRequirementAreaEventOn NewItem = new PgQuestRequirementAreaEventOn();

            bool Result = true;

            foreach (KeyValuePair <string, object> Entry in contentTable)
            {
                string Key   = Entry.Key;
                object Value = Entry.Value;

                if (!knownFieldList.Contains(Key))
                {
                    Result = Program.ReportFailure($"Unknown field {Key}");
                }
                else
                {
                    usedFieldList.Add(Key);

                    switch (Key)
                    {
                    case "T":
                        break;

                    case "AreaEvent":
                        Result = ParseAreaEvent(NewItem, Value, parsedFile, parsedKey);
                        break;

                    default:
                        Result = Program.ReportFailure("Unexpected failure");
                        break;
                    }
                }

                if (!Result)
                {
                    break;
                }
            }

            if (Result)
            {
                item = NewItem;
                return(true);
            }
            else
            {
                return(false);
            }
        }