Gondwana Game Engine
Gondwana is a cross-platform 2.5D game and rendering engine written in C#/.NET 8. It provides fine-grained control over rendering, timing, and scene composition, with built-in support for parallax, z-ordering, pixel overhang, collision detection, and particle effects. Gondwana targets desktop, mobile, and web platforms using SkiaSharp for graphics and NAudio for sound.
Loading...
Searching...
No Matches
Gondwana.Collisions.CollisionGroupRegistry Class Referencesealed

Manages collision group definitions and provides bitwise mask values for collision filtering. Groups are represented as bit flags to allow efficient collision detection using bitwise operations. More...

Public Member Functions

 CollisionGroupRegistry ()
 Initializes a new instance of the CollisionGroupRegistry class with predefined collision groups: WorldStatic, Actors, Projectiles, and Triggers.
int Define (string name)
 Defines a new collision group with the specified name, or returns the existing group value if already defined. Each group is assigned a unique bit flag value.
int Get (string name)
 Gets the bit flag value for a previously defined collision group.
IReadOnlyCollection< string > GetGroupNames ()
 Gets a read-only collection of all defined collision group names.

Properties

int WorldStatic [get]
 Gets the bit flag value for the WorldStatic collision group.
int Actors [get]
 Gets the bit flag value for the Actors collision group.
int Projectiles [get]
 Gets the bit flag value for the Projectiles collision group.
int Triggers [get]
 Gets the bit flag value for the Triggers collision group.

Detailed Description

Manages collision group definitions and provides bitwise mask values for collision filtering. Groups are represented as bit flags to allow efficient collision detection using bitwise operations.

Constructor & Destructor Documentation

◆ CollisionGroupRegistry()

Gondwana.Collisions.CollisionGroupRegistry.CollisionGroupRegistry ( )

Initializes a new instance of the CollisionGroupRegistry class with predefined collision groups: WorldStatic, Actors, Projectiles, and Triggers.

Member Function Documentation

◆ Define()

int Gondwana.Collisions.CollisionGroupRegistry.Define ( string name)

Defines a new collision group with the specified name, or returns the existing group value if already defined. Each group is assigned a unique bit flag value.

Parameters
nameThe name of the collision group to define. Must not be empty or whitespace.
Returns
The bit flag value representing the collision group.
Exceptions
ArgumentExceptionThrown when name is null, empty, or whitespace.
InvalidOperationExceptionThrown when the maximum number of 31 collision groups has been exceeded.

◆ Get()

int Gondwana.Collisions.CollisionGroupRegistry.Get ( string name)

Gets the bit flag value for a previously defined collision group.

Parameters
nameThe name of the collision group to retrieve.
Returns
The bit flag value representing the collision group.
Exceptions
KeyNotFoundExceptionThrown when the collision group with the specified name has not been defined.

◆ GetGroupNames()

IReadOnlyCollection< string > Gondwana.Collisions.CollisionGroupRegistry.GetGroupNames ( )

Gets a read-only collection of all defined collision group names.

Returns
A collection containing the names of all registered collision groups.

Property Documentation

◆ Actors

int Gondwana.Collisions.CollisionGroupRegistry.Actors
get

Gets the bit flag value for the Actors collision group.

◆ Projectiles

int Gondwana.Collisions.CollisionGroupRegistry.Projectiles
get

Gets the bit flag value for the Projectiles collision group.

◆ Triggers

int Gondwana.Collisions.CollisionGroupRegistry.Triggers
get

Gets the bit flag value for the Triggers collision group.

◆ WorldStatic

int Gondwana.Collisions.CollisionGroupRegistry.WorldStatic
get

Gets the bit flag value for the WorldStatic collision group.