From e9a6ee2ffb9b6ba31f0c9daf6c7df45d4b74c35c Mon Sep 17 00:00:00 2001 From: gered Date: Wed, 14 Aug 2013 19:51:20 -0400 Subject: [PATCH] add some basic platform interfaces --- .../Blarg.GameFramework.csproj | 3 +++ Blarg.GameFramework/ILogger.cs | 13 ++++++++++ Blarg.GameFramework/IPlatformServices.cs | 15 +++++++++++ Blarg.GameFramework/Platform.cs | 25 +++++++++++++++++++ 4 files changed, 56 insertions(+) create mode 100644 Blarg.GameFramework/ILogger.cs create mode 100644 Blarg.GameFramework/IPlatformServices.cs create mode 100644 Blarg.GameFramework/Platform.cs diff --git a/Blarg.GameFramework/Blarg.GameFramework.csproj b/Blarg.GameFramework/Blarg.GameFramework.csproj index 35b8d4a..a801b20 100644 --- a/Blarg.GameFramework/Blarg.GameFramework.csproj +++ b/Blarg.GameFramework/Blarg.GameFramework.csproj @@ -75,6 +75,9 @@ + + + diff --git a/Blarg.GameFramework/ILogger.cs b/Blarg.GameFramework/ILogger.cs new file mode 100644 index 0000000..053753f --- /dev/null +++ b/Blarg.GameFramework/ILogger.cs @@ -0,0 +1,13 @@ +using System; + +namespace Blarg.GameFramework +{ + public interface IPlatformLogger + { + void Info(string category, string format, params object[] args); + void Warn(string category, string format, params object[] args); + void Error(string category, string format, params object[] args); + void Debug(string category, string format, params object[] args); + } +} + diff --git a/Blarg.GameFramework/IPlatformServices.cs b/Blarg.GameFramework/IPlatformServices.cs new file mode 100644 index 0000000..f3fff88 --- /dev/null +++ b/Blarg.GameFramework/IPlatformServices.cs @@ -0,0 +1,15 @@ +using System; +using Blarg.GameFramework.IO; + +namespace Blarg.GameFramework +{ + public interface IPlatformServices + { + PlatformOS OperatingSystem { get; } + PlatformType Type { get; } + + IPlatformLogger Logger { get; } + IFileSystem FileSystem { get; } + } +} + diff --git a/Blarg.GameFramework/Platform.cs b/Blarg.GameFramework/Platform.cs new file mode 100644 index 0000000..37112dc --- /dev/null +++ b/Blarg.GameFramework/Platform.cs @@ -0,0 +1,25 @@ +using System; + +namespace Blarg.GameFramework +{ + public enum PlatformOS + { + Windows, + Linux, + MacOS, + Android, + iOS + } + + public enum PlatformType + { + Mobile, + Desktop + } + + public static partial class Platform + { + public static IPlatformServices Services { get; private set; } + } +} +