mirror of
https://github.com/MoleskiCoder/EightBit.git
synced 2024-12-23 00:29:47 +00:00
Expose the clock tick as an externally driven action.
Signed-off-by: Adrian Conlon <Adrian.conlon@gmail.com>
This commit is contained in:
parent
4f8d3287d4
commit
2c23289caa
@ -11,12 +11,12 @@ namespace EightBit {
|
|||||||
|
|
||||||
Signal<EventArgs> Ticked;
|
Signal<EventArgs> Ticked;
|
||||||
|
|
||||||
|
void tick(const int extra) { for (int i = 0; i < extra; ++i) tick(); }
|
||||||
|
void tick() { ++m_cycles; Ticked.fire(EventArgs::empty()); }
|
||||||
[[nodiscard]] auto cycles() const noexcept { return m_cycles; }
|
[[nodiscard]] auto cycles() const noexcept { return m_cycles; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
void resetCycles() noexcept { m_cycles = 0; }
|
void resetCycles() noexcept { m_cycles = 0; }
|
||||||
void tick(const int extra) { for (int i = 0; i < extra; ++i) tick(); }
|
|
||||||
void tick() { ++m_cycles; Ticked.fire(EventArgs::empty()); }
|
|
||||||
|
|
||||||
private:
|
private:
|
||||||
int m_cycles = 0;
|
int m_cycles = 0;
|
||||||
|
Loading…
Reference in New Issue
Block a user