Example #1
0
    public void mod(IModable modable)
    {
        if (modable.GetType() != GetType())
        {
            Debug.LogError("Type mismatch");
            return;
        }

        Location modableLocation = (Location)modable;

        //subLocations.mod(((Location)modable).subLocations);
        subLocations = Modable.mod(subLocations, modableLocation.subLocations);
    }
    protected override ModableObjectHashDictionary <CommandsCollection> loadFromFolder(string path)
    {
        var result = new ModableObjectHashDictionary <CommandsCollection>();

        ModableObjectHashDictionary <ProceduresFile> dict = loadFromFolder <ProceduresFile>(path);

        foreach (KeyValuePair <string, ProceduresFile> kv in dict)
        {
            foreach (KeyValuePair <string, CommandsCollection> kv2 in kv.Value)
            {
                var item = kv2.Value;
                result.Add(kv2.Key, item);
            }
        }

        return(result);
    }
Example #3
0
    protected override ModableObjectHashDictionary <DialogueTopic> loadFromFolder(string path)
    {
        var result = new ModableObjectHashDictionary <DialogueTopic>();

        ModableObjectHashDictionary <DialogueTopicsFile> dict = loadFromFolder <DialogueTopicsFile>(path);

        foreach (DialogueTopicsFile dialogueTopicsFile in dict.Values)
        {
            foreach (KeyValuePair <string, DialogueTopic> kv2 in dialogueTopicsFile.topics)
            {
                var topic = kv2.Value;
                topic.ID = kv2.Key;
                result.Add(kv2.Key, topic);
            }
        }

        return(result);
    }
Example #4
0
        protected override ModableObjectHashDictionary <Effect> loadFromFolder(string path)
        {
            var result = new ModableObjectHashDictionary <Effect>();

            ModableObjectHashDictionary <EffectsFile> dict = loadFromFolder <EffectsFile>(path);



            foreach (KeyValuePair <string, EffectsFile> kv in dict)
            {
                foreach (KeyValuePair <string, Effect> kv2 in kv.Value.Effects)
                {
                    var effect = kv2.Value;
                    effect.ID = kv2.Key;
                    result.Add(kv2.Key, effect);
                }
            }

            return(result);
        }
Example #5
0
    protected override ModableObjectHashDictionary <Item> loadFromFolder(string path)
    {
        var result = new ModableObjectHashDictionary <Item>();

        ModableObjectHashDictionary <ItemsFile> dict = loadFromFolder <ItemsFile>(path);



        foreach (KeyValuePair <string, ItemsFile> kv in dict)
        {
            foreach (KeyValuePair <string, Item> kv2 in kv.Value.Items)
            {
                var item = kv2.Value;
                item.id = kv2.Key;
                result.Add(kv2.Key, item);
            }
        }

        return(result);
    }
    protected override ModableObjectHashDictionary <Interrupt> loadFromFolder(string path)
    {
        var result = new ModableObjectHashDictionary <Interrupt>();

        ModableObjectHashDictionary <InterruptsFile> dict = loadFromFolder <InterruptsFile>(path);



        foreach (InterruptsFile interruptsFile in dict.Values)
        {
            foreach (KeyValuePair <string, Interrupt> kv2 in interruptsFile.interrupts)
            {
                var interrupt = kv2.Value;
                interrupt.id = kv2.Key;
                result.Add(kv2.Key, interrupt);
            }
        }

        return(result);
    }
Example #7
0
    public void mod(IModable modable)
    {
        if (modable.GetType() != GetType())
        {
            Debug.LogError($"Type mismatch in mod(): {modable.GetType()} != {GetType()}");
            return;
        }

        ModableObjectHashDictionary <V> modData = (ModableObjectHashDictionary <V>)modable;

        foreach (KeyValuePair <string, V> entry in modData)
        {
            if (!ContainsKey(entry.Key))
            {
                this[entry.Key] = Modable.copyDeep(entry.Value);
                continue;
            }

            this[entry.Key] = Modable.mod(this[entry.Key], entry.Value);
        }
    }
Example #8
0
 private void mod(DialogueStages original, DialogueStages mod)
 {
     stages = Modable.mod(original.stages, mod.stages);
 }