logo SERENITY
Game Systems Foundation
Search Results for

    Show / Hide Table of Contents

    Struct CameraCandidate

    Engine-agnostic description of a registered camera as seen by the active-camera selection policy. Camera is an opaque handle (the concrete engine camera type lives in Infrastructure); the Domain layer only needs Depth and DrawsToScreen to decide which camera should be active.

    Inherited Members
    object.Equals(object, object)
    object.ReferenceEquals(object, object)
    object.GetType()
    Namespace: Serenity.GameCamera.Domain.ValueObjects
    Assembly: Serenity.GameCamera.Domain.dll
    Syntax
    public readonly struct CameraCandidate

    Constructors

    CameraCandidate(object, float, bool)

    Initializes a new instance of the CameraCandidate struct.

    Declaration
    public CameraCandidate(object camera, float depth, bool drawsToScreen)
    Parameters
    Type Name Description
    object camera

    Opaque handle to the engine camera instance.

    float depth

    Render depth/priority.

    bool drawsToScreen

    Whether this camera currently renders to the screen.

    Fields

    Camera

    Declaration
    public readonly object Camera
    Field Value
    Type Description
    object

    Opaque handle to the engine camera instance.

    Depth

    Declaration
    public readonly float Depth
    Field Value
    Type Description
    float

    Render depth/priority; among drawing candidates, the highest depth wins.

    DrawsToScreen

    Declaration
    public readonly bool DrawsToScreen
    Field Value
    Type Description
    bool

    Whether this camera currently renders to the screen (e.g. has an active output target).

    Methods

    Equals(CameraCandidate)

    Determines whether this candidate has the same camera, depth and draw state as another.

    Declaration
    public bool Equals(CameraCandidate other)
    Parameters
    Type Name Description
    CameraCandidate other

    The candidate to compare against.

    Returns
    Type Description
    bool

    True when all three fields are equal.

    Equals(object)

    Determines whether this candidate equals another object.

    Declaration
    public override bool Equals(object obj)
    Parameters
    Type Name Description
    object obj

    The object to compare against.

    Returns
    Type Description
    bool

    True when obj is a CameraCandidate with equal fields.

    Overrides
    ValueType.Equals(object)

    GetHashCode()

    Computes a hash code consistent with Equals(CameraCandidate).

    Declaration
    public override int GetHashCode()
    Returns
    Type Description
    int

    The hash code.

    Overrides
    ValueType.GetHashCode()

    ToString()

    Returns a string representation of the candidate.

    Declaration
    public override string ToString()
    Returns
    Type Description
    string

    Formatted string with depth and draw state.

    Overrides
    ValueType.ToString()

    Operators

    operator ==(CameraCandidate, CameraCandidate)

    Determines whether two candidates have equal camera, depth and draw state.

    Declaration
    public static bool operator ==(CameraCandidate left, CameraCandidate right)
    Parameters
    Type Name Description
    CameraCandidate left

    The first candidate.

    CameraCandidate right

    The second candidate.

    Returns
    Type Description
    bool

    True when all fields are equal.

    operator !=(CameraCandidate, CameraCandidate)

    Determines whether two candidates differ in any field.

    Declaration
    public static bool operator !=(CameraCandidate left, CameraCandidate right)
    Parameters
    Type Name Description
    CameraCandidate left

    The first candidate.

    CameraCandidate right

    The second candidate.

    Returns
    Type Description
    bool

    True when any field differs.

    In this article
    © 2026 Serenity. All Rights Reserved