Options
All
  • Public
  • Public/Protected
  • All
Menu

Module @laniakea/client-engine

Index

Type aliases

ComponentTypeId

ComponentTypeId: ShortTypeId

The id of the type of a component

Constructor

Constructor<T>: new (...args: any[]) => T

Type parameters

  • T

Type declaration

    • new (...args: any[]): T
    • Parameters

      • Rest ...args: any[]

      Returns T

EntityId

EntityId: NominalType<number, "EntityId">

The id of an entity

NominalType

NominalType<AliasedType, TypeNameString>: AliasedType & { __brand: TypeNameString }

Utility to get nominally typed type-aliases See Approach 4 in https://michalzalecki.com/nominal-typing-in-typescript/

Type parameters

  • AliasedType

  • TypeNameString

NumericComponentId

NumericComponentId: NominalType<number, "NumericComponentId">

The two parts of ComponentId combined in to 1 number. Good for use as a key in a map.

PlayerId

PlayerId: NominalType<number, "PlayerId">

SerializationStream

SerializationStream: ReadStream | WriteStream | MeasureStream

ShortTypeId

ShortTypeId: NominalType<number, "ShortTypeId">

A short typeId that's better for network message size but requires a lookup in the ClassRegistry 16-bit sequential id

TypeId

TypeId: NominalType<number, "TypeId">

A long type id that is computable from the typename 64-bit hash

TypeName

TypeName: string

The human readable name of the type, must be globally unique.

Variables

Let ENTITY_ID_NUM_BITS

ENTITY_ID_NUM_BITS: number

EntityIds are 32 bits

Let MAX_SHORT_TYPE_ID_EXCLUSIVE

MAX_SHORT_TYPE_ID_EXCLUSIVE: number

Let MAX_VALID_ENTITY_ID_INCLUSIVE

MAX_VALID_ENTITY_ID_INCLUSIVE: number

Functions

measureAndSerialize

measureSerializable

  • Parameters

    Returns number

periodicCallback

  • Scheduled a callback repeatedly at periodMS milliseconds after the start of each callback call. Avoids the period being dependent on execution time. This is not guaranteed if the callback takes longer than periodMS or if the executor is hogged by other code.

    Parameters

    • callback: () => void
        • (): void
        • Returns void

    • periodMS: number
    • cosmeticName: string

      Name of the callback used in errors and warnings.

    Returns PeriodicCallbackHandle

registerBuiltinMessages

registerMessageTypes

  • registerMessageTypes(registerCb: <T>(ctor: new (...args: any[]) => T, uniquePacketTypeName: string) => void): void
  • Parameters

    • registerCb: <T>(ctor: new (...args: any[]) => T, uniquePacketTypeName: string) => void
        • <T>(ctor: new (...args: any[]) => T, uniquePacketTypeName: string): void
        • Type parameters

          Parameters

          • ctor: new (...args: any[]) => T
              • new (...args: any[]): T
              • Parameters

                • Rest ...args: any[]

                Returns T

          • uniquePacketTypeName: string

          Returns void

    Returns void

Generated using TypeDoc