UNPKG

moomooio-client

Version:

MooMooIO-Client is a client-side wrapper API designed for the game MooMoo.io. This package aims to provide a simple yet powerful API for creating clones, mods, or plugins for MooMoo.io.

27 lines (22 loc) 798 B
import { z } from "zod"; const teamSchema = z.object({ owner: z.number(), sid: z.string(), }); const schema = z.tuple([teamSchema]); /** * @packet-id "ac" * @description **CreateTeam** is a signal that indicates when a player creates a team. * @member `ownerID` is a unique identifier for the player who created and owns the team. * @member `title` is the title of the team. */ export default class CreateTeam { public static readonly PACKET_ID = "ac"; public static readonly PACKET_NAME = "CreateTeam"; public readonly PACKET_NAME = "CreateTeam"; constructor(readonly ownerID: number, readonly title: string) {} static parse(data: unknown): CreateTeam { const [info] = schema.parse(data); return new CreateTeam(info.owner, info.sid); } }