add some basic platform interfaces
This commit is contained in:
parent
de75de9d83
commit
e9a6ee2ffb
|
@ -75,6 +75,9 @@
|
|||
<Compile Include="Math\Transformation.cs" />
|
||||
<Compile Include="Math\SweptEllipsoidCollisionPacket.cs" />
|
||||
<Compile Include="Math\IntersectionTester.cs" />
|
||||
<Compile Include="Platform.cs" />
|
||||
<Compile Include="IPlatformServices.cs" />
|
||||
<Compile Include="ILogger.cs" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
|
||||
<ItemGroup>
|
||||
|
|
13
Blarg.GameFramework/ILogger.cs
Normal file
13
Blarg.GameFramework/ILogger.cs
Normal file
|
@ -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);
|
||||
}
|
||||
}
|
||||
|
15
Blarg.GameFramework/IPlatformServices.cs
Normal file
15
Blarg.GameFramework/IPlatformServices.cs
Normal file
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
25
Blarg.GameFramework/Platform.cs
Normal file
25
Blarg.GameFramework/Platform.cs
Normal file
|
@ -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; }
|
||||
}
|
||||
}
|
||||
|
Reference in a new issue