adding IGame interface
This commit is contained in:
parent
ce9746f10c
commit
68d516cc86
|
@ -1,5 +1,4 @@
|
|||
#include "Game.h"
|
||||
|
||||
using namespace GameLogic;
|
||||
|
||||
Game::Game(void)
|
||||
|
@ -15,3 +14,11 @@ void Game::Init()
|
|||
{
|
||||
|
||||
}
|
||||
void Game::StartGame()
|
||||
{
|
||||
|
||||
}
|
||||
void Game::Update()
|
||||
{
|
||||
|
||||
}
|
|
@ -8,20 +8,20 @@ namespace GameLogic
|
|||
{
|
||||
class Game
|
||||
{
|
||||
private:
|
||||
|
||||
|
||||
private:
|
||||
GameLogic::Level *level;
|
||||
GameLogic::Player *player;
|
||||
|
||||
public:
|
||||
Game(void);
|
||||
~Game(void);
|
||||
Game();
|
||||
~Game();
|
||||
|
||||
void Init();
|
||||
void StartGame();
|
||||
|
||||
void Update();
|
||||
|
||||
private:
|
||||
Level *level;
|
||||
Player *player;
|
||||
|
||||
};
|
||||
}
|
||||
|
||||
|
|
|
@ -24,26 +24,26 @@
|
|||
</PropertyGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.Default.props" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>true</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
<CharacterSet>MultiByte</CharacterSet>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'" Label="Configuration">
|
||||
<ConfigurationType>StaticLibrary</ConfigurationType>
|
||||
<ConfigurationType>DynamicLibrary</ConfigurationType>
|
||||
<UseDebugLibraries>false</UseDebugLibraries>
|
||||
<PlatformToolset>v110</PlatformToolset>
|
||||
<WholeProgramOptimization>true</WholeProgramOptimization>
|
||||
|
@ -66,22 +66,22 @@
|
|||
</ImportGroup>
|
||||
<PropertyGroup Label="UserMacros" />
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
|
||||
<OutDir>$(SolutionDir)..\External\Lib\$(ProjectName)\</OutDir>
|
||||
<OutDir>$(SolutionDir)..\External\Bin\DLL\$(ProjectName)\</OutDir>
|
||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|Win32'">
|
||||
<OutDir>$(SolutionDir)..\External\Lib\$(ProjectName)\</OutDir>
|
||||
<OutDir>$(SolutionDir)..\External\Bin\DLL\$(ProjectName)\</OutDir>
|
||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|x64'">
|
||||
<OutDir>$(SolutionDir)..\External\Lib\$(ProjectName)\</OutDir>
|
||||
<OutDir>$(SolutionDir)..\External\Bin\DLL\$(ProjectName)\</OutDir>
|
||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(PlatformShortName)D</TargetName>
|
||||
</PropertyGroup>
|
||||
<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Release|x64'">
|
||||
<OutDir>$(SolutionDir)..\External\Lib\$(ProjectName)\</OutDir>
|
||||
<OutDir>$(SolutionDir)..\External\Bin\DLL\$(ProjectName)\</OutDir>
|
||||
<IntDir>$(SolutionDir)..\Obj\$(ProjectName)\$(PlatformShortName)\$(Configuration)\</IntDir>
|
||||
<TargetName>$(ProjectName)_$(PlatformShortName)</TargetName>
|
||||
</PropertyGroup>
|
||||
|
@ -91,6 +91,7 @@
|
|||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -102,6 +103,7 @@
|
|||
<Optimization>Disabled</Optimization>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -115,6 +117,7 @@
|
|||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -130,6 +133,7 @@
|
|||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>$(SolutionDir)Misc;$(SolutionDir)OysterMath;$(SolutionDir)OysterPhysics3D;$(SolutionDir)GamePhysics;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
<PreprocessorDefinitions>DLL_EXPORT;_WINDLL;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<GenerateDebugInformation>true</GenerateDebugInformation>
|
||||
|
@ -138,9 +142,6 @@
|
|||
</Link>
|
||||
</ItemDefinitionGroup>
|
||||
<ItemGroup>
|
||||
<ProjectReference Include="..\GamePhysics\GamePhysics.vcxproj">
|
||||
<Project>{104fa3e9-94d9-4e1d-a941-28a03bc8a095}</Project>
|
||||
</ProjectReference>
|
||||
<ProjectReference Include="..\Misc\Misc.vcxproj">
|
||||
<Project>{2ec4dded-8f75-4c86-a10b-e1e8eb29f3ee}</Project>
|
||||
</ProjectReference>
|
||||
|
@ -151,6 +152,22 @@
|
|||
<Project>{4285bd3f-3c6c-4670-b7af-a29afef5f6a8}</Project>
|
||||
</ProjectReference>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Game.h" />
|
||||
<ClInclude Include="IGame.h" />
|
||||
<ClInclude Include="Level.h" />
|
||||
<ClInclude Include="Object.h" />
|
||||
<ClInclude Include="Player.h" />
|
||||
<ClInclude Include="WorldObject.h" />
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Game.cpp" />
|
||||
<ClCompile Include="IGame.cpp" />
|
||||
<ClCompile Include="Level.cpp" />
|
||||
<ClCompile Include="Object.cpp" />
|
||||
<ClCompile Include="Player.cpp" />
|
||||
<ClCompile Include="WorldObject.cpp" />
|
||||
</ItemGroup>
|
||||
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
|
||||
<ImportGroup Label="ExtensionTargets">
|
||||
</ImportGroup>
|
||||
|
|
|
@ -14,4 +14,44 @@
|
|||
<Extensions>rc;ico;cur;bmp;dlg;rc2;rct;bin;rgs;gif;jpg;jpeg;jpe;resx;tiff;tif;png;wav;mfcribbon-ms</Extensions>
|
||||
</Filter>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClInclude Include="Game.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Level.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Object.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="Player.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="WorldObject.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
<ClInclude Include="IGame.h">
|
||||
<Filter>Header Files</Filter>
|
||||
</ClInclude>
|
||||
</ItemGroup>
|
||||
<ItemGroup>
|
||||
<ClCompile Include="Game.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Level.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Object.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="Player.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="WorldObject.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
<ClCompile Include="IGame.cpp">
|
||||
<Filter>Source Files</Filter>
|
||||
</ClCompile>
|
||||
</ItemGroup>
|
||||
</Project>
|
|
@ -0,0 +1,36 @@
|
|||
#include "IGame.h"
|
||||
#include "Game.h"
|
||||
#include <windows.h>
|
||||
|
||||
BOOL WINAPI DllMain(
|
||||
_In_ HINSTANCE hinstDLL,
|
||||
_In_ DWORD fdwReason,
|
||||
_In_ LPVOID lpvReserved
|
||||
)
|
||||
{
|
||||
return TRUE;
|
||||
}
|
||||
using namespace GameLogic;
|
||||
IGame::IGame()
|
||||
{
|
||||
gameModule = new Game();
|
||||
}
|
||||
|
||||
|
||||
IGame::~IGame()
|
||||
{
|
||||
delete gameModule;
|
||||
}
|
||||
|
||||
void IGame::Init()
|
||||
{
|
||||
gameModule->Init();
|
||||
}
|
||||
void IGame::StartGame()
|
||||
{
|
||||
gameModule->StartGame();
|
||||
}
|
||||
void IGame::Update()
|
||||
{
|
||||
gameModule->Update();
|
||||
}
|
|
@ -0,0 +1,31 @@
|
|||
#ifndef IGAME_H
|
||||
#define IGAME_H
|
||||
|
||||
#if defined DLL_EXPORT
|
||||
#define DLL_USAGE __declspec(dllexport)
|
||||
#else
|
||||
#define DLL_USAGE __declspec(dllimport)
|
||||
#endif
|
||||
|
||||
|
||||
namespace GameLogic
|
||||
{
|
||||
class Game;
|
||||
|
||||
class DLL_USAGE IGame
|
||||
{
|
||||
private:
|
||||
Game* gameModule;
|
||||
public:
|
||||
IGame();
|
||||
~IGame();
|
||||
|
||||
void Init();
|
||||
void StartGame();
|
||||
void Update();
|
||||
private:
|
||||
};
|
||||
}
|
||||
|
||||
|
||||
#endif
|
|
@ -122,6 +122,7 @@
|
|||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\OysterGraphics;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
@ -140,6 +141,7 @@
|
|||
<IntrinsicFunctions>true</IntrinsicFunctions>
|
||||
<PreprocessorDefinitions>WIN32;NDEBUG;_WINDOWS;%(PreprocessorDefinitions)</PreprocessorDefinitions>
|
||||
<SDLCheck>true</SDLCheck>
|
||||
<AdditionalIncludeDirectories>..\OysterGraphics;..\OysterMath;..\Misc;%(AdditionalIncludeDirectories)</AdditionalIncludeDirectories>
|
||||
</ClCompile>
|
||||
<Link>
|
||||
<SubSystem>Windows</SubSystem>
|
||||
|
|
|
@ -0,0 +1 @@
|
|||
//Interface for others
|
|
@ -0,0 +1,11 @@
|
|||
#include "Level.h"
|
||||
|
||||
|
||||
Level::Level(void)
|
||||
{
|
||||
}
|
||||
|
||||
|
||||
Level::~Level(void)
|
||||
{
|
||||
}
|
|
@ -0,0 +1,10 @@
|
|||
#pragma once
|
||||
#include "GamePhysics.h"
|
||||
|
||||
class Level
|
||||
{
|
||||
public:
|
||||
Level(void);
|
||||
~Level(void);
|
||||
};
|
||||
|
Loading…
Reference in New Issue