Esempio n. 1
0
        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;
        }
Esempio n. 2
0
        void Load()
        {
            gData = new GeneralData(saveInfo.Current.Name);
            DataController.Instance.LoadData<GeneralData>(ref gData);

            _hmap = gData.TerrainMatrix;
            _pmap = gData.PlasmaMatrix;

            _complited = true;
        }