|
|
|
@ -51,31 +51,31 @@ You can contact Cyan Worlds, Inc. by email legal@cyan.com
|
|
|
|
|
|
|
|
|
|
#include "pyGlueHelpers.h" |
|
|
|
|
#include "pnKeyedObject/plKey.h" |
|
|
|
|
#include <string> |
|
|
|
|
#include "plString.h" |
|
|
|
|
|
|
|
|
|
class pyPlayer |
|
|
|
|
{ |
|
|
|
|
protected: |
|
|
|
|
plKey fAvatarKey; |
|
|
|
|
std::string fPlayerName; |
|
|
|
|
plString fPlayerName; |
|
|
|
|
uint32_t fPlayerID; |
|
|
|
|
float fDistSq; // from local player, temp
|
|
|
|
|
bool fIsCCR; |
|
|
|
|
bool fIsServer; |
|
|
|
|
|
|
|
|
|
pyPlayer(); // only used by python glue, do NOT call
|
|
|
|
|
pyPlayer(pyKey& avKey, const char* pname, uint32_t pid, float distsq); |
|
|
|
|
pyPlayer(plKey avKey, const char* pname, uint32_t pid, float distsq); |
|
|
|
|
pyPlayer(pyKey& avKey, const plString& pname, uint32_t pid, float distsq); |
|
|
|
|
pyPlayer(plKey avKey, const plString& pname, uint32_t pid, float distsq); |
|
|
|
|
// another way to create a player with just a name and number
|
|
|
|
|
pyPlayer(const char* pname, uint32_t pid); |
|
|
|
|
pyPlayer(const plString& pname, uint32_t pid); |
|
|
|
|
public: |
|
|
|
|
void Init(plKey avKey, const char* pname, uint32_t pid, float distsq); // used by python glue, do NOT call
|
|
|
|
|
void Init(plKey avKey, const plString& pname, uint32_t pid, float distsq); // used by python glue, do NOT call
|
|
|
|
|
|
|
|
|
|
// required functions for PyObject interoperability
|
|
|
|
|
PYTHON_CLASS_NEW_FRIEND(ptPlayer); |
|
|
|
|
static PyObject *New(pyKey& avKey, const char* pname, uint32_t pid, float distsq); |
|
|
|
|
static PyObject *New(plKey avKey, const char* pname, uint32_t pid, float distsq); |
|
|
|
|
static PyObject *New(const char* pname, uint32_t pid); |
|
|
|
|
static PyObject *New(pyKey& avKey, const plString& pname, uint32_t pid, float distsq); |
|
|
|
|
static PyObject *New(plKey avKey, const plString& pname, uint32_t pid, float distsq); |
|
|
|
|
static PyObject *New(const plString& pname, uint32_t pid); |
|
|
|
|
PYTHON_CLASS_CHECK_DEFINITION; // returns true if the PyObject is a pyPlayer object
|
|
|
|
|
PYTHON_CLASS_CONVERT_FROM_DEFINITION(pyPlayer); // converts a PyObject to a pyPlayer (throws error if not correct type)
|
|
|
|
|
|
|
|
|
@ -96,7 +96,7 @@ public:
|
|
|
|
|
plKey GetKey() const { return fAvatarKey; } |
|
|
|
|
|
|
|
|
|
// for python access
|
|
|
|
|
const char * GetPlayerName() const { return fPlayerName.c_str();} |
|
|
|
|
plString GetPlayerName() const { return fPlayerName; } |
|
|
|
|
uint32_t GetPlayerID() const { return fPlayerID; } |
|
|
|
|
|
|
|
|
|
float GetDistSq() const { return fDistSq; } |
|
|
|
|