Options
All
  • Public
  • Public/Protected
  • All
Menu

Factory Pattern Class for wrapping packet generation for communication. See https://en.wikipedia.org/wiki/Factory_method_pattern#Example_implementations

Creates new Packets and returns them through static Command instance (factory pattern). Using this wrapper to create commands to the server is super easy. Just call its methods with 'Command.whoAmI()', 'Command.move(1.0, 2.0)' and so on.

Hierarchy

  • PacketFactory

Index

Constructors

Private constructor

Methods

Static disconnect

Static move

  • move(coordinateX: number, coordinateY: number, angle: number): Packet
  • Tells the server the user has moved on the playing field.

    Parameters

    • coordinateX: number

      new X coordinate of the player.

    • coordinateY: number

      new Y coordinate of the player.

    • angle: number

      angle the player is looking at.

    Returns Packet

    a new client movement packet.

Static requestPlayerInfo

Static requestPlayerKillDeathCount

  • requestPlayerKillDeathCount(): Packet

Static shoot

  • shoot(angle: number): Packet

Static unknown

Static whoAmI

Generated using TypeDoc