More skeleton code for simulating a turn

Use enum classes for safe enums
This commit is contained in:
Marc Di Luzio 2014-12-16 13:13:01 +00:00
parent b43248e89f
commit e310acfaf8
9 changed files with 983 additions and 25 deletions

View file

@ -9,20 +9,26 @@
#define ORDER_DELIMITER ' '
// Type for all orders ( as a char )
typedef char order_c;
enum class order_c : char
{
F = 'F',
L = 'L',
R = 'R',
A = 'A'
};
// Movement orders
static const order_c sk_movementOrders[] =
{
'F', // Forward
order_c::F, // Forward
};
// Action orders
static const order_c sk_actionOrders[] =
{
'L', // Left
'R', // Right
'A', // Attack
order_c::L, // Left
order_c::R, // Right
order_c::A, // Attack
};
// Container for an order
@ -56,4 +62,4 @@ COrder GetOrderFromString( const std::string& order );
bool isMovementOrder( const COrder& order );
bool isActionOrder( const COrder& order );
#endif //_ORDERS_H_
#endif //_ORDERS_H_