logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Namespace Serenity.GameCamera.Tests.Domain

    Classes

    ActiveCameraSelectorTests

    Guards TrySelect(IReadOnlyList<CameraCandidate>, out CameraCandidate) — the depth-priority policy used whenever no explicit override or explicit selection picks the active camera. These are the load-bearing contracts: only screen-drawing candidates are eligible regardless of depth, the highest depth among eligible candidates wins, and an empty or all-ineligible input must fail cleanly rather than return a default candidate silently.

    SplitScreenLayoutCalculatorTests

    Guards Compute(int, SplitScreenLayout) — the single place viewport rects are derived from a player count and layout. These are the load-bearing contracts: a single player always gets the full screen regardless of layout, two-player layouts must produce the exact halves engine cameras will bind to, three/four-player counts must produce the exact quadrant slots, counts above four must degrade to one full rect per player (since no automatic layout covers more than four viewports), and a non-positive count must fail loudly rather than silently return an empty or malformed list.

    ViewportRectTests

    Guards ViewportRect — the value object every split-screen and active-camera contract is expressed in. These are the load-bearing contracts: construction must clamp out-of-range components into 0..1 (a computed or untrusted rect can never describe an off-screen viewport), value equality must compare by component (so layouts and assignments can be asserted structurally), and Full must be the canonical full-screen rect every degradation path relies on.

    In this article
    © 2026 Serenity. All Rights Reserved