OpenEnroth 73e68f7
Loading...
Searching...
No Matches
Public Member Functions | Private Member Functions | Private Attributes | Friends | List of all members
EngineTracePlayer Class Reference

#include <EngineTracePlayer.h>

Inheritance diagram for EngineTracePlayer:
PlatformApplicationAware

Public Member Functions

 EngineTracePlayer ()
 
 ~EngineTracePlayer ()
 
void playTrace (EngineController *game, const EngineTraceRecording &recording, EngineTracePlaybackFlags flags=0, std::function< void()> postLoadCallback={})
 
bool isPlaying () const
 

Private Member Functions

void checkSaveFileSize (const EngineTraceRecording &recording, int expectedSaveFileSize)
 
void checkAfterLoadRng (const EngineTraceRecording &recording, int expectedRandomState)
 
void checkState (const EngineTraceRecording &recording, const EventTraceGameState &expectedState, bool isStart)
 
- Private Member Functions inherited from PlatformApplicationAware
 ~PlatformApplicationAware ()=default
 
PlatformApplicationapplication () const
 
template<class T >
T * component () const
 
virtual void installNotify ()
 
virtual void removeNotify ()
 

Private Attributes

EngineTracePlaybackFlags _flags
 
std::unique_ptr< EventTrace_trace
 

Friends

class PlatformIntrospection
 

Detailed Description

Component that exposes a trace playback interface.

Depends on EngineDeterministicComponent and EngineTraceSimplePlayer, install them into PlatformApplication first.

See also
EngineTraceRecorder

Constructor & Destructor Documentation

◆ EngineTracePlayer()

EngineTracePlayer::EngineTracePlayer ( )

◆ ~EngineTracePlayer()

EngineTracePlayer::~EngineTracePlayer ( )

Member Function Documentation

◆ checkAfterLoadRng()

void EngineTracePlayer::checkAfterLoadRng ( const EngineTraceRecording recording,
int  expectedRandomState 
)
private

◆ checkSaveFileSize()

void EngineTracePlayer::checkSaveFileSize ( const EngineTraceRecording recording,
int  expectedSaveFileSize 
)
private

◆ checkState()

void EngineTracePlayer::checkState ( const EngineTraceRecording recording,
const EventTraceGameState expectedState,
bool  isStart 
)
private

◆ isPlaying()

bool EngineTracePlayer::isPlaying ( ) const
inline

◆ playTrace()

void EngineTracePlayer::playTrace ( EngineController game,
const EngineTraceRecording recording,
EngineTracePlaybackFlags  flags = 0,
std::function< void()>  postLoadCallback = {} 
)

Plays a previously recorded trace. Can be called only from a control thread of EngineControlComponent.

Parameters
gameEngine controller.
recordingRecorded trace.
flagsPlayback flags.
postLoadCallbackCallback to call once the saved game is loaded.

Friends And Related Function Documentation

◆ PlatformIntrospection

friend class PlatformIntrospection
friend

Member Data Documentation

◆ _flags

EngineTracePlaybackFlags EngineTracePlayer::_flags
private

◆ _trace

std::unique_ptr<EventTrace> EngineTracePlayer::_trace
private

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