v1.3.0, Added game saving mechanic (WIP)

This commit is contained in:
Nicola Sovic
2022-06-04 18:49:32 +02:00
parent bb052cef6b
commit a0fc2e4790
10 changed files with 405 additions and 41 deletions

View File

@@ -1,3 +1,4 @@
using Assets.Scripts;
using System;
using System.Collections;
using System.Collections.Generic;
@@ -178,4 +179,31 @@ public class WorldGenerator : MonoBehaviour
{
gameObject.GetComponent<Text>().text = "Cities: " + (maxCityAmount - cityAmount) + "/" + maxCityAmount;
}
public string saveGame()
{
Dictionary<Vector3, GameObject> tiles;
GameObject currentTile;
string result = "";
result = result + FileHandler.generateJSON("cityAmount", cityAmount) + ",\r\n";
result = result + FileHandler.generateJSON("maxCityAmount", maxCityAmount) + ",\r\n";
/*result = result + "'playername': " + playername + ",\r\n";
result = result + "'maxHealth': " + maxHealth + ",\r\n";
result = result + "'maxSecondary': " + maxSecondary + ",\r\n";
result = result + "'secondary': " + secondary + ",\r\n";
result = result + "'health': " + health + ",\r\n";
result = result + "'strength': " + strength + ",\r\n";
result = result + "'dexterity': " + dexterity + ",\r\n";
result = result + "'intelligence': " + intelligence + ",\r\n";
result = result + "'level': " + level + ",\r\n";
result = result + "'experience': " + experience + ",\r\n";
result = result + "'maxExperience': " + maxExperience + ",\r\n";
result = result + "'race': " + race.racename + ",\r\n";
result = result + "'role': " + role.classname + ",\r\n";
result = result + "'points': " + points + ",\r\n";
result = result + "'isDodging': " + isDodging + ",\r\n";
result = result + "'killcount': " + killcount + ",\r\n";
result = result + "'difficulty': " + difficulty;*/
return result;
}
}