HoverRace
2.0
|
Scripting peer for a game session. More...
#include <SessionPeer.h>
Classes | |
class | PlayerRef |
Public Member Functions | |
SessionPeer (Script::Core &scripting, ClientSession *session) | |
virtual | ~SessionPeer () |
template<class Fn > | |
void | ForEachPlayer (Fn fn) |
std::shared_ptr< MetaPlayer > & | GetPlayer (unsigned idx) |
void | LCountdownToNextPhase (const std::string &s) const |
std::shared_ptr< Util::Clock > | LGetClock () const |
std::shared_ptr< Util::Clock > | LGetCountdown () const |
int | LGetNumPlayers () const |
MR_SimulationTime | LGetTime () const |
std::shared_ptr< TrackPeer > | LGetTrack () const |
void | OnSessionEnd () |
Signal that the session has ended. More... | |
void | OnSessionStart (ClientSession *session) |
Attach a session. More... | |
void | SetMeta (MetaSession *meta) |
Public Member Functions inherited from HoverRace::Script::Peer | |
Peer (Core &scripting, const std::string &name) | |
Peer (const Peer &)=delete | |
virtual | ~Peer () |
Core & | GetScripting () const |
void | LHelp () |
void | LHelp_M (const std::string &methodName) |
Peer & | operator= (const Peer &)=delete |
Static Public Member Functions | |
static void | Register (Script::Core &scripting) |
Register this peer in an environment. More... | |
Static Public Member Functions inherited from HoverRace::Script::Peer | |
static void | Register (Core &scripting) |
Protected Member Functions | |
void | VerifySession () const |
Verify that the session is still active. More... | |
Private Types | |
using | SUPER = Script::Peer |
Private Attributes | |
MetaSession * | meta |
std::vector< std::unique_ptr< PlayerRef > > | playerRefs |
luabind::object | players |
luabind::object | rules |
ClientSession * | session |
Scripting peer for a game session.
|
private |
HoverRace::Client::HoverScript::SessionPeer::SessionPeer | ( | Script::Core & | scripting, |
ClientSession * | session | ||
) |
|
virtual |
|
inline |
|
inline |
void HoverRace::Client::HoverScript::SessionPeer::LCountdownToNextPhase | ( | const std::string & | s | ) | const |
std::shared_ptr< Util::Clock > HoverRace::Client::HoverScript::SessionPeer::LGetClock | ( | ) | const |
std::shared_ptr< Util::Clock > HoverRace::Client::HoverScript::SessionPeer::LGetCountdown | ( | ) | const |
int HoverRace::Client::HoverScript::SessionPeer::LGetNumPlayers | ( | ) | const |
MR_SimulationTime HoverRace::Client::HoverScript::SessionPeer::LGetTime | ( | ) | const |
std::shared_ptr< TrackPeer > HoverRace::Client::HoverScript::SessionPeer::LGetTrack | ( | ) | const |
void HoverRace::Client::HoverScript::SessionPeer::OnSessionEnd | ( | ) |
Signal that the session has ended.
This will detach this peer from the session.
void HoverRace::Client::HoverScript::SessionPeer::OnSessionStart | ( | ClientSession * | session | ) |
Attach a session.
session | The session to attach (may be nullptr ). |
|
static |
Register this peer in an environment.
scripting | The target environment. |
|
inline |
|
protected |
Verify that the session is still active.
If the session is no longer active, then a Lua error will be triggered and this function will not return.
|
private |
|
private |
|
private |
|
private |
|
private |