IPlayTest class
#include <Jazz2/Editor/Runtime/PlayTest.h>
A level being played from the editor, see PlayTestLevelHandler.
Derived classes
- class PlayTestLevelHandler
- Plays a level being edited.
- class PlayTestMpLevelHandler
- Plays a level being edited as multiplayer in local splitscreen.
Public static functions
-
static auto SaveLevel(const LevelDocument& document,
StringView levelName,
SmallVectorImpl<std::
uint8_t>& data) -> bool - Writes the level to play into bytes as the game reads it.
Constructors, destructors, conversion operators
- IPlayTest() defaulted
- ~IPlayTest() virtual
- IPlayTest(const IPlayTest&) deleted
Public functions
- auto operator=(const IPlayTest&) -> IPlayTest& deleted
- auto GetLevelHandler() -> LevelHandler& pure virtual
- Returns the level handler that plays it.
-
auto GetViewport() const -> Rendering::
PlayerViewport* pure virtual - Returns the viewport of the first player, or
nullptr. -
auto GetPlayer() const -> Actors::
Player* pure virtual - Returns the first player, or
nullptr. - auto GetFrameTexture() const -> Texture* pure virtual
- Returns the texture the last frame was drawn into before it was scaled to the screen.
- void Suspend() pure virtual
- Stops the level for a while, it's kept as it is, its music and sound effects are paused.
- void Resume() pure virtual
- Continues the level after Suspend(), with the sound effects it paused.
- auto GetPlayPath() -> PlayPath&
- Returns the recorded path of the first player.
- auto HasSpawnFallenBack() const -> bool
- Returns
trueif the player didn't start where it was asked to, but at the start of the level.
Public variables
- Function<void()> OnExitEditor
- Called when the player chooses to leave the editor from the pause menu.
Protected functions
- void RetainResources()
- Keeps everything loaded for as long as the play-test lives, called once its level was loaded.
Protected variables
Function documentation
void Jazz2:: Editor:: IPlayTest:: RetainResources() protected
Keeps everything loaded for as long as the play-test lives, called once its level was loaded.
The level shown by the editor is loaded again while a play-test is kept, and so is the level of the next play-test before the kept one is let go, neither of them may release what the play-test still uses, see ContentResolver::