Equipment
A protocol for equipment that players directly interact with in a game.
Declaration
protocol Equipment : Identifiable where Self.ID == EquipmentIdentifierOverview
To represent equipment in your game, such as cards, pieces, and dice, following these steps:
Create a structure that conforms to this protocol.
Declare the initialState property as either BaseEquipmentState, DieState, or CardState, depending on the type of data you want TabletopKit to sync between players. For more complex data, use RawValueState.
Declare the
idproperty as a EquipmentIdentifier structure.Implement an initializer that sets the
idand initialState properties.
Optionally, implement the layoutChildren(for:visualState:) method for equipment that represents groups, and the restingOrientation(state:) method to provide a custom resting orientation.