diff --git a/mobile-eggbert-fna/Microsoft.Devices.Sensors/Accelerometer.cs b/mobile-eggbert-fna/Microsoft.Devices.Sensors/Accelerometer.cs new file mode 100644 index 0000000..2856b67 --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Devices.Sensors/Accelerometer.cs @@ -0,0 +1,10 @@ +using Microsoft.Devices.Sensors; + +namespace Microsoft.Devices.Sensors +{ + public class Accelerometer : SensorBase + { + public void Start() { } + public void Stop() { } + } +} diff --git a/mobile-eggbert-fna/Microsoft.Devices.Sensors/AccelerometerFailedException.cs b/mobile-eggbert-fna/Microsoft.Devices.Sensors/AccelerometerFailedException.cs new file mode 100644 index 0000000..e125b68 --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Devices.Sensors/AccelerometerFailedException.cs @@ -0,0 +1,6 @@ +namespace Microsoft.Devices.Sensors +{ + public class AccelerometerFailedException : SensorFailedException + { + } +} diff --git a/mobile-eggbert-fna/Microsoft.Devices.Sensors/AccelerometerReading.cs b/mobile-eggbert-fna/Microsoft.Devices.Sensors/AccelerometerReading.cs new file mode 100644 index 0000000..48663e8 --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Devices.Sensors/AccelerometerReading.cs @@ -0,0 +1,12 @@ +using System; +using Microsoft.Xna.Framework; + +namespace Microsoft.Devices.Sensors + +{ + public struct AccelerometerReading : ISensorReading + { + public Vector3 Acceleration { get; internal set; } + public DateTimeOffset Timestamp { get; internal set; } + } +} diff --git a/mobile-eggbert-fna/Microsoft.Devices.Sensors/ISensorReading.cs b/mobile-eggbert-fna/Microsoft.Devices.Sensors/ISensorReading.cs new file mode 100644 index 0000000..02cc293 --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Devices.Sensors/ISensorReading.cs @@ -0,0 +1,10 @@ +using System; + +namespace Microsoft.Devices.Sensors + +{ + public interface ISensorReading + { + DateTimeOffset Timestamp { get; } + } +} diff --git a/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorBase.cs b/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorBase.cs new file mode 100644 index 0000000..d82bdd0 --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorBase.cs @@ -0,0 +1,15 @@ +using System; + +namespace Microsoft.Devices.Sensors +{ + public abstract class SensorBase : IDisposable where TSensorReading : ISensorReading + { + private TSensorReading currentValue; + + public event EventHandler> CurrentValueChanged; + + public void Dispose() + { + } + } +} \ No newline at end of file diff --git a/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorFailedException.cs b/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorFailedException.cs new file mode 100644 index 0000000..4eb2813 --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorFailedException.cs @@ -0,0 +1,8 @@ +using System; + +namespace Microsoft.Devices.Sensors +{ + public class SensorFailedException : Exception + { + } +} diff --git a/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorReadingEventArgs.cs b/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorReadingEventArgs.cs new file mode 100644 index 0000000..81f4627 --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Devices.Sensors/SensorReadingEventArgs.cs @@ -0,0 +1,10 @@ +using System; + +namespace Microsoft.Devices.Sensors +{ + + public class SensorReadingEventArgs : EventArgs where T : ISensorReading + { + public T SensorReading { get; set; } + } +} \ No newline at end of file diff --git a/mobile-eggbert-fna/Microsoft.Xna.Framework.GamerServices/Guide.cs b/mobile-eggbert-fna/Microsoft.Xna.Framework.GamerServices/Guide.cs new file mode 100644 index 0000000..51f291d --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Xna.Framework.GamerServices/Guide.cs @@ -0,0 +1,13 @@ +using System.Diagnostics; + +namespace Microsoft.Xna.Framework.GamerServices +{ + public static class Guide + { + public static void Show(PlayerIndex playerIndex) + { + Debug.Write("The Market Place should now be shown."); + } + public static bool IsTrialMode { get; set; } + } +} diff --git a/mobile-eggbert-fna/Microsoft.Xna.Framework.GamerServices/TrialMode.cs b/mobile-eggbert-fna/Microsoft.Xna.Framework.GamerServices/TrialMode.cs new file mode 100644 index 0000000..e4d54b8 --- /dev/null +++ b/mobile-eggbert-fna/Microsoft.Xna.Framework.GamerServices/TrialMode.cs @@ -0,0 +1,70 @@ +using System; +using System.IO; + +namespace Xna.Framework.GamerServices +{ + internal class TrialMode + { + private static DateTime trialStartTime; + + public static void InitializeTrialMode() + { + // Assuming trial mode starts when the game is launched + trialStartTime = DateTime.Now; + } + + public static bool IsTrialModeExpired() + { + return IsTrialMode7DaysLimitExpired() || IsTrialMode10MinutesLimitExpired(); + } + private static bool IsTrialMode10MinutesLimitExpired() + { + // Example: Trial expires after 10 minutes + var expired = (DateTime.Now - trialStartTime).TotalMinutes > 10; + return expired; + } + private static bool IsTrialMode7DaysLimitExpired() + { + // Save trial expiration status to a file or settings + const string TRIAL_END_TIME_TXT = "trialEndTime.txt"; + var trialEndTime = File.Exists(TRIAL_END_TIME_TXT) ? DateTime.Parse(File.ReadAllText(TRIAL_END_TIME_TXT)) : DateTime.MinValue; + + var expired = trialEndTime != DateTime.MinValue && DateTime.Now > trialEndTime; + if (expired) + { + return true; // Trial period is over + } + + // Example of setting trial end time (e.g., 7 days from now) + if (!File.Exists(TRIAL_END_TIME_TXT)) + { + File.WriteAllText(TRIAL_END_TIME_TXT, DateTime.Now.AddDays(7).ToString()); + } + + return false; // Trial period still active + } + private static int trialModeEnabled = -1; + public static bool IsTrialModeEnabled() + { + if (trialModeEnabled == 1) + { + return true; + } + + if (trialModeEnabled == 0) + { + return false; + } + + const string TRIAL_MODE_ENABLED_TXT = "trialModeEnabled.txt"; + var trialModeEnabledString = File.Exists(TRIAL_MODE_ENABLED_TXT) ? File.ReadAllText(TRIAL_MODE_ENABLED_TXT) : "0"; + var trialModeEnabledLocal = trialModeEnabledString.Equals("1"); + trialModeEnabled = trialModeEnabledLocal ? 1 : 0; + + return trialModeEnabledLocal; + } + + + } + +} \ No newline at end of file diff --git a/mobile-eggbert-fna/Program.cs b/mobile-eggbert-fna/Program.cs index f79be93..b8e2730 100644 --- a/mobile-eggbert-fna/Program.cs +++ b/mobile-eggbert-fna/Program.cs @@ -1,4 +1,6 @@ -static class Program +using WindowsPhoneSpeedyBlupi; + +static class Program { static void Main() { @@ -6,6 +8,7 @@ //Microsoft.Xna.Framework.FNADllMap.Init(); // See https://aka.ms/new-console-template for more information //Console.WriteLine("Hello, World!"); + Env.init(EnvClasses.Impl.FNA, EnvClasses.Platform.Desktop); var game = new WindowsPhoneSpeedyBlupi.Game1(); game.Run(); } diff --git a/mobile-eggbert-fna/WindowsPhoneSpeedyBlupi b/mobile-eggbert-fna/WindowsPhoneSpeedyBlupi index c8d567e..f38980e 160000 --- a/mobile-eggbert-fna/WindowsPhoneSpeedyBlupi +++ b/mobile-eggbert-fna/WindowsPhoneSpeedyBlupi @@ -1 +1 @@ -Subproject commit c8d567e85331047be2e62fc0b674cce5c6830cf0 +Subproject commit f38980e4e64ddb09af75d70f9c3eb3f7b6dfdc69