void Generate() { TerrainAlgorithm = new DiamondSquareAlgorithm(size, size); TerrainAlgorithm.Grain = TerrainGrain; PlasmaAlgorithm = new DiamondSquareAlgorithm(size, size); PlasmaAlgorithm.Grain = PlasmaGrain; GenerateTerrain(); GeneratePlasma(); gData = new GeneralData(saveInfo.Current.Name); gData.TerrainMatrix = _hmap; gData.PlasmaMatrix = _pmap; saveInfo.Current.IsNewGame = false; DataController.Instance.AddData(gData); DataController.Instance.SaveAll(); _complited = true; }
void Load() { gData = new GeneralData(saveInfo.Current.Name); DataController.Instance.LoadData<GeneralData>(ref gData); _hmap = gData.TerrainMatrix; _pmap = gData.PlasmaMatrix; _complited = true; }