Takaro - v0.4.9
    Preparing search index...

    Class BaseGameEvent<T>

    Generic Data Transfer Object, used widely in Takaro to pass data back and forth between components Allows validation of properties when instantiated and JSON (de)serialization

    Type Parameters

    • T

    Hierarchy (View Summary)

    Index

    Constructors

    Properties

    Methods

    Constructors

    Properties

    msg: string
    timestamp: string = ...
    type: ValueOf<
        {
            CHAT_MESSAGE: "chat-message";
            ENTITY_KILLED: "entity-killed";
            LOG_LINE: "log";
            PLAYER_CONNECTED: "player-connected";
            PLAYER_DEATH: "player-death";
            PLAYER_DISCONNECTED: "player-disconnected";
        },
    >

    Methods

    • Parameters

      • OptionaloptionOverrides: ClassTransformOptions

      Returns Record<string, any>

    • Validates the DTO instance

      Parameters

      • OptionalextraOpts: ValidatorOptions

      Returns Promise<void>

      if validation fails