Ejemplo n.º 1
0
        public void Initialize()
        {
            Data = _manager.Load();

            if (Data == null ||
                Data.BluePlayer == null ||
                Data.RedPlayer == null)
            {
                InitNewGame();
            }
        }
Ejemplo n.º 2
0
        public void InitNewGame()
        {
            Data = new GameSaveData();

            Data.IsGameStarted       = false;
            Data.CurrentMovingPlayer = GameSaveData.PlayerSide.Blue;

            Data.BluePlayer = new GameSaveData.PlayerStats();
            Data.BluePlayer.TimeInSeconds  = 0;
            Data.BluePlayer.Score          = 0;
            Data.BluePlayer.ActivePoints   = new List <IntPoint>();
            Data.BluePlayer.CapturedPoints = new List <IntPoint>();
            Data.BluePlayer.Regions        = new List <Region>();

            Data.RedPlayer = new GameSaveData.PlayerStats();
            Data.RedPlayer.TimeInSeconds  = 0;
            Data.RedPlayer.Score          = 0;
            Data.RedPlayer.ActivePoints   = new List <IntPoint>();
            Data.RedPlayer.CapturedPoints = new List <IntPoint>();
            Data.RedPlayer.Regions        = new List <Region>();
        }