penguins  1.0.0
BotThread Class Reference
Inheritance diagram for BotThread:
[legend]

Detailed Description

Definition at line 31 of file bot_thread.hh.

Public Member Functions

 BotThread (BotTurnController *controller)
 
virtual ~BotThread ()
 
void cancel ()
 
- Public Member Functions inherited from wxThread
 wxThread (wxThreadKind kind=wxTHREAD_DETACHED)
 
virtual ~wxThread ()
 
wxThreadError Create (unsigned int stackSize=0)
 
wxThreadError Delete (ExitCode *rc=NULL, wxThreadWait waitMode=wxTHREAD_WAIT_DEFAULT)
 
wxThreadIdType GetId () const
 
WXHANDLE MSWGetHandle () const
 
wxThreadKind GetKind () const
 
unsigned int GetPriority () const
 
bool IsAlive () const
 
bool IsDetached () const
 
bool IsPaused () const
 
bool IsRunning () const
 
wxThreadError Kill ()
 
wxThreadError Pause ()
 
wxThreadError Resume ()
 
wxThreadError Run ()
 
void SetPriority (unsigned int priority)
 
virtual bool TestDestroy ()
 
ExitCode Wait (wxThreadWait flags=wxTHREAD_WAIT_DEFAULT)
 

Data Fields

std::shared_ptr< BotThreadSharedshared { new BotThreadShared() }
 

Protected Member Functions

virtual void OnExit () override
 
bool SetName (const wxString &WXUNUSED(name))
 
- Protected Member Functions inherited from wxThread
virtual ExitCode Entry ()=0
 
void Exit (ExitCode exitcode=0)
 
bool SetName (const wxString &name)
 

Protected Attributes

BotTurnControllercontroller
 
std::unique_ptr< Game, decltype(&game_free)> game { nullptr, game_free }
 
std::shared_ptr< BotParametersbot_params { nullptr }
 
std::unique_ptr< BotState, decltype(&bot_state_free)> bot_state { nullptr, bot_state_free }
 
BetterRng rng
 
volatile bool * cancelled_ptr = nullptr
 

Additional Inherited Members

- Public Types inherited from wxThread
typedef void * ExitCode
 
- Static Public Member Functions inherited from wxThread
static int GetCPUCount ()
 
static wxThreadIdType GetCurrentId ()
 
static wxThreadIdType GetMainId ()
 
static bool IsMain ()
 
static bool SetConcurrency (size_t level)
 
static void Sleep (unsigned long milliseconds)
 
static wxThreadThis ()
 
static void Yield ()
 
- Static Protected Member Functions inherited from wxThread
static bool SetNameForCurrent (const wxString &name)
 

Field Documentation

◆ shared

std::shared_ptr<BotThreadShared> BotThread::shared { new BotThreadShared() }

◆ controller

BotTurnController* BotThread::controller
protected

Definition at line 49 of file bot_thread.hh.

Referenced by BotPlacementThread::Entry(), BotMovementThread::Entry(), and OnExit().

◆ game

std::unique_ptr<Game, decltype(&game_free)> BotThread::game { nullptr, game_free }
protected

Definition at line 50 of file bot_thread.hh.

Referenced by BotThread().

◆ bot_params

std::shared_ptr<BotParameters> BotThread::bot_params { nullptr }
protected

Definition at line 51 of file bot_thread.hh.

Referenced by BotThread().

◆ bot_state

std::unique_ptr<BotState, decltype(&bot_state_free)> BotThread::bot_state { nullptr, bot_state_free }
protected

Definition at line 52 of file bot_thread.hh.

Referenced by BotThread(), BotPlacementThread::Entry(), and BotMovementThread::Entry().

◆ rng

BetterRng BotThread::rng
protected

Definition at line 53 of file bot_thread.hh.

◆ cancelled_ptr

volatile bool* BotThread::cancelled_ptr = nullptr
protected

Definition at line 54 of file bot_thread.hh.

Referenced by BotThread(), cancel(), and ~BotThread().

Constructor & Destructor Documentation

◆ BotThread()

BotThread::BotThread ( BotTurnController controller)

Definition at line 25 of file bot_thread.cc.

◆ ~BotThread()

BotThread::~BotThread ( )
virtual

Definition at line 32 of file bot_thread.cc.

Member Function Documentation

◆ cancel()

void BotThread::cancel ( )

Definition at line 36 of file bot_thread.cc.

Referenced by BotTurnController::stop_bot_thread().

◆ OnExit()

void BotThread::OnExit ( )
overrideprotectedvirtual

Definition at line 40 of file bot_thread.cc.

◆ SetName()

bool BotThread::SetName ( const wxString WXUNUSEDname)
inlineprotected

Definition at line 44 of file bot_thread.hh.

Referenced by BotPlacementThread::Entry(), and BotMovementThread::Entry().


The documentation for this class was generated from the following files: