Skip to main content

Overview

The PointerRef struct represents a reference to an EBX object, which can be either internal (within the same asset) or external (in another asset). It’s a fundamental type used throughout the Frostbite engine for connecting objects together.

Structure

Properties

EbxImportReference
External reference containing FileGuid and ClassGuid for cross-asset references
object
Internal object reference for objects within the same asset
PointerRefType
Indicates whether this is a Null, Internal, or External reference

Constructors

PointerRef(EbxImportReference)

Creates an external pointer reference.
EbxImportReference
required
The external reference to wrap

PointerRef(Guid)

Creates a pointer reference from a GUID.
Guid
required
The file GUID to reference. Empty GUID creates a null pointer.

PointerRef(object)

Creates an internal pointer reference.
object
required
The internal object to reference

Methods

Equals

Compares two PointerRef instances for equality.
object
required
The object to compare with
Returns true if both pointers have the same Type and reference the same object/external asset.

GetHashCode

Generates a hash code for the pointer reference.
Uses FNV-1a hashing algorithm to combine Type, Internal, and External values.

Operators

Equality Operators

Compares PointerRef instances using value equality.

PointerRefType

Enumeration indicating the type of pointer.

EbxImportReference

Structure for external references.

Usage Examples

Checking Pointer Type

Resolving External Pointers

Best Practices

  • Always check Type before accessing Internal or External properties
  • Use Guid.Empty to create null pointers instead of default constructors
  • External references require both FileGuid and ClassGuid to be valid
  • Internal references maintain object identity within the asset’s lifetime