entity system

This commit is contained in:
Ben Kyd
2020-08-29 23:57:23 +00:00
parent 65f2568dc1
commit 7f076ecc87
8 changed files with 1897 additions and 2 deletions

View File

@@ -0,0 +1,3 @@
#include "Dungeon.hpp"

View File

@@ -0,0 +1,10 @@
#ifndef GREATMACHINE_DUNGEON_H_
#define GREATMACHINE_DUNGEON_H_
class Dungeon
{
public:
};
#endif

View File

@@ -1,5 +1,5 @@
#ifndef F4MPSERVER_LOGGER_H_
#define F4MPSERVER_LOGGER_H_
#ifndef GREATMACHINE_LOGGER_H_
#define GREATMACHINE_LOGGER_H_
#include <filesystem>
#include <iostream>

View File

@@ -141,12 +141,16 @@
</Link>
</ItemDefinitionGroup>
<ItemGroup>
<ClCompile Include="Dungeon.cpp" />
<ClCompile Include="Logger.cpp" />
<ClCompile Include="main.cpp" />
<ClCompile Include="Things.cpp" />
</ItemGroup>
<ItemGroup>
<ClInclude Include="Dungeon.hpp" />
<ClInclude Include="Logger.hpp" />
<ClInclude Include="olcPixelGameEngine.hpp" />
<ClInclude Include="Things.hpp" />
</ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets">

View File

@@ -21,6 +21,12 @@
<ClCompile Include="Logger.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Dungeon.cpp">
<Filter>Source Files</Filter>
</ClCompile>
<ClCompile Include="Things.cpp">
<Filter>Source Files</Filter>
</ClCompile>
</ItemGroup>
<ItemGroup>
<ClInclude Include="olcPixelGameEngine.hpp">
@@ -29,5 +35,11 @@
<ClInclude Include="Logger.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Dungeon.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="Things.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

View File

@@ -0,0 +1,2 @@
#include "Things.hpp"

View File

@@ -0,0 +1,75 @@
#ifndef GREATMACHINE_THINGS_H_
#define GREATMACHINE_THINGS_H_
#include <optional>
#include "olcPixelGameEngine.hpp"
namespace ETile
{
enum Type
{
Backdrop,
Floor,
Wall
};
enum State
{
Default,
Exploded
};
}
namespace EEntity
{
enum Type
{
Item,
FixedItem,
Player,
Enemy,
Boss
};
enum Item
{
None,
Sword
};
// Fixed items can have states #door open / closed
enum FixedItem
{
Torch,
Door
};
}
class Entity
{
public:
olc::vd2d Coords;
EEntity::Type Type;
};
class Item : public Entity
{
public:
EEntity::Item Item;
};
class FixedItem : public Entity
{
EEntity::FixedItem Item;
};
class Tile
{
public:
olc::vd2d Coords;
ETile::Type Type;
ETile::State State;
};
#endif

File diff suppressed because it is too large Load Diff