import { schema, type SchemaType } from "@colyseus/schema";

export const Player = schema({
  x: "float32",
  y: "float32",
  z: "float32",
  rot: "float32",
  anim: "string",
  displayName: "string",
  skinIndex: "uint8",
});
export type Player = SchemaType<typeof Player>;

export const WorldObject = schema({
  objectId: "string",
  objectType: "string",
  state: "string",
  data: "string",
  usedBy: "string",
});
export type WorldObject = SchemaType<typeof WorldObject>;

export const LobbyState = schema({
  players: { map: Player },
  objects: { map: WorldObject },
});
export type LobbyState = SchemaType<typeof LobbyState>;
