class Packet {
    static _createBase(name) {
        return {
            type: name,
            id: window.crypto.randomUUID(),
            author: ID,
        };
    }

    static createAnnounce() {
        return {
            ...this._createBase("ANNOUNCE"),
            name: "",
        };
    }

    static createDisconnect() {
        return this._createBase("DISCONNECT");
    }

    static createKeepAlive() {
        return this._createBase("KEEPALIVE");
    }

    static createSetReady(nowReady) {
        return {
            ...this._createBase("READY"),
            ready: nowReady,
        };
    }

    static createBarrierSignal() {
        return this._createBase("BARRIER");
    }

    static createRegionClaim(region) {
        return {
            ...this._createBase("ACT"),
            region: region,
        };
    }

    static createReinforce(region) {
        return {
            ...this._createBase("ACT"),
            region: region,
        };
    }

    static createEndTurn() {
        return {
            ...this._createBase("ACT"),
            action: "END",
        };
    }
}
