Began reworking the network code

This commit devides SerialPacket into a series of different structures,
all decended from a common base class.

Using a union was not a good idea.
This commit is contained in:
Kayne Ruse
2014-06-04 20:46:05 +10:00
parent 0a03535ecb
commit da60fa8f94
17 changed files with 505 additions and 201 deletions
+5 -6
View File
@@ -35,11 +35,11 @@
//std namespace
#include <chrono>
#include <list>
#include <array>
#include <utility>
#define COMBAT_MAX_CHARACTER_COUNT 12
#define COMBAT_MAX_ENEMY_COUNT 12
#define COMBAT_MAX_CHARACTERS 12
#define COMBAT_MAX_ENEMIES 12
struct CombatData {
enum class Terrain {
@@ -50,9 +50,8 @@ struct CombatData {
typedef std::chrono::steady_clock Clock;
//combatants, point to the std::map's internal pairs
std::list<std::pair<const int, CharacterData>*> characterList;
std::list<std::pair<const int, EnemyData>*> enemyList;
std::array<CharacterData, COMBAT_MAX_CHARACTERS> characterArray;
std::array<EnemyData, COMBAT_MAX_ENEMIES> enemyArray;
//world interaction
int mapIndex = 0;