#
@latticexyz/std-client
#
Enumerations
#
ActionState
• ActionState: Enum ActionState
#
Defined in
std-client/src/systems/ActionSystem/constants.ts:1
#
Type Aliases
#
ActionSystem
Ƭ ActionSystem: ReturnType<typeof createActionSystem>
#
Defined in
std-client/src/systems/ActionSystem/createActionSystem.ts:23
#
ContractComponent
Ƭ ContractComponent: Component<Schema, Object>
#
Defined in
std-client/src/setup/types.ts:25
#
ContractComponents
Ƭ ContractComponents: Object
#
Index signature
▪ [key: string]: ContractComponent
#
Defined in
std-client/src/setup/types.ts:27
#
DecodedNetworkComponentUpdate
Ƭ DecodedNetworkComponentUpdate: Omit<Omit<NetworkComponentUpdate, "entity">, "component"> & Object
#
Defined in
std-client/src/setup/types.ts:11
#
DecodedSystemCall
Ƭ DecodedSystemCall: Omit<SystemCall<C>, "updates"> & Object
#
Type parameters
#
Defined in
std-client/src/setup/types.ts:16
#
NetworkComponents
Ƭ NetworkComponents: C & Object
#
Type parameters
#
Defined in
std-client/src/setup/types.ts:31
#
SetupContractConfig
Ƭ SetupContractConfig: NetworkConfig & Omit<SyncWorkerConfig, "worldContract" | "mappings"> & Object
#
Defined in
std-client/src/setup/types.ts:5
#
Variables
#
ActionStateString
• Const
ActionStateString: Object
#
Type declaration
#
Defined in
std-client/src/systems/ActionSystem/constants.ts:11
#
Functions
#
applyNetworkUpdates
▸ applyNetworkUpdates<C
>(world
, components
, ecsEvents$
, mappings
, ack$
, decodeAndEmitSystemCall?
): Object
Sets up synchronization between contract components and client components
#
Type parameters
#
Parameters
#
Returns
Object
#
Defined in
std-client/src/setup/utils.ts:134
#
createActionSystem
▸ createActionSystem<M
>(world
, txReduced$
): Object
#
Type parameters
#
Parameters
#
Returns
Object
#
Defined in
std-client/src/systems/ActionSystem/createActionSystem.ts:25
#
createDecodeNetworkComponentUpdate
▸ createDecodeNetworkComponentUpdate<C
>(world
, components
, mappings
): Function
#
Type parameters
#
Parameters
#
Returns
Function
▸ (update
): DecodedNetworkComponentUpdate | undefined
#
Parameters
#
Returns
DecodedNetworkComponentUpdate | undefined
#
Defined in
std-client/src/setup/utils.ts:36
#
createEncoders
▸ createEncoders(world
, components
, signerOrProvider
): Promise<Record<string, Function>>
#
Parameters
#
Returns
Promise<Record<string, Function>>
#
Defined in
std-client/src/setup/utils.ts:101
#
createSystemCallStreams
▸ createSystemCallStreams<C
, SystemTypes
>(world
, systemNames
, systemsRegistry
, getSystemContract
, decodeNetworkComponentUpdate
): Object
#
Type parameters
#
Parameters
#
Returns
Object
#
Defined in
std-client/src/setup/utils.ts:59
#
defineActionComponent
▸ defineActionComponent<T
>(world
): Component<Object, Metadata, T>
#
Type parameters
#
Parameters
#
Returns
Component<Object, Metadata, T>
#
Defined in
std-client/src/components/ActionComponent.ts:3
#
defineBoolComponent
▸ defineBoolComponent<M
>(world
, options?
): Component<Object, M, undefined>
#
Type parameters
#
Parameters
#
Returns
Component<Object, M, undefined>
#
Defined in
std-client/src/components/BoolComponent.ts:3
#
defineCoordComponent
▸ defineCoordComponent<M
>(world
, options?
): Component<Object, M, undefined>
#
Type parameters
#
Parameters
#
Returns
Component<Object, M, undefined>
#
Defined in
std-client/src/components/CoordComponent.ts:3
#
defineDevHighlightComponent
▸ defineDevHighlightComponent(world
): Component<Object, Metadata, undefined>
DevHighlight is for use during development to highlight the positions of entities that you are interacting with. Example: Highlight the Entities that you are currently editing in the ComponentBrowser.
#
Parameters
#
Returns
Component<Object, Metadata, undefined>
#
Defined in
std-client/src/components/DevHighlight.ts:8
#
defineNumberComponent
▸ defineNumberComponent<M
>(world
, options?
): Component<Object, M, undefined>
#
Type parameters
#
Parameters
#
Returns
Component<Object, M, undefined>
#
Defined in
std-client/src/components/NumberComponent.ts:3
#
defineStringComponent
▸ defineStringComponent<M
>(world
, options?
): Component<Object, M, undefined>
#
Type parameters
#
Parameters
#
Returns
Component<Object, M, undefined>
#
Defined in
std-client/src/components/StringComponent.ts:3
#
defineVoxelCoordComponent
▸ defineVoxelCoordComponent<M
>(world
, options?
): Component<Object, M, undefined>
#
Type parameters
#
Parameters
#
Returns
Component<Object, M, undefined>
#
Defined in
std-client/src/components/VoxelCoordComponent.ts:3
#
findEntityWithComponentInRelationshipChain
▸ findEntityWithComponentInRelationshipChain(relationshipComponent
, entity
, searchComponent
): EntityIndex | undefined
Starting with the given entity, traverse the relationship chain until you find an entity that has the given component.
#
Parameters
#
Returns
EntityIndex | undefined
The first entity in the relationship chain that has the given component or undefined if the relationship chain is broken.
#
Defined in
#
findInRelationshipChain
▸ findInRelationshipChain(relationshipComponent
, entity
, searchEntity
): boolean
Find a specific entity in a relationship chain.
#
Parameters
#
Returns
boolean
True if the entity is found in the relationship chain, false otherwise.
#
Defined in
#
getCurrentTurn
▸ getCurrentTurn(world
, gameConfigComponent
, clock
): number
#
Parameters
#
Returns
number
#
Defined in
#
getGameConfig
▸ getGameConfig(world
, gameConfigComponent
): undefined | ComponentValue<Object, undefined>
#
Parameters
#
Returns
undefined | ComponentValue<Object, undefined>
#
Defined in
#
getPlayerEntity
▸ getPlayerEntity(address
, world
, Player
): EntityIndex | undefined
#
Parameters
#
Returns
EntityIndex | undefined
#
Defined in
#
getStringColor
▸ getStringColor(address
): number
#
Parameters
#
Returns
number
#
Defined in
#
getTurnAtTime
▸ getTurnAtTime(world
, gameConfigComponent
, time
): number
#
Parameters
#
Returns
number
#
Defined in
#
isUntraversable
▸ isUntraversable(untraversableComponent
, positionComponent
, targetPosition
): boolean
#
Parameters
#
Returns
boolean
#
Defined in
#
randomColor
▸ randomColor(id
): number
Generate a random color based on the given id.
#
Parameters
#
Returns
number
A color in the range 0x000000 - 0xFFFFFF
#
Defined in
#
resolveRelationshipChain
▸ resolveRelationshipChain(relationshipComponent
, entity
): EntityIndex | undefined
Starting with the given entity, traverse the relationship chain until the end is reached.
#
Parameters
#
Returns
EntityIndex | undefined
The last entity in the relationship chain or undefined if the relationship chain is broken.
#
Defined in
#
setupMUDNetwork
▸ setupMUDNetwork<C
, SystemTypes
>(networkConfig
, world
, contractComponents
, SystemAbis
, options?
): Promise<Object>
#
Type parameters
#
Parameters
#
Returns
Promise<Object>
#
Defined in
std-client/src/setup/setupMUDNetwork.ts:28
#
useComponentValueStream
▸ useComponentValueStream<T
>(component
, entity?
): undefined | null | ComponentValue<T, undefined>
Deprecated
Use hooks exported from @latticexyz/react package instead.
#
Type parameters
#
Parameters
#
Returns
undefined | null | ComponentValue<T, undefined>
#
Defined in
#
useQuery
▸ useQuery(queryFragments
): undefined | ObservableSet<EntityIndex>
Handles subscribing and unsubscribing to a queries update stream to keep the matching set up to date
Deprecated
Use hooks exported from @latticexyz/react package instead.
#
Parameters
#
Returns
undefined | ObservableSet<EntityIndex>
Mobx ObservablesSet with entities currently matching the query
#
Defined in
#
useStream
▸ useStream<T
>(stream
, defaultValue?
): undefined | T
Deprecated
Use hooks exported from @latticexyz/react package instead.
#
Type parameters
#
Parameters
#
Returns
undefined | T
#
Defined in
#
waitForActionCompletion
▸ waitForActionCompletion(Action
, entity
): Promise<void>
#
Parameters
#
Returns
Promise<void>
#
Defined in
std-client/src/systems/ActionSystem/utils/waitForActionCompletion.ts:6
#
waitForComponentValue
▸ waitForComponentValue<S
>(component
, entity
, value
): Promise<void>
#
Type parameters
#
Parameters
#
Returns
Promise<void>
#
Defined in
#
waitForComponentValueIn
▸ waitForComponentValueIn<S
, T
>(component
, entity
, values
): Promise<void>
#
Type parameters
#
Parameters
#
Returns
Promise<void>