rename classes named using "looper" to "application"

This commit is contained in:
Gered 2013-08-17 18:06:24 -04:00
parent fe789ffab1
commit 76a8d77e2a
8 changed files with 26 additions and 26 deletions

View file

@ -48,11 +48,11 @@
<Compile Include="Input\SDLMouse.cs" /> <Compile Include="Input\SDLMouse.cs" />
<Compile Include="IO\SDLFileSystem.cs" /> <Compile Include="IO\SDLFileSystem.cs" />
<Compile Include="SDLLogger.cs" /> <Compile Include="SDLLogger.cs" />
<Compile Include="SDLLooper.cs" />
<Compile Include="SDLWindow.cs" /> <Compile Include="SDLWindow.cs" />
<Compile Include="SDLConfiguration.cs" /> <Compile Include="SDLConfiguration.cs" />
<Compile Include="CurrentOS.cs" /> <Compile Include="CurrentOS.cs" />
<Compile Include="Input\SDLKeyMapper.cs" /> <Compile Include="Input\SDLKeyMapper.cs" />
<Compile Include="SDLApplication.cs" />
</ItemGroup> </ItemGroup>
<Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" /> <Import Project="$(MSBuildBinPath)\Microsoft.CSharp.targets" />
<ItemGroup> <ItemGroup>

View file

@ -9,9 +9,9 @@ using Blarg.GameFramework.IO;
namespace Blarg.GameFramework namespace Blarg.GameFramework
{ {
public class SDLLooper : BaseLooper public class SDLApplication : BaseApplication
{ {
const string LOG_TAG = "SDLLOOPER"; const string LOG_TAG = "SDLApplication";
#region Fields #region Fields
@ -87,7 +87,7 @@ namespace Blarg.GameFramework
#endregion #endregion
public SDLLooper() public SDLApplication()
{ {
_logger = new SDLLogger(); _logger = new SDLLogger();
_windowInfo = new SDLWindow(); _windowInfo = new SDLWindow();
@ -628,7 +628,7 @@ namespace Blarg.GameFramework
Logger.Info(LOG_TAG, "SDL shutdown."); Logger.Info(LOG_TAG, "SDL shutdown.");
} }
~SDLLooper() ~SDLApplication()
{ {
ReleaseSDL(); ReleaseSDL();
} }

View file

@ -6,9 +6,9 @@ using Blarg.GameFramework.IO;
namespace Blarg.GameFramework namespace Blarg.GameFramework
{ {
public abstract class BaseLooper : ILooper public abstract class BaseApplication : IApplication
{ {
public const string LOG_TAG = "BASELOOPER"; public const string LOG_TAG = "BASEAPP";
protected IGameApp GameApp { get; set; } protected IGameApp GameApp { get; set; }

View file

@ -43,7 +43,6 @@
</ItemGroup> </ItemGroup>
<ItemGroup> <ItemGroup>
<Compile Include="Properties\AssemblyInfo.cs" /> <Compile Include="Properties\AssemblyInfo.cs" />
<Compile Include="ILooper.cs" />
<Compile Include="Input\IKeyboard.cs" /> <Compile Include="Input\IKeyboard.cs" />
<Compile Include="Input\IKeyboardListener.cs" /> <Compile Include="Input\IKeyboardListener.cs" />
<Compile Include="Input\Key.cs" /> <Compile Include="Input\Key.cs" />
@ -81,9 +80,10 @@
<Compile Include="Graphics\Image.cs" /> <Compile Include="Graphics\Image.cs" />
<Compile Include="Graphics\ScreenOrientation.cs" /> <Compile Include="Graphics\ScreenOrientation.cs" />
<Compile Include="IGameApp.cs" /> <Compile Include="IGameApp.cs" />
<Compile Include="BaseLooper.cs" />
<Compile Include="IPlatformWindow.cs" /> <Compile Include="IPlatformWindow.cs" />
<Compile Include="IPlatformConfiguration.cs" /> <Compile Include="IPlatformConfiguration.cs" />
<Compile Include="IApplication.cs" />
<Compile Include="BaseApplication.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

@ -5,7 +5,7 @@ using Blarg.GameFramework.IO;
namespace Blarg.GameFramework namespace Blarg.GameFramework
{ {
public interface ILooper : IDisposable public interface IApplication : IDisposable
{ {
PlatformOS OperatingSystem { get; } PlatformOS OperatingSystem { get; }
PlatformType Type { get; } PlatformType Type { get; }

View file

@ -26,7 +26,7 @@ namespace Blarg.GameFramework
public static PlatformOS OperatingSystem { get; private set; } public static PlatformOS OperatingSystem { get; private set; }
public static PlatformType Type { get; private set; } public static PlatformType Type { get; private set; }
public static ILooper Looper { get; private set; } public static IApplication Application { get; private set; }
public static ILogger Logger { get; private set; } public static ILogger Logger { get; private set; }
public static IFileSystem FileSystem { get; private set; } public static IFileSystem FileSystem { get; private set; }
public static IKeyboard Keyboard { get; private set; } public static IKeyboard Keyboard { get; private set; }
@ -34,20 +34,20 @@ namespace Blarg.GameFramework
public static ITouchScreen TouchScreen { get; private set; } public static ITouchScreen TouchScreen { get; private set; }
public static GL20 GL { get; private set; } public static GL20 GL { get; private set; }
public static void Set(ILooper looper) public static void Set(IApplication application)
{ {
if (Looper != null) if (Application != null)
throw new InvalidOperationException(); throw new InvalidOperationException();
Looper = looper; Application = application;
OperatingSystem = Looper.OperatingSystem; OperatingSystem = Application.OperatingSystem;
Type = Looper.Type; Type = Application.Type;
Logger = Looper.Logger; Logger = Application.Logger;
FileSystem = Looper.FileSystem; FileSystem = Application.FileSystem;
Keyboard = Looper.Keyboard; Keyboard = Application.Keyboard;
Mouse = Looper.Mouse; Mouse = Application.Mouse;
TouchScreen = Looper.TouchScreen; TouchScreen = Application.TouchScreen;
GL = Looper.GL; GL = Application.GL;
} }
} }
} }

View file

@ -56,7 +56,7 @@ namespace Game
public void OnUpdate(float delta) public void OnUpdate(float delta)
{ {
if (Platform.Keyboard.IsPressed(Blarg.GameFramework.Input.Key.Escape)) if (Platform.Keyboard.IsPressed(Blarg.GameFramework.Input.Key.Escape))
Platform.Looper.Quit(); Platform.Application.Quit();
} }
public void Dispose() public void Dispose()

View file

@ -7,12 +7,12 @@ namespace Game.SDL2
{ {
public static void Main(string[] args) public static void Main(string[] args)
{ {
var game = new GameApp();
var config = new SDLConfiguration(); var config = new SDLConfiguration();
config.Title = "Test Game"; config.Title = "Test Game";
var looper = new SDLLooper(); var app = new SDLApplication();
looper.Run(game, config); app.Run(new GameApp(), config);
app.Dispose();
} }
} }
} }