Class TGamePresentation

Unit

Declaration

type TGamePresentation = class(TObject)

Description

Owns a copied snapshot, bounded fade slots and a displayed score. Sync/Advance mutate presentation; painting only reads. No VCL or OS clock.

Source: src/Breakout.Presentation.pas (line 47).

Hierarchy

Overview

Methods

Public constructor Create(const Config: TVisualConfig);
Public procedure Reset(const Snapshot: TGameSnapshot);
Public procedure Sync(const Snapshot: TGameSnapshot);
Public procedure Advance(ElapsedSeconds: Double; Frozen: Boolean);
Public function FadeOpacity(Index: Integer): Double;

Properties

Public property Snapshot: TGameSnapshot read FSnapshot;
Public property DisplayedScore: Integer read FDisplayedScore;
Public property FadeCapacity: Integer read GetFadeCount;
Public property Fades[Index: Integer]: TBrickFade read GetFade;
Public property HasPending: Boolean read GetPending;

Description

Methods

Public constructor Create(const Config: TVisualConfig);

Validates positive finite durations and a positive count step. Raises EArgumentException on invalid visual configuration.

Source: src/Breakout.Presentation.pas (line 61).

Public procedure Reset(const Snapshot: TGameSnapshot);

Copies state, clears fades/debt and sets displayed score to actual score.

Source: src/Breakout.Presentation.pas (line 63).

Public procedure Sync(const Snapshot: TGameSnapshot);

Copies state and detects active-to-inactive brick transitions. A new board clears old fades while preserving score debt; restart should explicitly call Reset.

Source: src/Breakout.Presentation.pas (line 67).

Public procedure Advance(ElapsedSeconds: Double; Frozen: Boolean);

Advances fade ages and score using elapsed time, with arithmetic catch-up bounded by the target. The caller applies any elapsed cap. Raises EArgumentOutOfRangeException on invalid elapsed time.

Parameters
ElapsedSeconds
Finite, nonnegative elapsed seconds.
Frozen
When True, neither animation nor score advances.

Source: src/Breakout.Presentation.pas (line 73).

Public function FadeOpacity(Index: Integer): Double;

Returns linear opacity in [0,1], or zero for an inactive fade.

Source: src/Breakout.Presentation.pas (line 75).

Properties

Public property Snapshot: TGameSnapshot read FSnapshot;

This item has no description.

Source: src/Breakout.Presentation.pas (line 76).

Public property DisplayedScore: Integer read FDisplayedScore;

This item has no description.

Source: src/Breakout.Presentation.pas (line 77).

Public property FadeCapacity: Integer read GetFadeCount;

This item has no description.

Source: src/Breakout.Presentation.pas (line 78).

Public property Fades[Index: Integer]: TBrickFade read GetFade;

This item has no description.

Source: src/Breakout.Presentation.pas (line 79).

Public property HasPending: Boolean read GetPending;

True while score debt or any active fade still needs visual time.

Source: src/Breakout.Presentation.pas (line 81).


Generated by PasDoc 1.0.4.