Exemplo n.º 1
0
    //IJsonSaveLoadInitializable
    public bool JsonExport(string path, string name, bool overwrite)
    {
        string FilePath = path + "/" + name + ".json";

        if (File.Exists(FilePath) && !overwrite)
        {
            return(false);//(返り値なしだとエラーのため適当にしています.要修正)
        }
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        return(JsonIO.JsonExport(this, path, name));
    }
Exemplo n.º 2
0
    //IJsonSaveLoadable
    public static bool JsonExport(string path, string name, bool overwrite)
    {
        string filePath = path + "/" + name + ".json";

        if (File.Exists(filePath) && !overwrite)
        {
            return(false);
        }
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        FlagsForSerialization exporter = new FlagsForSerialization();

        exporter.FlagField = FlagField;

        return(JsonIO.JsonExport(exporter, path, name));
    }
Exemplo n.º 3
0
    public Dictionary <string, MapBuildingScript> Buildings; //キー: 建物名, 値: 対応するMapBuildingScriptとする.

    //IJsonSaveLoadable
    public bool JsonExport(string path, string name, bool overwrite)
    {
        string filePath = path + "/" + name + ".json";

        if (File.Exists(filePath) && !overwrite)
        {
            return(false);
        }
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }

        MapControllScriptForSerialization mcss = new MapControllScriptForSerialization();

        mcss.MapName      = MapName;
        mcss.BuildingName = BuildingName;

        return(JsonIO.JsonExport(mcss, path, name));
    }
Exemplo n.º 4
0
    //IJsonSaveLoadable
    public bool JsonExport(string path, string name, bool overwrite)
    {
        string filePath = path + "/" + name + ".json";

        if (File.Exists(filePath) && !overwrite)
        {
            return(false);
        }
        if (!Directory.Exists(path))
        {
            Directory.CreateDirectory(path);
        }
        MapBuildingScriptForSerialization exporter = new MapBuildingScriptForSerialization();

        exporter.Origin                = Origin;
        exporter.BuildingName          = BuildingName;
        exporter.Status                = Status;
        exporter.MapChipIDField_Width  = MapChipIDField_Width;
        exporter.MapChipIDField_Height = MapChipIDField_Height;
        exporter.MapChipIDField        = MapChipIDField;
        exporter.CollisionField        = CollisionField;

        return(JsonIO.JsonExport(exporter, path, name));
    }