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

#include <CommonTapeRecorder.h>

Public Member Functions

 CommonTapeRecorder (TestController *controller)
 
template<class Callback , class T = std::decay_t<std::invoke_result_t<Callback>>>
TestTape< T > custom (Callback callback)
 
TestTape< int64_t > totalExperience ()
 
TestTape< int > totalHp ()
 
TestTape< int > totalItemCount ()
 
TestTape< int > totalHirelings ()
 
TestTape< bool > hasItem (ItemId itemId)
 
TestTape< int > gold ()
 
TestTape< int > food ()
 
TestTape< int > deaths ()
 
TestTape< MapIdmap ()
 
TestTape< ScreenTypescreen ()
 
TestTape< std::string > statusBar ()
 
TestTape< DialogueIddialogueType ()
 
TestTape< Timetime ()
 
TestTape< bool > turnBasedMode ()
 
template<class T >
TestTape< T > config (const ConfigEntry< T > &entry)
 
TestTape< int > mapItemCount ()
 
TestTape< int > mapItemCount (ItemId itemId)
 
TestTape< HouseIdhouse ()
 
TestMultiTape< SpriteIdsprites ()
 
TestTape< int > activeCharacterIndex ()
 
TestTape< bool > questBit (QuestBit bit)
 
TestMultiTape< SoundIdsounds ()
 
TestMultiTape< std::string > hudTextures ()
 
TestMultiTape< std::string > messageBoxes ()
 
TestMultiTape< std::string > allGUIWindowsText ()
 
TestMultiTape< SpecialAttackTypespecialAttacks ()
 

Private Attributes

TestController_controller = nullptr
 

Constructor & Destructor Documentation

◆ CommonTapeRecorder()

CommonTapeRecorder::CommonTapeRecorder ( TestController controller)
explicit

Member Function Documentation

◆ activeCharacterIndex()

TestTape< int > CommonTapeRecorder::activeCharacterIndex ( )

◆ allGUIWindowsText()

TestMultiTape< std::string > CommonTapeRecorder::allGUIWindowsText ( )

Return a tape object of strings listing all the text drawn by GUIWindow::DrawText. TODO(pskelton): Tape will be spammy as it is recording everything.

Returns
Tape object.

◆ config()

template<class T >
TestTape< T > CommonTapeRecorder::config ( const ConfigEntry< T > &  entry)
inline

◆ custom()

template<class Callback , class T = std::decay_t<std::invoke_result_t<Callback>>>
TestTape< T > CommonTapeRecorder::custom ( Callback  callback)
inline

Creates a tape object that will record changes in a value computed by the provided callback throughout the execution of a trace.

The callback is called on every frame, and also before and after running the trace, and unique values are stored on a tape. This effectively means that if, for example, the provided callback always returns the same value, then you'll get a tape of size 1.

A typical use case is to create a tape, call TestController::playTraceFromTestData to play a trace, then check the data stored on the tape.

Parameters
callbackCallback that will calculate the values to store on a tape.
Returns
Tape object.

◆ deaths()

TestTape< int > CommonTapeRecorder::deaths ( )

◆ dialogueType()

TestTape< DialogueId > CommonTapeRecorder::dialogueType ( )

◆ food()

TestTape< int > CommonTapeRecorder::food ( )

◆ gold()

TestTape< int > CommonTapeRecorder::gold ( )

◆ hasItem()

TestTape< bool > CommonTapeRecorder::hasItem ( ItemId  itemId)

◆ house()

TestTape< HouseId > CommonTapeRecorder::house ( )

◆ hudTextures()

TestMultiTape< std::string > CommonTapeRecorder::hudTextures ( )

◆ map()

TestTape< MapId > CommonTapeRecorder::map ( )

◆ mapItemCount() [1/2]

TestTape< int > CommonTapeRecorder::mapItemCount ( )

◆ mapItemCount() [2/2]

TestTape< int > CommonTapeRecorder::mapItemCount ( ItemId  itemId)

◆ messageBoxes()

TestMultiTape< std::string > CommonTapeRecorder::messageBoxes ( )

Return a tape object of strings listing all the hints whenever a pop up message box was called.

Returns
Tape object.

◆ questBit()

TestTape< bool > CommonTapeRecorder::questBit ( QuestBit  bit)

◆ screen()

TestTape< ScreenType > CommonTapeRecorder::screen ( )

◆ sounds()

TestMultiTape< SoundId > CommonTapeRecorder::sounds ( )

◆ specialAttacks()

TestMultiTape< SpecialAttackType > CommonTapeRecorder::specialAttacks ( )

Return a tape object of SpecialAttackTypes listing all the special attack attempts on the party.

Returns
Tape object.

◆ sprites()

TestMultiTape< SpriteId > CommonTapeRecorder::sprites ( )

◆ statusBar()

TestTape< std::string > CommonTapeRecorder::statusBar ( )

◆ time()

TestTape< Time > CommonTapeRecorder::time ( )

◆ totalExperience()

TestTape< int64_t > CommonTapeRecorder::totalExperience ( )

◆ totalHirelings()

TestTape< int > CommonTapeRecorder::totalHirelings ( )

◆ totalHp()

TestTape< int > CommonTapeRecorder::totalHp ( )

◆ totalItemCount()

TestTape< int > CommonTapeRecorder::totalItemCount ( )

◆ turnBasedMode()

TestTape< bool > CommonTapeRecorder::turnBasedMode ( )

Member Data Documentation

◆ _controller

TestController* CommonTapeRecorder::_controller = nullptr
private

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