Beispiel #1
0
        public void Load()
        {
            PlayTime.OverallPlayTime = Game.saveFile.GetPropertyAsFloat("statsmanager", "playtime", 0);
            PlayTime.OverworldTime   = Game.saveFile.GetPropertyAsFloat("statsmanager", "overworldtime", 0);
            PlayTime.ShooterPartTime = Game.saveFile.GetPropertyAsFloat("statsmanager", "shooterparttime", 0);
            Crebits    = Game.saveFile.GetPropertyAsInt("statsmanager", "crebits", 0);
            progress   = Game.saveFile.GetPropertyAsInt("statsmanager", "progress", 0);
            reputation = Game.saveFile.GetPropertyAsInt("statsmanager", "reputation", 0);
            Fuel       = Game.saveFile.GetPropertyAsFloat("statsmanager", "shipfuel", 0);

            gameMode = MathFunctions.ParseEnum <GameMode>(Game.saveFile.GetPropertyAsString("statsmanager", "gamemode", ""));
            SetStats();

            String beaconLine = Game.saveFile.GetPropertyAsString("statsmanager", "beacons", "");

            if (!beaconLine.ToLower().Equals("none") && !beaconLine.ToLower().Equals(""))
            {
                String[] beaconNames = Game.saveFile.GetPropertyAsString("statsmanager", "beacons", "").Split('/');

                for (int i = 0; i < beaconNames.Length - 1; i++)
                {
                    beaconNames[i] = beaconNames[i].Trim();
                    Beacon beacon = Game.stateManager.overworldState.GetBeacon(beaconNames[i]);
                    AddDiscoveredBeacon(beacon);
                    beacon.OnLoad();
                }
            }
        }