For the complete documentation index, see llms.txt. This page is also available as Markdown.

ksMultiType

Summary

ksMultiType is the value type Reactor uses to carry many common data types through one API. Properties and RPC arguments use it, which lets a single method or map hold different kinds of data. It is part of the Reactor Technical Overview.

What It Holds

A ksMultiType can hold any of these, with implicit conversions to and from the matching C# type:

  • Primitives: byte, short, ushort, int, uint, long, ulong, float, double, char, bool, string.

  • Math types: Vector2, Vector3, Vector2Int, Vector3Int, Quaternion, Color.

  • Arrays: an array form of each primitive and math type above. Arrays may be null.

  • Custom types: any type that implements ksISerializable.

Because the conversions are implicit, you assign and read values with the plain C# type and let ksMultiType carry it:

entity.Properties[Prop.SCORE] = 10;        // int in
int score = entity.Properties[Prop.SCORE]; // int out

Where It Is Used

  • Properties: a property map is a mapping of a numeric id to a ksMultiType. See Automatic Client Data Syncing.

  • RPC arguments: RPC handlers receive ksMultiType values, so one call can pass mixed argument types. A handler can take a ksMultiType[] or list specific parameter types that convert from it. See Messaging and RPCs.

Where to Go Next

Last updated