Skip to content

Game.EndFrameBarrier

Assembly:
Game (inferred from file path: Game\Rendering\Utilities\Extensions.cs)

Namespace:
Game.Rendering.Utilities

Type:
public static class Extensions

Base:
System.Object

Summary:
This source file provides a small utility static class, Extensions, that adds three extension methods named Fire for safely invoking Action delegates (including generic Action and Action) using the null-conditional pattern. These helpers are convenience wrappers to call delegates only when they are non-null, simplifying event invocation sites across the codebase.


Fields

  • private System.Diagnostics.Stopwatch m_Stopwatch
    This field is not present in this class. The Extensions static class defines no instance or static fields.

  • private Unity.Jobs.JobHandle <producerHandle>k__BackingField
    This field is not present in this class. The Extensions static class defines no backing fields or properties.

Properties

  • public Unity.Jobs.JobHandle producerHandle { get; private set }
    No such property exists on this type. Extensions exposes no properties.

Constructors

  • public EndFrameBarrier()
    Extensions is a static class and therefore cannot have instance constructors. There is no explicit static constructor defined in the file.

Methods

  • protected virtual OnCreate() : System.Void
    No OnCreate method exists in this file. Instead, Extensions defines the following extension methods:

  • public static void Fire(this Action action)
    Safely invokes a parameterless Action delegate if it is not null. Implementation: action?.Invoke();

  • public static void Fire<T>(this Action<T> action, T arg1)
    Safely invokes a single-parameter generic Action delegate with arg1 if the delegate is not null. Implementation: action?.Invoke(arg1);

  • public static void Fire<T, U>(this Action<T, U> action, T arg1, U arg2)
    Safely invokes a two-parameter generic Action delegate with arg1 and arg2 if the delegate is not null. Implementation: action?.Invoke(arg1, arg2);

Behavior notes: - These methods are simple null-conditional invocations and do not catch exceptions thrown by the invoked delegates. - They are intended as concise convenience helpers for event/delegate invocation sites; they do not introduce synchronization or thread-safety beyond the null check and invoke operation itself. - Because they are extension methods on System.Action and its generic variants, they can be used anywhere the delegate type is in scope.

Usage Example

using System;
using Game.Rendering.Utilities;

class Example
{
    static void Main()
    {
        Action noArg = null;
        Action<int> oneArg = x => Console.WriteLine("Value: " + x);
        Action<int, string> twoArgs = (x, s) => Console.WriteLine($"X={x}, S={s}");

        // Safe invocations — no exceptions if delegate is null
        noArg.Fire();               // no-op
        oneArg.Fire(42);            // prints "Value: 42"
        twoArgs.Fire(7, "hello");   // prints "X=7, S=hello"
    }
}