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;
+6
View File
@@ -30,6 +30,12 @@ struct RoomData {
FORESTS,
CAVES,
};
/* TODO: more
* "multiple rooms system" using this structure
* Pager
* collision map
*/
};
#endif
-3
View File
@@ -31,7 +31,4 @@
* Since most/all of the files in this directory are header files, I've created
* this source file as a "sanity check", to ensure that the above header files
* are written correctly via make.
*
* Oddly enough, I'm pretty sure this is the first directory compiled in a
* clean build.
*/