Rename orders -> order

This commit is contained in:
Marc Di Luzio 2014-12-16 13:13:02 +00:00
parent 8a486fdd40
commit 714fd2894d
5 changed files with 4 additions and 4 deletions

35
game/order.cpp Normal file
View file

@ -0,0 +1,35 @@
#include <string.h>
#include "order.h"
#include "mathtypes.h"
// Convert an order to a string
std::string GetStringFromOrder(const COrder& order )
{
static char buff[128];
memset(buff,0,sizeof(buff));
snprintf(buff,128, ORDER_FORMATTER,
order.command,
order.unit);
return buff;
}
// Convert a string to an order
COrder GetOrderFromString( const std::string& order )
{
COrder ret;
char corder;
unsigned int unit;
sscanf(order.c_str(), ORDER_FORMATTER,
&corder,
&unit);
ret.command = (command_c)corder;
ret.unit = unit;
return ret;
}