Jazz2::Editor::PlayOverlays class

What is shown over the level being edited of how it's played.

Where the player can get from the start, found by the route tracer of multiplayer and found again once the level stopped changing for a moment, and the places where the player died in the last play-tests.

Constructors, destructors, conversion operators

PlayOverlays(IEditorContext& context) explicit
Creates what is shown over the level of an editor, nothing is shown yet.
PlayOverlays(const PlayOverlays&) deleted

Public functions

auto operator=(const PlayOverlays&) -> PlayOverlays& deleted
auto GetReachability() const -> ArrayView<const std::int32_t>
Returns how far each tile of the sprite layer is from the start, for the player, row by row.
auto GetReachabilityMaxDistance() const -> std::int32_t
Returns the largest distance of GetReachability(), at least 1, found once when it's computed.
auto IsReachabilityShown() const -> bool
Returns true while it's shown where the player can get.
auto ComputeReachability(SmallVectorImpl<std::int32_t>& distances, std::int32_t character, bool fromMultiplayerStarts) -> bool
Finds where the player can get, as the level is loaded now.
void RecomputeReachability(bool reload)
Finds again where the player can get, as the settings say, with reload the level is loaded again first for its events.
void ToggleReachability()
Shows where the player can get, telling how many tiles it is, or stops showing it.
void HideReachability()
Stops showing where the player can get, as when another level is edited.
void NoteDocumentChanges(const DocumentChanges& changes)
Tells about changes of the level, where the player can get is found again once they stop for a moment.
void Update(float timeMult, bool strokeInProgress)
Finds again where the player can get once the level stopped changing, not while strokeInProgress.
void DrawDeaths(Painter& painter, const Rectf& viewRect)
Draws the places where the player died in the last play-tests, if the settings say so.

Function documentation

ArrayView<const std::int32_t> Jazz2::Editor::PlayOverlays::GetReachability() const

Returns how far each tile of the sprite layer is from the start, for the player, row by row.

-1 where the player can't get. Empty while it's not shown, see ToggleReachability().

bool Jazz2::Editor::PlayOverlays::ComputeReachability(SmallVectorImpl<std::int32_t>& distances, std::int32_t character, bool fromMultiplayerStarts)

Finds where the player can get, as the level is loaded now.

With the moves of only character, see PlayerType, 0 for any, from its start, and with fromMultiplayerStarts from the starts of multiplayer too, each tile as far as from the nearest of them. Returns false if it can't be found out, as without the start or without multiplayer compiled in, whose route tracer it uses.