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 outWhere 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
ksMultiTypevalues, so one call can pass mixed argument types. A handler can take aksMultiType[]or list specific parameter types that convert from it. See Messaging and RPCs.
Where to Go Next
Automatic Client Data Syncing: how properties sync.
Messaging and RPCs: how RPC arguments are passed.
Last updated

