1
0
forked from 0ad/0ad
0ad/source/ps/Player.h

42 lines
787 B
C
Raw Normal View History

#ifndef _Player_H
#define _Player_H
#include "CStr.h"
2005-01-18 11:48:51 +01:00
#include "scripting/ScriptableObject.h"
#include "scripting/ScriptCustomTypes.h"
#include "EntityHandles.h"
class CNetMessage;
2005-01-18 11:48:51 +01:00
typedef SColour SPlayerColour;
class CPlayer : public CJSObject<CPlayer>
{
2005-01-18 11:48:51 +01:00
// FIXME: These shouldn't be public (need load-from-attributes method in game.cpp)
public:
CStrW m_Name;
uint m_PlayerID;
2005-01-18 11:48:51 +01:00
SPlayerColour m_Colour;
public:
2005-01-18 11:48:51 +01:00
CPlayer( uint playerID );
bool ValidateCommand(CNetMessage *pMsg);
inline const CStrW &GetName() const
{ return m_Name; }
2005-01-18 11:48:51 +01:00
// Caller frees...
std::vector<HEntity>* GetControlledEntities();
// Scripting functions
jsval ToString( JSContext* context, uintN argc, jsval* argv );
jsval GetControlledEntities_JS();
static void ScriptingInit();
};
#endif