import * as $protobuf from "protobufjs";
import Long = require("long");
/** Properties of a ReqMatchRoom. */
export interface IReqMatchRoom {

    /** ReqMatchRoom gameId */
    gameId?: (ServiceTypeId|null);

    /** ReqMatchRoom roomType */
    roomType?: (number|null);
}

/** Represents a ReqMatchRoom. */
export class ReqMatchRoom implements IReqMatchRoom {

    /**
     * Constructs a new ReqMatchRoom.
     * @param [properties] Properties to set
     */
    constructor(properties?: IReqMatchRoom);

    /** ReqMatchRoom gameId. */
    public gameId: ServiceTypeId;

    /** ReqMatchRoom roomType. */
    public roomType: number;

    /**
     * Creates a new ReqMatchRoom instance using the specified properties.
     * @param [properties] Properties to set
     * @returns ReqMatchRoom instance
     */
    public static create(properties?: IReqMatchRoom): ReqMatchRoom;

    /**
     * Encodes the specified ReqMatchRoom message. Does not implicitly {@link ReqMatchRoom.verify|verify} messages.
     * @param message ReqMatchRoom message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encode(message: IReqMatchRoom, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Encodes the specified ReqMatchRoom message, length delimited. Does not implicitly {@link ReqMatchRoom.verify|verify} messages.
     * @param message ReqMatchRoom message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encodeDelimited(message: IReqMatchRoom, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Decodes a ReqMatchRoom message from the specified reader or buffer.
     * @param reader Reader or buffer to decode from
     * @param [length] Message length if known beforehand
     * @returns ReqMatchRoom
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ReqMatchRoom;

    /**
     * Decodes a ReqMatchRoom message from the specified reader or buffer, length delimited.
     * @param reader Reader or buffer to decode from
     * @returns ReqMatchRoom
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ReqMatchRoom;

    /**
     * Verifies a ReqMatchRoom message.
     * @param message Plain object to verify
     * @returns `null` if valid, otherwise the reason why it is not
     */
    public static verify(message: { [k: string]: any }): (string|null);

    /**
     * Creates a ReqMatchRoom message from a plain object. Also converts values to their respective internal types.
     * @param object Plain object
     * @returns ReqMatchRoom
     */
    public static fromObject(object: { [k: string]: any }): ReqMatchRoom;

    /**
     * Creates a plain object from a ReqMatchRoom message. Also converts values to other types if specified.
     * @param message ReqMatchRoom
     * @param [options] Conversion options
     * @returns Plain object
     */
    public static toObject(message: ReqMatchRoom, options?: $protobuf.IConversionOptions): { [k: string]: any };

    /**
     * Converts this ReqMatchRoom to JSON.
     * @returns JSON object
     */
    public toJSON(): { [k: string]: any };

    /**
     * Gets the default type url for ReqMatchRoom
     * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns The default type url
     */
    public static getTypeUrl(typeUrlPrefix?: string): string;
}

/** Properties of a RspMatchRoom. */
export interface IRspMatchRoom {

    /** RspMatchRoom code */
    code?: (ErrCode|null);

    /** RspMatchRoom gameId */
    gameId?: (ServiceTypeId|null);

    /** RspMatchRoom roomType */
    roomType?: (number|null);

    /** RspMatchRoom User */
    User?: (IGameUser|null);

    /** RspMatchRoom colorInfo */
    colorInfo?: (RspMatchRoom.IColorInfo|null);
}

/** Represents a RspMatchRoom. */
export class RspMatchRoom implements IRspMatchRoom {

    /**
     * Constructs a new RspMatchRoom.
     * @param [properties] Properties to set
     */
    constructor(properties?: IRspMatchRoom);

    /** RspMatchRoom code. */
    public code: ErrCode;

    /** RspMatchRoom gameId. */
    public gameId: ServiceTypeId;

    /** RspMatchRoom roomType. */
    public roomType: number;

    /** RspMatchRoom User. */
    public User?: (IGameUser|null);

    /** RspMatchRoom colorInfo. */
    public colorInfo?: (RspMatchRoom.IColorInfo|null);

    /**
     * Creates a new RspMatchRoom instance using the specified properties.
     * @param [properties] Properties to set
     * @returns RspMatchRoom instance
     */
    public static create(properties?: IRspMatchRoom): RspMatchRoom;

    /**
     * Encodes the specified RspMatchRoom message. Does not implicitly {@link RspMatchRoom.verify|verify} messages.
     * @param message RspMatchRoom message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encode(message: IRspMatchRoom, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Encodes the specified RspMatchRoom message, length delimited. Does not implicitly {@link RspMatchRoom.verify|verify} messages.
     * @param message RspMatchRoom message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encodeDelimited(message: IRspMatchRoom, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Decodes a RspMatchRoom message from the specified reader or buffer.
     * @param reader Reader or buffer to decode from
     * @param [length] Message length if known beforehand
     * @returns RspMatchRoom
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): RspMatchRoom;

    /**
     * Decodes a RspMatchRoom message from the specified reader or buffer, length delimited.
     * @param reader Reader or buffer to decode from
     * @returns RspMatchRoom
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): RspMatchRoom;

    /**
     * Verifies a RspMatchRoom message.
     * @param message Plain object to verify
     * @returns `null` if valid, otherwise the reason why it is not
     */
    public static verify(message: { [k: string]: any }): (string|null);

    /**
     * Creates a RspMatchRoom message from a plain object. Also converts values to their respective internal types.
     * @param object Plain object
     * @returns RspMatchRoom
     */
    public static fromObject(object: { [k: string]: any }): RspMatchRoom;

    /**
     * Creates a plain object from a RspMatchRoom message. Also converts values to other types if specified.
     * @param message RspMatchRoom
     * @param [options] Conversion options
     * @returns Plain object
     */
    public static toObject(message: RspMatchRoom, options?: $protobuf.IConversionOptions): { [k: string]: any };

    /**
     * Converts this RspMatchRoom to JSON.
     * @returns JSON object
     */
    public toJSON(): { [k: string]: any };

    /**
     * Gets the default type url for RspMatchRoom
     * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns The default type url
     */
    public static getTypeUrl(typeUrlPrefix?: string): string;
}

export namespace RspMatchRoom {

    /** Properties of a ColorInfo. */
    interface IColorInfo {
    }

    /** Represents a ColorInfo. */
    class ColorInfo implements IColorInfo {

        /**
         * Constructs a new ColorInfo.
         * @param [properties] Properties to set
         */
        constructor(properties?: RspMatchRoom.IColorInfo);

        /**
         * Creates a new ColorInfo instance using the specified properties.
         * @param [properties] Properties to set
         * @returns ColorInfo instance
         */
        public static create(properties?: RspMatchRoom.IColorInfo): RspMatchRoom.ColorInfo;

        /**
         * Encodes the specified ColorInfo message. Does not implicitly {@link RspMatchRoom.ColorInfo.verify|verify} messages.
         * @param message ColorInfo message or plain object to encode
         * @param [writer] Writer to encode to
         * @returns Writer
         */
        public static encode(message: RspMatchRoom.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer;

        /**
         * Encodes the specified ColorInfo message, length delimited. Does not implicitly {@link RspMatchRoom.ColorInfo.verify|verify} messages.
         * @param message ColorInfo message or plain object to encode
         * @param [writer] Writer to encode to
         * @returns Writer
         */
        public static encodeDelimited(message: RspMatchRoom.IColorInfo, writer?: $protobuf.Writer): $protobuf.Writer;

        /**
         * Decodes a ColorInfo message from the specified reader or buffer.
         * @param reader Reader or buffer to decode from
         * @param [length] Message length if known beforehand
         * @returns ColorInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): RspMatchRoom.ColorInfo;

        /**
         * Decodes a ColorInfo message from the specified reader or buffer, length delimited.
         * @param reader Reader or buffer to decode from
         * @returns ColorInfo
         * @throws {Error} If the payload is not a reader or valid buffer
         * @throws {$protobuf.util.ProtocolError} If required fields are missing
         */
        public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): RspMatchRoom.ColorInfo;

        /**
         * Verifies a ColorInfo message.
         * @param message Plain object to verify
         * @returns `null` if valid, otherwise the reason why it is not
         */
        public static verify(message: { [k: string]: any }): (string|null);

        /**
         * Creates a ColorInfo message from a plain object. Also converts values to their respective internal types.
         * @param object Plain object
         * @returns ColorInfo
         */
        public static fromObject(object: { [k: string]: any }): RspMatchRoom.ColorInfo;

        /**
         * Creates a plain object from a ColorInfo message. Also converts values to other types if specified.
         * @param message ColorInfo
         * @param [options] Conversion options
         * @returns Plain object
         */
        public static toObject(message: RspMatchRoom.ColorInfo, options?: $protobuf.IConversionOptions): { [k: string]: any };

        /**
         * Converts this ColorInfo to JSON.
         * @returns JSON object
         */
        public toJSON(): { [k: string]: any };

        /**
         * Gets the default type url for ColorInfo
         * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
         * @returns The default type url
         */
        public static getTypeUrl(typeUrlPrefix?: string): string;
    }
}

/** Properties of a NotifyUserEnterRoom. */
export interface INotifyUserEnterRoom {

    /** NotifyUserEnterRoom User */
    User?: (IGameUser[]|null);
}

/** Represents a NotifyUserEnterRoom. */
export class NotifyUserEnterRoom implements INotifyUserEnterRoom {

    /**
     * Constructs a new NotifyUserEnterRoom.
     * @param [properties] Properties to set
     */
    constructor(properties?: INotifyUserEnterRoom);

    /** NotifyUserEnterRoom User. */
    public User: IGameUser[];

    /**
     * Creates a new NotifyUserEnterRoom instance using the specified properties.
     * @param [properties] Properties to set
     * @returns NotifyUserEnterRoom instance
     */
    public static create(properties?: INotifyUserEnterRoom): NotifyUserEnterRoom;

    /**
     * Encodes the specified NotifyUserEnterRoom message. Does not implicitly {@link NotifyUserEnterRoom.verify|verify} messages.
     * @param message NotifyUserEnterRoom message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encode(message: INotifyUserEnterRoom, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Encodes the specified NotifyUserEnterRoom message, length delimited. Does not implicitly {@link NotifyUserEnterRoom.verify|verify} messages.
     * @param message NotifyUserEnterRoom message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encodeDelimited(message: INotifyUserEnterRoom, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Decodes a NotifyUserEnterRoom message from the specified reader or buffer.
     * @param reader Reader or buffer to decode from
     * @param [length] Message length if known beforehand
     * @returns NotifyUserEnterRoom
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): NotifyUserEnterRoom;

    /**
     * Decodes a NotifyUserEnterRoom message from the specified reader or buffer, length delimited.
     * @param reader Reader or buffer to decode from
     * @returns NotifyUserEnterRoom
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): NotifyUserEnterRoom;

    /**
     * Verifies a NotifyUserEnterRoom message.
     * @param message Plain object to verify
     * @returns `null` if valid, otherwise the reason why it is not
     */
    public static verify(message: { [k: string]: any }): (string|null);

    /**
     * Creates a NotifyUserEnterRoom message from a plain object. Also converts values to their respective internal types.
     * @param object Plain object
     * @returns NotifyUserEnterRoom
     */
    public static fromObject(object: { [k: string]: any }): NotifyUserEnterRoom;

    /**
     * Creates a plain object from a NotifyUserEnterRoom message. Also converts values to other types if specified.
     * @param message NotifyUserEnterRoom
     * @param [options] Conversion options
     * @returns Plain object
     */
    public static toObject(message: NotifyUserEnterRoom, options?: $protobuf.IConversionOptions): { [k: string]: any };

    /**
     * Converts this NotifyUserEnterRoom to JSON.
     * @returns JSON object
     */
    public toJSON(): { [k: string]: any };

    /**
     * Gets the default type url for NotifyUserEnterRoom
     * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns The default type url
     */
    public static getTypeUrl(typeUrlPrefix?: string): string;
}

/** ErrCode enum. */
export enum ErrCode {
    OK = 0,
    SystemErr = 1,
    ParamErr = 2,
    LoginDiffLoc = 100,
    LoginUserOrPwdErr = 102,
    AccountFrozen = 103,
    AccountBanned = 104,
    RegisterUserExist = 110,
    VersionTooLow = 115,
    Maintain = 120,
    GoldNotEnough = 125,
    NotBetCount = 126,
    NotLeaveRoom = 127,
    TotalBetExceedsLimit = 500,
    AreaBetExceedsLimit = 505
}

/** Represents a ChatUser. */
export class ChatUser implements IChatUser {

    /**
     * Constructs a new ChatUser.
     * @param [properties] Properties to set
     */
    constructor(properties?: IChatUser);

    /** ChatUser userId. */
    public userId: Long;

    /** ChatUser nickname. */
    public nickname: string;

    /** ChatUser avatar. */
    public avatar: string;

    /** ChatUser avatarFrame. */
    public avatarFrame: string;

    /** ChatUser vipLevel. */
    public vipLevel: string;

    /**
     * Creates a new ChatUser instance using the specified properties.
     * @param [properties] Properties to set
     * @returns ChatUser instance
     */
    public static create(properties?: IChatUser): ChatUser;

    /**
     * Encodes the specified ChatUser message. Does not implicitly {@link ChatUser.verify|verify} messages.
     * @param message ChatUser message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encode(message: IChatUser, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Encodes the specified ChatUser message, length delimited. Does not implicitly {@link ChatUser.verify|verify} messages.
     * @param message ChatUser message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encodeDelimited(message: IChatUser, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Decodes a ChatUser message from the specified reader or buffer.
     * @param reader Reader or buffer to decode from
     * @param [length] Message length if known beforehand
     * @returns ChatUser
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): ChatUser;

    /**
     * Decodes a ChatUser message from the specified reader or buffer, length delimited.
     * @param reader Reader or buffer to decode from
     * @returns ChatUser
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): ChatUser;

    /**
     * Verifies a ChatUser message.
     * @param message Plain object to verify
     * @returns `null` if valid, otherwise the reason why it is not
     */
    public static verify(message: { [k: string]: any }): (string|null);

    /**
     * Creates a ChatUser message from a plain object. Also converts values to their respective internal types.
     * @param object Plain object
     * @returns ChatUser
     */
    public static fromObject(object: { [k: string]: any }): ChatUser;

    /**
     * Creates a plain object from a ChatUser message. Also converts values to other types if specified.
     * @param message ChatUser
     * @param [options] Conversion options
     * @returns Plain object
     */
    public static toObject(message: ChatUser, options?: $protobuf.IConversionOptions): { [k: string]: any };

    /**
     * Converts this ChatUser to JSON.
     * @returns JSON object
     */
    public toJSON(): { [k: string]: any };

    /**
     * Gets the default type url for ChatUser
     * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns The default type url
     */
    public static getTypeUrl(typeUrlPrefix?: string): string;
}

/** Represents a GameUser. */
export class GameUser implements IGameUser {

    /**
     * Constructs a new GameUser.
     * @param [properties] Properties to set
     */
    constructor(properties?: IGameUser);

    /** GameUser userId. */
    public userId: Long;

    /** GameUser nickname. */
    public nickname: string;

    /** GameUser avatar. */
    public avatar: string;

    /** GameUser avatarFrame. */
    public avatarFrame: string;

    /** GameUser vipLevel. */
    public vipLevel: number;

    /** GameUser vipExp. */
    public vipExp: number;

    /** GameUser seat. */
    public seat: Long;

    /** GameUser gold. */
    public gold: Long;

    /**
     * Creates a new GameUser instance using the specified properties.
     * @param [properties] Properties to set
     * @returns GameUser instance
     */
    public static create(properties?: IGameUser): GameUser;

    /**
     * Encodes the specified GameUser message. Does not implicitly {@link GameUser.verify|verify} messages.
     * @param message GameUser message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encode(message: IGameUser, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Encodes the specified GameUser message, length delimited. Does not implicitly {@link GameUser.verify|verify} messages.
     * @param message GameUser message or plain object to encode
     * @param [writer] Writer to encode to
     * @returns Writer
     */
    public static encodeDelimited(message: IGameUser, writer?: $protobuf.Writer): $protobuf.Writer;

    /**
     * Decodes a GameUser message from the specified reader or buffer.
     * @param reader Reader or buffer to decode from
     * @param [length] Message length if known beforehand
     * @returns GameUser
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decode(reader: ($protobuf.Reader|Uint8Array), length?: number): GameUser;

    /**
     * Decodes a GameUser message from the specified reader or buffer, length delimited.
     * @param reader Reader or buffer to decode from
     * @returns GameUser
     * @throws {Error} If the payload is not a reader or valid buffer
     * @throws {$protobuf.util.ProtocolError} If required fields are missing
     */
    public static decodeDelimited(reader: ($protobuf.Reader|Uint8Array)): GameUser;

    /**
     * Verifies a GameUser message.
     * @param message Plain object to verify
     * @returns `null` if valid, otherwise the reason why it is not
     */
    public static verify(message: { [k: string]: any }): (string|null);

    /**
     * Creates a GameUser message from a plain object. Also converts values to their respective internal types.
     * @param object Plain object
     * @returns GameUser
     */
    public static fromObject(object: { [k: string]: any }): GameUser;

    /**
     * Creates a plain object from a GameUser message. Also converts values to other types if specified.
     * @param message GameUser
     * @param [options] Conversion options
     * @returns Plain object
     */
    public static toObject(message: GameUser, options?: $protobuf.IConversionOptions): { [k: string]: any };

    /**
     * Converts this GameUser to JSON.
     * @returns JSON object
     */
    public toJSON(): { [k: string]: any };

    /**
     * Gets the default type url for GameUser
     * @param [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
     * @returns The default type url
     */
    public static getTypeUrl(typeUrlPrefix?: string): string;
}

/** ServiceTypeId enum. */
export enum ServiceTypeId {
    STI_Unknown = 0,
    STI_Login = 10000,
    STI_Chat = 10005,
    STI_Match = 10010,
    STI_Lobby = 10015,
    STI_Admin = 10020,
    STI_Gate = 20000,
    STI_ColorGame = 20005,
    STI_DB = 30000
}
