Commit eb26f8fc authored by Matthew Hausknecht's avatar Matthew Hausknecht Committed by GitHub

Merge pull request #23 from DurgeshSamant/python-agents-unum-support

added unum support for python agents
parents e20696d1 227ed9dd
...@@ -74,6 +74,8 @@ hfo_lib.actionToString.argtypes = [c_int] ...@@ -74,6 +74,8 @@ hfo_lib.actionToString.argtypes = [c_int]
hfo_lib.actionToString.restype = c_char_p hfo_lib.actionToString.restype = c_char_p
hfo_lib.statusToString.argtypes = [c_int] hfo_lib.statusToString.argtypes = [c_int]
hfo_lib.statusToString.restype = c_char_p hfo_lib.statusToString.restype = c_char_p
hfo_lib.getUnum.argtypes = [c_void_p]
hfo_lib.getUnum.restype = c_int
class HFOEnvironment(object): class HFOEnvironment(object):
def __init__(self): def __init__(self):
...@@ -149,3 +151,7 @@ class HFOEnvironment(object): ...@@ -149,3 +151,7 @@ class HFOEnvironment(object):
def statusToString(self, status): def statusToString(self, status):
""" Returns a string representation of a game status """ """ Returns a string representation of a game status """
return hfo_lib.statusToString(status) return hfo_lib.statusToString(status)
def getUnum(self):
""" Return the uniform number of the agent """
return hfo_lib.getUnum(self.obj)
...@@ -47,6 +47,7 @@ extern "C" { ...@@ -47,6 +47,7 @@ extern "C" {
StatusToString(status); // TODO: OSX requires two calls...?! StatusToString(status); // TODO: OSX requires two calls...?!
return StatusToString(status).c_str(); return StatusToString(status).c_str();
} }
int getUnum(hfo::HFOEnvironment *hfo) {return hfo->getUnum();}
} }
#endif #endif
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment