Skip to content

Commit

Permalink
Grant enhanced access to Receptor/GhostArrowRow init/load states
Browse files Browse the repository at this point in the history
  • Loading branch information
poco0317 committed Jan 28, 2021
1 parent 521a699 commit 2d6ff79
Show file tree
Hide file tree
Showing 2 changed files with 22 additions and 2 deletions.
13 changes: 12 additions & 1 deletion src/Etterna/Actor/Gameplay/GhostArrowRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,24 @@ class GhostArrowRow : public ActorFrame

void Load(const PlayerState* pPlayerState, float fYReverseOffset);
void SetColumnRenderers(vector<NoteColumnRenderer>& renderers);
int GetRendererCount() const
[[nodiscard]] int GetRendererCount() const
{
if (m_renderers != nullptr)
return m_renderers->size();
return 0;
}

// alias
[[nodiscard]] int GetGhostCount() const { return GetReceptorCount(); }
[[nodiscard]] int GetReceptorCount() const
{
return m_Ghost.size();
}

// Initialization happens before Loading
[[nodiscard]] bool isInitialized() const { return GetGhostCount() > 0; }
[[nodiscard]] bool isLoaded() const { return GetRendererCount() > 0; }

void DidTapNote(int iCol, TapNoteScore tns, bool bBright);
void DidHoldNote(int iCol, HoldNoteScore hns, bool bBright);
void SetHoldShowing(int iCol, const TapNote& tn);
Expand Down
11 changes: 10 additions & 1 deletion src/Etterna/Actor/Gameplay/ReceptorArrowRow.h
Original file line number Diff line number Diff line change
Expand Up @@ -19,13 +19,22 @@ class ReceptorArrowRow : public ActorFrame

void Load(const PlayerState* pPlayerState, float fYReverseOffset);
void SetColumnRenderers(vector<NoteColumnRenderer>& renderers);
int GetRendererCount() const
[[nodiscard]] int GetRendererCount() const
{
if (m_renderers != nullptr)
return m_renderers->size();
return 0;
}

[[nodiscard]] int GetReceptorCount() const
{
return m_ReceptorArrow.size();
}

// Initialization happens before Loading
[[nodiscard]] bool isInitialized() const { return GetReceptorCount() > 0; }
[[nodiscard]] bool isLoaded() const { return GetRendererCount() > 0; }

void Step(int iCol, TapNoteScore score);
void SetPressed(int iCol);

Expand Down

0 comments on commit 2d6ff79

Please sign in to comment.