Gondwana Game Engine Development (master) - 2.6.1
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop and web platforms using SkiaSharp for graphics and pluggable audio backends for desktop and browser targets.
Loading...
Searching...
No Matches
InputEventConfigurationBase.cs
2
3namespace Gondwana.Input;
4
11public abstract class InputEventConfigurationBase
12{
18 protected internal long _lastEventTick;
19 private long _ticksBetweenEvents;
20
21 private InputEventConfigurationBase()
22 { }
23
38 protected InputEventConfigurationBase(double secondsBetweenEvents, bool isPaused)
39 {
40 _lastEventTick = 0;
41 _ticksBetweenEvents = (long)(secondsBetweenEvents * HighResTimer.TicksPerSecond);
42 IsPaused = isPaused;
43 }
44
56 public double TimeBetweenEvents
57 {
58 get => (double)_ticksBetweenEvents / HighResTimer.TicksPerSecond;
59 set => _ticksBetweenEvents = (long)(value * HighResTimer.TicksPerSecond);
60 }
61
73 public bool IsPaused { get; set; } = false;
74
75 internal bool ReadyForNextEvent(long tick) => tick - _lastEventTick >= _ticksBetweenEvents;
76}
bool IsPaused
Gets or sets a value indicating whether event processing is currently paused. When set to true,...
InputEventConfigurationBase(double secondsBetweenEvents, bool isPaused)
Initializes a new instance of the InputEventConfigurationBase class with the specified throttling int...
double TimeBetweenEvents
Gets or sets the minimum time interval in seconds that must elapse between consecutive events....