Exemplo n.º 1
0
        private void Initialize()
        {
            //TODO: Get the right date using NTP synchronization in order to prevent cheating
            var lastSessionData = _dataKeeper.Data.GetLastSessionTimeData();

            if (lastSessionData.IsCaptured())
            {
                var difference = Mathf.FloorToInt((float)(DateTime.Now - lastSessionData.GetDateTime()).TotalSeconds);
                if (difference > 0)
                {
                    IdleMiningResul = _dataKeeper.Data.TotalIdleMining * difference;
                    Data.GetResource(ResourceType.Gold).Increase(IdleMiningResul);
                }
            }

            Initialized.SafeInvoke(Data);
        }
Exemplo n.º 2
0
 /// <summary>
 /// Raises the <see cref="Initialized"/> event.
 /// </summary>
 /// <param name="e">The <see cref="Catel.Services.CameraOperationCompletedEventArgs"/> instance containing the event data.</param>
 protected void RaiseInitialized(CameraOperationCompletedEventArgs e)
 {
     Initialized.SafeInvoke(this, e);
 }