Skip to content

Game.Simulation.XPMessage

Assembly: Assembly-CSharp.dll
Namespace: Game.Simulation

Type: struct

Base: System.ValueType

Summary:
Represents a single experience (XP) message used by the simulation to record an XP change event. Each message carries the simulation frame when it was created, the numeric XP amount, and a reason code indicating why the XP was awarded (or removed). The struct uses read-only (public get) auto-properties with private setters to make its data effectively immutable for external callers.


Fields

  • (none — this type exposes three auto-properties. The compiler generates private backing fields for those auto-properties.)

Properties

  • public uint createdSimFrame { get; private set; }
    The simulation frame index at which this XP message was created. Useful for ordering and determining age of the message in the simulation.

  • public XPReason reason { get; private set; }
    The reason/enum value describing why the XP change occurred (source of the XP). XPReason is an enum defined elsewhere in the codebase that categorizes XP sources.

  • public int amount { get; private set; }
    The amount of XP represented by this message. Positive values indicate XP gain; negative values may be used for XP loss depending on game logic.

Constructors

  • public XPMessage(uint createdSimFrame, int amount, XPReason reason)
    Creates a new XPMessage with the specified creation frame, XP amount, and reason.
  • createdSimFrame: simulation frame when the message was produced.
  • amount: the XP delta (gain or loss).
  • reason: the XPReason explaining the source.

Methods

  • (none)

Usage Example

// Create an XP message for frame 1200, awarding 50 XP for a quest completion.
XPMessage msg = new XPMessage(1200u, 50, XPReason.QuestComplete);

// Read properties
uint frame = msg.createdSimFrame;
int xpAmount = msg.amount;
XPReason why = msg.reason;