add some basic platform interfaces

This commit is contained in:
Gered 2013-08-14 19:51:20 -04:00
parent de75de9d83
commit e9a6ee2ffb
4 changed files with 56 additions and 0 deletions

View file

@ -75,6 +75,9 @@
<Compile Include="Math\Transformation.cs" /> <Compile Include="Math\Transformation.cs" />
<Compile Include="Math\SweptEllipsoidCollisionPacket.cs" /> <Compile Include="Math\SweptEllipsoidCollisionPacket.cs" />
<Compile Include="Math\IntersectionTester.cs" /> <Compile Include="Math\IntersectionTester.cs" />
<Compile Include="Platform.cs" />
<Compile Include="IPlatformServices.cs" />
<Compile Include="ILogger.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" /> <Import Project="$(MSBuildExtensionsPath32)\Microsoft\Portable\$(TargetFrameworkVersion)\Microsoft.Portable.CSharp.targets" />
<ItemGroup> <ItemGroup>

View 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);
}
}

View 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; }
}
}

View 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; }
}
}