Esempio n. 1
0
        /// <summary>
        /// Allows the game to perform any initialization it needs to before starting to run.
        /// This is where it can query for any required services and load any non-graphic
        /// related content.  Calling base.Initialize will enumerate through any components
        /// and initialize them as well.
        /// </summary>
        protected override void Initialize()
        {
            object Di = DeviceExtendedProperties.GetValue("DeviceUniqueId");
            DeviceID = GetSHA2((byte[])Di);
            playerData = new PlayerData();
            playerData.Load();
            playerData.ReportingEnabled = true;
            base.Initialize();
            base.OnUpdateStart += new Action<GameTime>(fOnUpdateStart);
            base.OnUpdateEnd += new Action<GameTime>(fOnUpdateEnd);
            base.OnDrawStart += new Action<GameTime>(fOnDrawStart);
            base.OnDrawEnd += new Action<GameTime>(fOnDrawEnd);

            GameManager = new GameManager();

            adManager.Initialize();
            TryPushStatistics();

            StartAgent();
        }
Esempio n. 2
0
 public PlayerData(PlayerData instance)
 {
     IsStored = instance.IsStored;
     if (IsStored)
     {
         OGI = instance.OGI;
         Hash = instance.Hash;
     }
     DeviceRegistered = instance.DeviceRegistered;
     ReportingEnabled = instance.ReportingEnabled;
     FirstLoad = instance.FirstLoad;
     Progress = new Dictionary<string, int>();
     Research = new Dictionary<string, int>();
     Difficulty = Difficulty.Easy;
     Points = 2;
     Research.Add("Attack", 0);
     Research.Add("Defense", 0);
     Research.Add("Speed", 0);
     Research.Add("Growth", 0);
 }
Esempio n. 3
0
 void Easy_OnClick(object sender, EventArgs e)
 {
     playerData = new PlayerData(playerData);
     playerData.Difficulty = (Difficulty)Enum.Parse(typeof(Difficulty), (sender as Control).Tag.ToString(), true);
     playerData.Save();
 }