entity system
This commit is contained in:
3
The Great Machine/Dungeon.cpp
Normal file
3
The Great Machine/Dungeon.cpp
Normal file
@@ -0,0 +1,3 @@
|
||||
#include "Dungeon.hpp"
|
||||
|
||||
|
||||
10
The Great Machine/Dungeon.hpp
Normal file
10
The Great Machine/Dungeon.hpp
Normal file
@@ -0,0 +1,10 @@
|
||||
#ifndef GREATMACHINE_DUNGEON_H_
|
||||
#define GREATMACHINE_DUNGEON_H_
|
||||
|
||||
class Dungeon
|
||||
{
|
||||
public:
|
||||
|
||||
};
|
||||
|
||||
#endif
|
||||
@@ -1,5 +1,5 @@
|
||||
#ifndef F4MPSERVER_LOGGER_H_
|
||||
#define F4MPSERVER_LOGGER_H_
|
||||
#ifndef GREATMACHINE_LOGGER_H_
|
||||
#define GREATMACHINE_LOGGER_H_
|
||||
|
||||
#include <filesystem>
|
||||
#include <iostream>
|
||||
|
||||
@@ -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">
|
||||
|
||||
@@ -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>
|
||||
2
The Great Machine/Things.cpp
Normal file
2
The Great Machine/Things.cpp
Normal file
@@ -0,0 +1,2 @@
|
||||
#include "Things.hpp"
|
||||
|
||||
75
The Great Machine/Things.hpp
Normal file
75
The Great Machine/Things.hpp
Normal 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
Reference in New Issue
Block a user