Framework for movement and action orders, plus some better organisation of the test code
This commit is contained in:
parent
008739dee6
commit
72b35dbc06
5 changed files with 115 additions and 44 deletions
|
@ -11,6 +11,20 @@
|
|||
// Type for all orders ( as a char )
|
||||
typedef char order_c;
|
||||
|
||||
// Movement orders
|
||||
static const order_c sk_movementOrders[] =
|
||||
{
|
||||
'F', // Forward
|
||||
};
|
||||
|
||||
// Action orders
|
||||
static const order_c sk_actionOrders[] =
|
||||
{
|
||||
'L', // Left
|
||||
'R', // Right
|
||||
'A', // Attack
|
||||
};
|
||||
|
||||
// Container for an order
|
||||
struct COrder
|
||||
{
|
||||
|
@ -36,7 +50,10 @@ typedef std::vector<COrder> COrderVector;
|
|||
|
||||
// Order strings stored as simply "[unit id] [order char]"
|
||||
// string <--> order conversion functions
|
||||
std::string GetStringFromOrder( COrder& order );
|
||||
COrder GetOrderFromString( std::string order );
|
||||
std::string GetStringFromOrder(const COrder& order );
|
||||
COrder GetOrderFromString( const std::string& order );
|
||||
|
||||
bool isMovementOrder( const COrder& order );
|
||||
bool isActionOrder( const COrder& order );
|
||||
|
||||
#endif //_ORDERS_H_
|
Loading…
Add table
Add a link
Reference in a new issue