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

#include <TestController.h>

Public Member Functions

 TestController (EngineController *controller, FileSystem *tfs, float playbackSpeed)
 
 ~TestController ()
 
void loadGameFromTestData (std::string_view name)
 
void playTraceFromTestData (std::string_view saveName, std::string_view traceName, std::function< void()> postLoadCallback={})
 
void playTraceFromTestData (std::string_view saveName, std::string_view traceName, EngineTracePlaybackFlags flags, std::function< void()> postLoadCallback={})
 
void prepareForNextTest ()
 
void prepareForNextTest (int frameTimeMs, RandomEngineType rngType)
 
bool isTaping () const
 
void startTaping ()
 
void stopTaping ()
 

Private Member Functions

void prepareForNextTestInternal ()
 
void adjustMaxFps ()
 
template<class Callback , class T = std::invoke_result_t<Callback>>
TestTape< T > recordTape (Callback callback)
 
template<class T >
TestMultiTape< T > recordFunctionTape (EngineCall call)
 

Private Attributes

EngineController_controller
 
FileSystem_tfs
 
float _playbackSpeed
 
TestCallObserver _callObserver
 
std::vector< std::function< void()> > _tapeCallbacks
 

Friends

class TestControllerTickCallback
 
class CharacterTapeRecorder
 
class CommonTapeRecorder
 
class ActorTapeRecorder
 

Constructor & Destructor Documentation

◆ TestController()

TestController::TestController ( EngineController controller,
FileSystem tfs,
float  playbackSpeed 
)

◆ ~TestController()

TestController::~TestController ( )

Member Function Documentation

◆ adjustMaxFps()

void TestController::adjustMaxFps ( )
private

◆ isTaping()

bool TestController::isTaping ( ) const

◆ loadGameFromTestData()

void TestController::loadGameFromTestData ( std::string_view  name)

◆ playTraceFromTestData() [1/2]

void TestController::playTraceFromTestData ( std::string_view  saveName,
std::string_view  traceName,
EngineTracePlaybackFlags  flags,
std::function< void()>  postLoadCallback = {} 
)

◆ playTraceFromTestData() [2/2]

void TestController::playTraceFromTestData ( std::string_view  saveName,
std::string_view  traceName,
std::function< void()>  postLoadCallback = {} 
)

◆ prepareForNextTest() [1/2]

void TestController::prepareForNextTest ( )

◆ prepareForNextTest() [2/2]

void TestController::prepareForNextTest ( int  frameTimeMs,
RandomEngineType  rngType 
)

◆ prepareForNextTestInternal()

void TestController::prepareForNextTestInternal ( )
private

◆ recordFunctionTape()

template<class T >
TestMultiTape< T > TestController::recordFunctionTape ( EngineCall  call)
inlineprivate

◆ recordTape()

template<class Callback , class T = std::invoke_result_t<Callback>>
TestTape< T > TestController::recordTape ( Callback  callback)
inlineprivate

◆ startTaping()

void TestController::startTaping ( )

◆ stopTaping()

void TestController::stopTaping ( )

Friends And Related Function Documentation

◆ ActorTapeRecorder

friend class ActorTapeRecorder
friend

◆ CharacterTapeRecorder

friend class CharacterTapeRecorder
friend

◆ CommonTapeRecorder

friend class CommonTapeRecorder
friend

◆ TestControllerTickCallback

friend class TestControllerTickCallback
friend

Member Data Documentation

◆ _callObserver

TestCallObserver TestController::_callObserver
private

◆ _controller

EngineController* TestController::_controller
private

◆ _playbackSpeed

float TestController::_playbackSpeed
private

◆ _tapeCallbacks

std::vector<std::function<void()> > TestController::_tapeCallbacks
private

◆ _tfs

FileSystem* TestController::_tfs
private

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