Class GameScene
Game scene with game-specific layers
public sealed class GameScene : BaseScene, IScene
- Inheritance
-
GameScene
- Implements
- Inherited Members
Constructors
GameScene()
public GameScene()
Properties
PlayerPosition
Gets the current player position
public Position PlayerPosition { get; }
Property Value
Methods
ActivateSceneAsync(CancellationToken)
Override this method to implement scene-specific activation logic. Default implementation does nothing.
protected override ValueTask ActivateSceneAsync(CancellationToken ct = default)
Parameters
ct
CancellationTokenCancellation token
Returns
DeactivateSceneAsync(CancellationToken)
Override this method to implement scene-specific deactivation logic. Default implementation does nothing.
protected override ValueTask DeactivateSceneAsync(CancellationToken ct = default)
Parameters
ct
CancellationTokenCancellation token
Returns
HandlePlayerInput(IInputDevice, int, int)
Handles player movement input with throttling
public void HandlePlayerInput(IInputDevice inputDevice, int screenWidth, int screenHeight)
Parameters
inputDevice
IInputDeviceInput device to check for movement keys
screenWidth
intScreen width for bounds checking
screenHeight
intScreen height for bounds checking
MovePlayer(Position, int, int)
Moves the player to a new position, with bounds checking
public void MovePlayer(Position newPosition, int screenWidth, int screenHeight)
Parameters
newPosition
PositionThe new position to move to
screenWidth
intScreen width for bounds checking
screenHeight
intScreen height for bounds checking
ReturnToMenuAsync(CancellationToken)
public ValueTask ReturnToMenuAsync(CancellationToken ct = default)
Parameters
Returns
SetSceneManager(ISceneManager)
public void SetSceneManager(ISceneManager sceneManager)
Parameters
sceneManager
ISceneManager
UpdateSceneAsync(CancellationToken)
Override this method to implement scene-specific update logic. Default implementation does nothing.
protected override ValueTask UpdateSceneAsync(CancellationToken ct = default)
Parameters
ct
CancellationTokenCancellation token