Beispiel #1
0
    public new void store(string name, List <Directories> hierarchie = null, bool use_install_folder = false)
    {
        hierarchie ??= new List <Directories>();
        hierarchie.AddRange(hierVal.AsEnumerable());

        base.store(name + endingSol, hierarchie, use_install_folder);

        string path_o = path_Val;

        path_Val = CreatePathToFile(out _, name + endingVal, "JSON", hierarchie, use_install_folder);
        JSONManager.WriteToJsonFile(path_Val, this.ValidationSet, 0);
        path_Val = path_o;

        hierarchie.RemoveRange(hierarchie.Count - hierVal.Count, hierVal.Count);
    }
Beispiel #2
0
    public void store(string name, List<Directories> hierarchie = null, bool use_install_folder = false, bool force_write = true)
    {
        hierarchie ??= new List<Directories>();
        hierarchie.AddRange(hierState.AsEnumerable());

        string path_o = path;
        path = CreatePathToFile(out bool exists, name, "JSON", hierarchie, use_install_folder);

        hierarchie.RemoveRange(hierarchie.Count - hierState.Count, hierState.Count);

        // note: max depth for "this" is 2, since Fact has non-serilazible member, that is not yet ignored (see Fact.[JasonIgnore] and JSONManager.WriteToJsonFile)
        // using public dummy class to circumvent deserialiation JsonInheritanceProblem (see todos @PublicFactOrganizer)
        if(!exists || force_write)
            JSONManager.WriteToJsonFile(path, new PublicFactOrganizer(this), 0);

        path = path_o;
    }
Beispiel #3
0
    public void store(bool reset_player = false)
    {
        hierarchie ??= new List <Directories>();
        hierarchie.AddRange(hierStage.AsEnumerable());

        player_record.name = record_name;
        if (reset_player)
        {
            player_record = new PlayerRecord(record_name);
        }

        //if (creatorMode || StageStatic.devel)
        {
            string path_o = path;
            path = CreatePathToFile(out bool exists, name, "JSON", hierarchie, use_install_folder);
            hierarchie.RemoveRange(hierarchie.Count - hierStage.Count, hierStage.Count);

            JSONManager.WriteToJsonFile(path, this, 0);
            path = path_o;

            hierarchie.AddRange(hierStage.AsEnumerable());
            if (solution != null && solution.ValidationSet.Count > 0 && !solution.ValidationSet.Aggregate(false, (last, next) => last || next.IsEmpty()))
            {
                solution.store(name, hierarchie, use_install_folder);
            }
        }

        if (player_record != null)
        {
            player_record.store(hierarchie, true);
        }

        foreach (var track in player_record_list)
        {
            track.Value.store(hierarchie, false);
        }

        hierarchie.RemoveRange(hierarchie.Count - hierStage.Count, hierStage.Count);
    }