Class RollbackScene
Base class for scenes that support rollback netcode
Extends the existing Scene architecture with rollback capabilities
Inheritance
RollbackScene
Assembly: PopcorningGuineaPig.Engine.dll
Syntax
public abstract class RollbackScene : Scene, IDisposable
Constructors
|
Edit this page
View Source
RollbackScene(ILogger)
Declaration
protected RollbackScene(ILogger logger)
Parameters
| Type |
Name |
Description |
| ILogger |
logger |
|
Fields
|
Edit this page
View Source
_logger
Declaration
protected readonly ILogger _logger
Field Value
Properties
|
Edit this page
View Source
CurrentFrame
Current frame number for this scene
Declaration
public long CurrentFrame { get; }
Property Value
Methods
|
Edit this page
View Source
Apply player input to the scene
Override in derived classes to handle specific input types
Declaration
public abstract void ApplyInput(string playerId, object input)
Parameters
|
Edit this page
View Source
Clone()
Create a deep clone of the current scene state
Declaration
public RollbackScene Clone()
Returns
|
Edit this page
View Source
CreateClone()
Override in derived classes to create a new instance for cloning
Declaration
protected abstract RollbackScene CreateClone()
Returns
|
Edit this page
View Source
DeserializeState(byte[])
Deserialize and restore scene state from network data
Declaration
public void DeserializeState(byte[] data)
Parameters
| Type |
Name |
Description |
| byte[] |
data |
|
|
Edit this page
View Source
GetDebugInfo()
Get detailed scene information for debugging
Declaration
public virtual Dictionary<string, object> GetDebugInfo()
Returns
|
Edit this page
View Source
RestoreCustomState(Dictionary<string, object>)
Override to restore custom scene-specific state
Declaration
protected virtual void RestoreCustomState(Dictionary<string, object> customState)
Parameters
|
Edit this page
View Source
RestoreState(RollbackSceneState)
Restore scene state from a saved snapshot
Declaration
public void RestoreState(RollbackSceneState state)
Parameters
|
Edit this page
View Source
SaveCustomState()
Override to save custom scene-specific state
Declaration
protected virtual Dictionary<string, object> SaveCustomState()
Returns
|
Edit this page
View Source
SaveState()
Save the current scene state for rollback
Declaration
public RollbackSceneState SaveState()
Returns
|
Edit this page
View Source
SerializeState()
Serialize scene state for network transmission
Declaration
public byte[] SerializeState()
Returns
|
Edit this page
View Source
Update(double)
Update method that increments frame counter
Declaration
public override void Update(double deltaTime)
Parameters
| Type |
Name |
Description |
| double |
deltaTime |
|
Overrides
|
Edit this page
View Source
ValidateState()
Validate scene state integrity
Override to add custom validation logic
Declaration
public virtual bool ValidateState()
Returns
Implements