game_sync/protocol/chesstitians/chesstitians.js

6243 lines
290 KiB
JavaScript

/*eslint-disable block-scoped-var, id-length, no-control-regex, no-magic-numbers, no-prototype-builtins, no-redeclare, no-shadow, no-var, sort-vars*/
"use strict";
var $protobuf = require("protobufjs/minimal.js");
// Common aliases
var $Reader = $protobuf.Reader, $Writer = $protobuf.Writer, $util = $protobuf.util;
// Exported root namespace
var $root = $protobuf.roots["default"] || ($protobuf.roots["default"] = {});
$root.chesstitians = (function() {
/**
* Namespace chesstitians.
* @exports chesstitians
* @namespace
*/
var chesstitians = {};
/**
* OpResultCode enum.
* @name chesstitians.OpResultCode
* @enum {number}
* @property {number} OPRC_Sucess=0 OPRC_Sucess value
* @property {number} OPRC_Error=1 OPRC_Error value
*/
chesstitians.OpResultCode = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "OPRC_Sucess"] = 0;
values[valuesById[1] = "OPRC_Error"] = 1;
return values;
})();
/**
* ChesstitiansPacketID enum.
* @name chesstitians.ChesstitiansPacketID
* @enum {number}
* @property {number} PACKET_ChesstitiansZERO=0 PACKET_ChesstitiansZERO value
* @property {number} PACKET_SCChesstitiansRoomInfo=5370 PACKET_SCChesstitiansRoomInfo value
* @property {number} PACKET_SCChesstitiansRoomState=5371 PACKET_SCChesstitiansRoomState value
* @property {number} PACKET_CSChesstitiansPlayerOp=5372 PACKET_CSChesstitiansPlayerOp value
* @property {number} PACKET_SCChesstitiansPlayerOp=5373 PACKET_SCChesstitiansPlayerOp value
* @property {number} PACKET_SCChesstitiansPlayerEnter=5374 PACKET_SCChesstitiansPlayerEnter value
* @property {number} PACKET_SCChesstitiansPlayerLeave=5375 PACKET_SCChesstitiansPlayerLeave value
* @property {number} PACKET_SCChesstitiansCard=5376 PACKET_SCChesstitiansCard value
* @property {number} PACKET_SCChesstitiansGameBilled=5377 PACKET_SCChesstitiansGameBilled value
* @property {number} PACKET_SCChesstitiansCurOpPos=5378 PACKET_SCChesstitiansCurOpPos value
* @property {number} PACKET_SCChesstitiansSmallGameBilled=5379 PACKET_SCChesstitiansSmallGameBilled value
* @property {number} PACKET_SCChesstitiansUpdateMasterSnid=5380 PACKET_SCChesstitiansUpdateMasterSnid value
* @property {number} PACKET_SCChesstitiansUpdateAudienceNum=5381 PACKET_SCChesstitiansUpdateAudienceNum value
* @property {number} PACKET_SCChesstitiansAI=5382 PACKET_SCChesstitiansAI value
* @property {number} PACKET_SCChesstitiansFirstOpPos=5383 PACKET_SCChesstitiansFirstOpPos value
* @property {number} PACKET_SCChesstitiansCardTest=5384 PACKET_SCChesstitiansCardTest value
*/
chesstitians.ChesstitiansPacketID = (function() {
var valuesById = {}, values = Object.create(valuesById);
values[valuesById[0] = "PACKET_ChesstitiansZERO"] = 0;
values[valuesById[5370] = "PACKET_SCChesstitiansRoomInfo"] = 5370;
values[valuesById[5371] = "PACKET_SCChesstitiansRoomState"] = 5371;
values[valuesById[5372] = "PACKET_CSChesstitiansPlayerOp"] = 5372;
values[valuesById[5373] = "PACKET_SCChesstitiansPlayerOp"] = 5373;
values[valuesById[5374] = "PACKET_SCChesstitiansPlayerEnter"] = 5374;
values[valuesById[5375] = "PACKET_SCChesstitiansPlayerLeave"] = 5375;
values[valuesById[5376] = "PACKET_SCChesstitiansCard"] = 5376;
values[valuesById[5377] = "PACKET_SCChesstitiansGameBilled"] = 5377;
values[valuesById[5378] = "PACKET_SCChesstitiansCurOpPos"] = 5378;
values[valuesById[5379] = "PACKET_SCChesstitiansSmallGameBilled"] = 5379;
values[valuesById[5380] = "PACKET_SCChesstitiansUpdateMasterSnid"] = 5380;
values[valuesById[5381] = "PACKET_SCChesstitiansUpdateAudienceNum"] = 5381;
values[valuesById[5382] = "PACKET_SCChesstitiansAI"] = 5382;
values[valuesById[5383] = "PACKET_SCChesstitiansFirstOpPos"] = 5383;
values[valuesById[5384] = "PACKET_SCChesstitiansCardTest"] = 5384;
return values;
})();
chesstitians.ChesstitiansPlayerData = (function() {
/**
* Properties of a ChesstitiansPlayerData.
* @memberof chesstitians
* @interface IChesstitiansPlayerData
* @property {string|null} [Name] ChesstitiansPlayerData Name
* @property {number|null} [SnId] ChesstitiansPlayerData SnId
* @property {number|null} [Head] ChesstitiansPlayerData Head
* @property {number|null} [Sex] ChesstitiansPlayerData Sex
* @property {Array.<string>|null} [Params] ChesstitiansPlayerData Params
* @property {number|Long|null} [Coin] ChesstitiansPlayerData Coin
* @property {number|null} [Pos] ChesstitiansPlayerData Pos
* @property {number|null} [Flag] ChesstitiansPlayerData Flag
* @property {number|null} [Longitude] ChesstitiansPlayerData Longitude
* @property {number|null} [Latitude] ChesstitiansPlayerData Latitude
* @property {string|null} [City] ChesstitiansPlayerData City
* @property {number|null} [LastOp] ChesstitiansPlayerData LastOp
* @property {number|null} [VIP] ChesstitiansPlayerData VIP
* @property {number|null} [HeadOutLine] ChesstitiansPlayerData HeadOutLine
* @property {number|null} [NiceId] ChesstitiansPlayerData NiceId
* @property {Array.<number>|null} [Cards] ChesstitiansPlayerData Cards
* @property {number|Long|null} [CurRoundTotalBet] ChesstitiansPlayerData CurRoundTotalBet
* @property {number|Long|null} [GameCoin] ChesstitiansPlayerData GameCoin
* @property {number|null} [RoleId] ChesstitiansPlayerData RoleId
* @property {Object.<string,number>|null} [Items] ChesstitiansPlayerData Items
* @property {number|null} [MatchRankId] ChesstitiansPlayerData MatchRankId
* @property {number|null} [Lv] ChesstitiansPlayerData Lv
* @property {number|null} [CopySnid] ChesstitiansPlayerData CopySnid
* @property {number|null} [CopyRoleId] ChesstitiansPlayerData CopyRoleId
*/
/**
* Constructs a new ChesstitiansPlayerData.
* @memberof chesstitians
* @classdesc Represents a ChesstitiansPlayerData.
* @implements IChesstitiansPlayerData
* @constructor
* @param {chesstitians.IChesstitiansPlayerData=} [properties] Properties to set
*/
function ChesstitiansPlayerData(properties) {
this.Params = [];
this.Cards = [];
this.Items = {};
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ChesstitiansPlayerData Name.
* @member {string} Name
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Name = "";
/**
* ChesstitiansPlayerData SnId.
* @member {number} SnId
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.SnId = 0;
/**
* ChesstitiansPlayerData Head.
* @member {number} Head
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Head = 0;
/**
* ChesstitiansPlayerData Sex.
* @member {number} Sex
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Sex = 0;
/**
* ChesstitiansPlayerData Params.
* @member {Array.<string>} Params
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Params = $util.emptyArray;
/**
* ChesstitiansPlayerData Coin.
* @member {number|Long} Coin
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Coin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* ChesstitiansPlayerData Pos.
* @member {number} Pos
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Pos = 0;
/**
* ChesstitiansPlayerData Flag.
* @member {number} Flag
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Flag = 0;
/**
* ChesstitiansPlayerData Longitude.
* @member {number} Longitude
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Longitude = 0;
/**
* ChesstitiansPlayerData Latitude.
* @member {number} Latitude
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Latitude = 0;
/**
* ChesstitiansPlayerData City.
* @member {string} City
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.City = "";
/**
* ChesstitiansPlayerData LastOp.
* @member {number} LastOp
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.LastOp = 0;
/**
* ChesstitiansPlayerData VIP.
* @member {number} VIP
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.VIP = 0;
/**
* ChesstitiansPlayerData HeadOutLine.
* @member {number} HeadOutLine
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.HeadOutLine = 0;
/**
* ChesstitiansPlayerData NiceId.
* @member {number} NiceId
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.NiceId = 0;
/**
* ChesstitiansPlayerData Cards.
* @member {Array.<number>} Cards
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Cards = $util.emptyArray;
/**
* ChesstitiansPlayerData CurRoundTotalBet.
* @member {number|Long} CurRoundTotalBet
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.CurRoundTotalBet = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* ChesstitiansPlayerData GameCoin.
* @member {number|Long} GameCoin
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.GameCoin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* ChesstitiansPlayerData RoleId.
* @member {number} RoleId
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.RoleId = 0;
/**
* ChesstitiansPlayerData Items.
* @member {Object.<string,number>} Items
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Items = $util.emptyObject;
/**
* ChesstitiansPlayerData MatchRankId.
* @member {number} MatchRankId
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.MatchRankId = 0;
/**
* ChesstitiansPlayerData Lv.
* @member {number} Lv
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.Lv = 0;
/**
* ChesstitiansPlayerData CopySnid.
* @member {number} CopySnid
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.CopySnid = 0;
/**
* ChesstitiansPlayerData CopyRoleId.
* @member {number} CopyRoleId
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
*/
ChesstitiansPlayerData.prototype.CopyRoleId = 0;
/**
* Creates a new ChesstitiansPlayerData instance using the specified properties.
* @function create
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {chesstitians.IChesstitiansPlayerData=} [properties] Properties to set
* @returns {chesstitians.ChesstitiansPlayerData} ChesstitiansPlayerData instance
*/
ChesstitiansPlayerData.create = function create(properties) {
return new ChesstitiansPlayerData(properties);
};
/**
* Encodes the specified ChesstitiansPlayerData message. Does not implicitly {@link chesstitians.ChesstitiansPlayerData.verify|verify} messages.
* @function encode
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {chesstitians.IChesstitiansPlayerData} message ChesstitiansPlayerData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChesstitiansPlayerData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Name != null && Object.hasOwnProperty.call(message, "Name"))
writer.uint32(/* id 1, wireType 2 =*/10).string(message.Name);
if (message.SnId != null && Object.hasOwnProperty.call(message, "SnId"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.SnId);
if (message.Head != null && Object.hasOwnProperty.call(message, "Head"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.Head);
if (message.Sex != null && Object.hasOwnProperty.call(message, "Sex"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.Sex);
if (message.Params != null && message.Params.length)
for (var i = 0; i < message.Params.length; ++i)
writer.uint32(/* id 5, wireType 2 =*/42).string(message.Params[i]);
if (message.Coin != null && Object.hasOwnProperty.call(message, "Coin"))
writer.uint32(/* id 6, wireType 0 =*/48).int64(message.Coin);
if (message.Pos != null && Object.hasOwnProperty.call(message, "Pos"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.Pos);
if (message.Flag != null && Object.hasOwnProperty.call(message, "Flag"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.Flag);
if (message.Longitude != null && Object.hasOwnProperty.call(message, "Longitude"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.Longitude);
if (message.Latitude != null && Object.hasOwnProperty.call(message, "Latitude"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.Latitude);
if (message.City != null && Object.hasOwnProperty.call(message, "City"))
writer.uint32(/* id 11, wireType 2 =*/90).string(message.City);
if (message.LastOp != null && Object.hasOwnProperty.call(message, "LastOp"))
writer.uint32(/* id 12, wireType 0 =*/96).int32(message.LastOp);
if (message.VIP != null && Object.hasOwnProperty.call(message, "VIP"))
writer.uint32(/* id 13, wireType 0 =*/104).int32(message.VIP);
if (message.HeadOutLine != null && Object.hasOwnProperty.call(message, "HeadOutLine"))
writer.uint32(/* id 14, wireType 0 =*/112).int32(message.HeadOutLine);
if (message.NiceId != null && Object.hasOwnProperty.call(message, "NiceId"))
writer.uint32(/* id 15, wireType 0 =*/120).int32(message.NiceId);
if (message.Cards != null && message.Cards.length) {
writer.uint32(/* id 16, wireType 2 =*/130).fork();
for (var i = 0; i < message.Cards.length; ++i)
writer.int32(message.Cards[i]);
writer.ldelim();
}
if (message.CurRoundTotalBet != null && Object.hasOwnProperty.call(message, "CurRoundTotalBet"))
writer.uint32(/* id 17, wireType 0 =*/136).int64(message.CurRoundTotalBet);
if (message.GameCoin != null && Object.hasOwnProperty.call(message, "GameCoin"))
writer.uint32(/* id 18, wireType 0 =*/144).int64(message.GameCoin);
if (message.RoleId != null && Object.hasOwnProperty.call(message, "RoleId"))
writer.uint32(/* id 19, wireType 0 =*/152).int32(message.RoleId);
if (message.Items != null && Object.hasOwnProperty.call(message, "Items"))
for (var keys = Object.keys(message.Items), i = 0; i < keys.length; ++i)
writer.uint32(/* id 20, wireType 2 =*/162).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Items[keys[i]]).ldelim();
if (message.MatchRankId != null && Object.hasOwnProperty.call(message, "MatchRankId"))
writer.uint32(/* id 21, wireType 0 =*/168).int32(message.MatchRankId);
if (message.Lv != null && Object.hasOwnProperty.call(message, "Lv"))
writer.uint32(/* id 22, wireType 0 =*/176).int32(message.Lv);
if (message.CopySnid != null && Object.hasOwnProperty.call(message, "CopySnid"))
writer.uint32(/* id 23, wireType 0 =*/184).int32(message.CopySnid);
if (message.CopyRoleId != null && Object.hasOwnProperty.call(message, "CopyRoleId"))
writer.uint32(/* id 24, wireType 0 =*/192).int32(message.CopyRoleId);
return writer;
};
/**
* Encodes the specified ChesstitiansPlayerData message, length delimited. Does not implicitly {@link chesstitians.ChesstitiansPlayerData.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {chesstitians.IChesstitiansPlayerData} message ChesstitiansPlayerData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChesstitiansPlayerData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ChesstitiansPlayerData message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.ChesstitiansPlayerData} ChesstitiansPlayerData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChesstitiansPlayerData.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.ChesstitiansPlayerData(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Name = reader.string();
break;
}
case 2: {
message.SnId = reader.int32();
break;
}
case 3: {
message.Head = reader.int32();
break;
}
case 4: {
message.Sex = reader.int32();
break;
}
case 5: {
if (!(message.Params && message.Params.length))
message.Params = [];
message.Params.push(reader.string());
break;
}
case 6: {
message.Coin = reader.int64();
break;
}
case 7: {
message.Pos = reader.int32();
break;
}
case 8: {
message.Flag = reader.int32();
break;
}
case 9: {
message.Longitude = reader.int32();
break;
}
case 10: {
message.Latitude = reader.int32();
break;
}
case 11: {
message.City = reader.string();
break;
}
case 12: {
message.LastOp = reader.int32();
break;
}
case 13: {
message.VIP = reader.int32();
break;
}
case 14: {
message.HeadOutLine = reader.int32();
break;
}
case 15: {
message.NiceId = reader.int32();
break;
}
case 16: {
if (!(message.Cards && message.Cards.length))
message.Cards = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Cards.push(reader.int32());
} else
message.Cards.push(reader.int32());
break;
}
case 17: {
message.CurRoundTotalBet = reader.int64();
break;
}
case 18: {
message.GameCoin = reader.int64();
break;
}
case 19: {
message.RoleId = reader.int32();
break;
}
case 20: {
if (message.Items === $util.emptyObject)
message.Items = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Items[key] = value;
break;
}
case 21: {
message.MatchRankId = reader.int32();
break;
}
case 22: {
message.Lv = reader.int32();
break;
}
case 23: {
message.CopySnid = reader.int32();
break;
}
case 24: {
message.CopyRoleId = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ChesstitiansPlayerData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.ChesstitiansPlayerData} ChesstitiansPlayerData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChesstitiansPlayerData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ChesstitiansPlayerData message.
* @function verify
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ChesstitiansPlayerData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Name != null && message.hasOwnProperty("Name"))
if (!$util.isString(message.Name))
return "Name: string expected";
if (message.SnId != null && message.hasOwnProperty("SnId"))
if (!$util.isInteger(message.SnId))
return "SnId: integer expected";
if (message.Head != null && message.hasOwnProperty("Head"))
if (!$util.isInteger(message.Head))
return "Head: integer expected";
if (message.Sex != null && message.hasOwnProperty("Sex"))
if (!$util.isInteger(message.Sex))
return "Sex: integer expected";
if (message.Params != null && message.hasOwnProperty("Params")) {
if (!Array.isArray(message.Params))
return "Params: array expected";
for (var i = 0; i < message.Params.length; ++i)
if (!$util.isString(message.Params[i]))
return "Params: string[] expected";
}
if (message.Coin != null && message.hasOwnProperty("Coin"))
if (!$util.isInteger(message.Coin) && !(message.Coin && $util.isInteger(message.Coin.low) && $util.isInteger(message.Coin.high)))
return "Coin: integer|Long expected";
if (message.Pos != null && message.hasOwnProperty("Pos"))
if (!$util.isInteger(message.Pos))
return "Pos: integer expected";
if (message.Flag != null && message.hasOwnProperty("Flag"))
if (!$util.isInteger(message.Flag))
return "Flag: integer expected";
if (message.Longitude != null && message.hasOwnProperty("Longitude"))
if (!$util.isInteger(message.Longitude))
return "Longitude: integer expected";
if (message.Latitude != null && message.hasOwnProperty("Latitude"))
if (!$util.isInteger(message.Latitude))
return "Latitude: integer expected";
if (message.City != null && message.hasOwnProperty("City"))
if (!$util.isString(message.City))
return "City: string expected";
if (message.LastOp != null && message.hasOwnProperty("LastOp"))
if (!$util.isInteger(message.LastOp))
return "LastOp: integer expected";
if (message.VIP != null && message.hasOwnProperty("VIP"))
if (!$util.isInteger(message.VIP))
return "VIP: integer expected";
if (message.HeadOutLine != null && message.hasOwnProperty("HeadOutLine"))
if (!$util.isInteger(message.HeadOutLine))
return "HeadOutLine: integer expected";
if (message.NiceId != null && message.hasOwnProperty("NiceId"))
if (!$util.isInteger(message.NiceId))
return "NiceId: integer expected";
if (message.Cards != null && message.hasOwnProperty("Cards")) {
if (!Array.isArray(message.Cards))
return "Cards: array expected";
for (var i = 0; i < message.Cards.length; ++i)
if (!$util.isInteger(message.Cards[i]))
return "Cards: integer[] expected";
}
if (message.CurRoundTotalBet != null && message.hasOwnProperty("CurRoundTotalBet"))
if (!$util.isInteger(message.CurRoundTotalBet) && !(message.CurRoundTotalBet && $util.isInteger(message.CurRoundTotalBet.low) && $util.isInteger(message.CurRoundTotalBet.high)))
return "CurRoundTotalBet: integer|Long expected";
if (message.GameCoin != null && message.hasOwnProperty("GameCoin"))
if (!$util.isInteger(message.GameCoin) && !(message.GameCoin && $util.isInteger(message.GameCoin.low) && $util.isInteger(message.GameCoin.high)))
return "GameCoin: integer|Long expected";
if (message.RoleId != null && message.hasOwnProperty("RoleId"))
if (!$util.isInteger(message.RoleId))
return "RoleId: integer expected";
if (message.Items != null && message.hasOwnProperty("Items")) {
if (!$util.isObject(message.Items))
return "Items: object expected";
var key = Object.keys(message.Items);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Items: integer key{k:int32} expected";
if (!$util.isInteger(message.Items[key[i]]))
return "Items: integer{k:int32} expected";
}
}
if (message.MatchRankId != null && message.hasOwnProperty("MatchRankId"))
if (!$util.isInteger(message.MatchRankId))
return "MatchRankId: integer expected";
if (message.Lv != null && message.hasOwnProperty("Lv"))
if (!$util.isInteger(message.Lv))
return "Lv: integer expected";
if (message.CopySnid != null && message.hasOwnProperty("CopySnid"))
if (!$util.isInteger(message.CopySnid))
return "CopySnid: integer expected";
if (message.CopyRoleId != null && message.hasOwnProperty("CopyRoleId"))
if (!$util.isInteger(message.CopyRoleId))
return "CopyRoleId: integer expected";
return null;
};
/**
* Creates a ChesstitiansPlayerData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.ChesstitiansPlayerData} ChesstitiansPlayerData
*/
ChesstitiansPlayerData.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.ChesstitiansPlayerData)
return object;
var message = new $root.chesstitians.ChesstitiansPlayerData();
if (object.Name != null)
message.Name = String(object.Name);
if (object.SnId != null)
message.SnId = object.SnId | 0;
if (object.Head != null)
message.Head = object.Head | 0;
if (object.Sex != null)
message.Sex = object.Sex | 0;
if (object.Params) {
if (!Array.isArray(object.Params))
throw TypeError(".chesstitians.ChesstitiansPlayerData.Params: array expected");
message.Params = [];
for (var i = 0; i < object.Params.length; ++i)
message.Params[i] = String(object.Params[i]);
}
if (object.Coin != null)
if ($util.Long)
(message.Coin = $util.Long.fromValue(object.Coin)).unsigned = false;
else if (typeof object.Coin === "string")
message.Coin = parseInt(object.Coin, 10);
else if (typeof object.Coin === "number")
message.Coin = object.Coin;
else if (typeof object.Coin === "object")
message.Coin = new $util.LongBits(object.Coin.low >>> 0, object.Coin.high >>> 0).toNumber();
if (object.Pos != null)
message.Pos = object.Pos | 0;
if (object.Flag != null)
message.Flag = object.Flag | 0;
if (object.Longitude != null)
message.Longitude = object.Longitude | 0;
if (object.Latitude != null)
message.Latitude = object.Latitude | 0;
if (object.City != null)
message.City = String(object.City);
if (object.LastOp != null)
message.LastOp = object.LastOp | 0;
if (object.VIP != null)
message.VIP = object.VIP | 0;
if (object.HeadOutLine != null)
message.HeadOutLine = object.HeadOutLine | 0;
if (object.NiceId != null)
message.NiceId = object.NiceId | 0;
if (object.Cards) {
if (!Array.isArray(object.Cards))
throw TypeError(".chesstitians.ChesstitiansPlayerData.Cards: array expected");
message.Cards = [];
for (var i = 0; i < object.Cards.length; ++i)
message.Cards[i] = object.Cards[i] | 0;
}
if (object.CurRoundTotalBet != null)
if ($util.Long)
(message.CurRoundTotalBet = $util.Long.fromValue(object.CurRoundTotalBet)).unsigned = false;
else if (typeof object.CurRoundTotalBet === "string")
message.CurRoundTotalBet = parseInt(object.CurRoundTotalBet, 10);
else if (typeof object.CurRoundTotalBet === "number")
message.CurRoundTotalBet = object.CurRoundTotalBet;
else if (typeof object.CurRoundTotalBet === "object")
message.CurRoundTotalBet = new $util.LongBits(object.CurRoundTotalBet.low >>> 0, object.CurRoundTotalBet.high >>> 0).toNumber();
if (object.GameCoin != null)
if ($util.Long)
(message.GameCoin = $util.Long.fromValue(object.GameCoin)).unsigned = false;
else if (typeof object.GameCoin === "string")
message.GameCoin = parseInt(object.GameCoin, 10);
else if (typeof object.GameCoin === "number")
message.GameCoin = object.GameCoin;
else if (typeof object.GameCoin === "object")
message.GameCoin = new $util.LongBits(object.GameCoin.low >>> 0, object.GameCoin.high >>> 0).toNumber();
if (object.RoleId != null)
message.RoleId = object.RoleId | 0;
if (object.Items) {
if (typeof object.Items !== "object")
throw TypeError(".chesstitians.ChesstitiansPlayerData.Items: object expected");
message.Items = {};
for (var keys = Object.keys(object.Items), i = 0; i < keys.length; ++i)
message.Items[keys[i]] = object.Items[keys[i]] | 0;
}
if (object.MatchRankId != null)
message.MatchRankId = object.MatchRankId | 0;
if (object.Lv != null)
message.Lv = object.Lv | 0;
if (object.CopySnid != null)
message.CopySnid = object.CopySnid | 0;
if (object.CopyRoleId != null)
message.CopyRoleId = object.CopyRoleId | 0;
return message;
};
/**
* Creates a plain object from a ChesstitiansPlayerData message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {chesstitians.ChesstitiansPlayerData} message ChesstitiansPlayerData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ChesstitiansPlayerData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.Params = [];
object.Cards = [];
}
if (options.objects || options.defaults)
object.Items = {};
if (options.defaults) {
object.Name = "";
object.SnId = 0;
object.Head = 0;
object.Sex = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.Coin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.Coin = options.longs === String ? "0" : 0;
object.Pos = 0;
object.Flag = 0;
object.Longitude = 0;
object.Latitude = 0;
object.City = "";
object.LastOp = 0;
object.VIP = 0;
object.HeadOutLine = 0;
object.NiceId = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.CurRoundTotalBet = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.CurRoundTotalBet = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.GameCoin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.GameCoin = options.longs === String ? "0" : 0;
object.RoleId = 0;
object.MatchRankId = 0;
object.Lv = 0;
object.CopySnid = 0;
object.CopyRoleId = 0;
}
if (message.Name != null && message.hasOwnProperty("Name"))
object.Name = message.Name;
if (message.SnId != null && message.hasOwnProperty("SnId"))
object.SnId = message.SnId;
if (message.Head != null && message.hasOwnProperty("Head"))
object.Head = message.Head;
if (message.Sex != null && message.hasOwnProperty("Sex"))
object.Sex = message.Sex;
if (message.Params && message.Params.length) {
object.Params = [];
for (var j = 0; j < message.Params.length; ++j)
object.Params[j] = message.Params[j];
}
if (message.Coin != null && message.hasOwnProperty("Coin"))
if (typeof message.Coin === "number")
object.Coin = options.longs === String ? String(message.Coin) : message.Coin;
else
object.Coin = options.longs === String ? $util.Long.prototype.toString.call(message.Coin) : options.longs === Number ? new $util.LongBits(message.Coin.low >>> 0, message.Coin.high >>> 0).toNumber() : message.Coin;
if (message.Pos != null && message.hasOwnProperty("Pos"))
object.Pos = message.Pos;
if (message.Flag != null && message.hasOwnProperty("Flag"))
object.Flag = message.Flag;
if (message.Longitude != null && message.hasOwnProperty("Longitude"))
object.Longitude = message.Longitude;
if (message.Latitude != null && message.hasOwnProperty("Latitude"))
object.Latitude = message.Latitude;
if (message.City != null && message.hasOwnProperty("City"))
object.City = message.City;
if (message.LastOp != null && message.hasOwnProperty("LastOp"))
object.LastOp = message.LastOp;
if (message.VIP != null && message.hasOwnProperty("VIP"))
object.VIP = message.VIP;
if (message.HeadOutLine != null && message.hasOwnProperty("HeadOutLine"))
object.HeadOutLine = message.HeadOutLine;
if (message.NiceId != null && message.hasOwnProperty("NiceId"))
object.NiceId = message.NiceId;
if (message.Cards && message.Cards.length) {
object.Cards = [];
for (var j = 0; j < message.Cards.length; ++j)
object.Cards[j] = message.Cards[j];
}
if (message.CurRoundTotalBet != null && message.hasOwnProperty("CurRoundTotalBet"))
if (typeof message.CurRoundTotalBet === "number")
object.CurRoundTotalBet = options.longs === String ? String(message.CurRoundTotalBet) : message.CurRoundTotalBet;
else
object.CurRoundTotalBet = options.longs === String ? $util.Long.prototype.toString.call(message.CurRoundTotalBet) : options.longs === Number ? new $util.LongBits(message.CurRoundTotalBet.low >>> 0, message.CurRoundTotalBet.high >>> 0).toNumber() : message.CurRoundTotalBet;
if (message.GameCoin != null && message.hasOwnProperty("GameCoin"))
if (typeof message.GameCoin === "number")
object.GameCoin = options.longs === String ? String(message.GameCoin) : message.GameCoin;
else
object.GameCoin = options.longs === String ? $util.Long.prototype.toString.call(message.GameCoin) : options.longs === Number ? new $util.LongBits(message.GameCoin.low >>> 0, message.GameCoin.high >>> 0).toNumber() : message.GameCoin;
if (message.RoleId != null && message.hasOwnProperty("RoleId"))
object.RoleId = message.RoleId;
var keys2;
if (message.Items && (keys2 = Object.keys(message.Items)).length) {
object.Items = {};
for (var j = 0; j < keys2.length; ++j)
object.Items[keys2[j]] = message.Items[keys2[j]];
}
if (message.MatchRankId != null && message.hasOwnProperty("MatchRankId"))
object.MatchRankId = message.MatchRankId;
if (message.Lv != null && message.hasOwnProperty("Lv"))
object.Lv = message.Lv;
if (message.CopySnid != null && message.hasOwnProperty("CopySnid"))
object.CopySnid = message.CopySnid;
if (message.CopyRoleId != null && message.hasOwnProperty("CopyRoleId"))
object.CopyRoleId = message.CopyRoleId;
return object;
};
/**
* Converts this ChesstitiansPlayerData to JSON.
* @function toJSON
* @memberof chesstitians.ChesstitiansPlayerData
* @instance
* @returns {Object.<string,*>} JSON object
*/
ChesstitiansPlayerData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ChesstitiansPlayerData
* @function getTypeUrl
* @memberof chesstitians.ChesstitiansPlayerData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ChesstitiansPlayerData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.ChesstitiansPlayerData";
};
return ChesstitiansPlayerData;
})();
chesstitians.LastDelCard = (function() {
/**
* Properties of a LastDelCard.
* @memberof chesstitians
* @interface ILastDelCard
* @property {Array.<number>|null} [Cards] LastDelCard Cards
*/
/**
* Constructs a new LastDelCard.
* @memberof chesstitians
* @classdesc Represents a LastDelCard.
* @implements ILastDelCard
* @constructor
* @param {chesstitians.ILastDelCard=} [properties] Properties to set
*/
function LastDelCard(properties) {
this.Cards = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* LastDelCard Cards.
* @member {Array.<number>} Cards
* @memberof chesstitians.LastDelCard
* @instance
*/
LastDelCard.prototype.Cards = $util.emptyArray;
/**
* Creates a new LastDelCard instance using the specified properties.
* @function create
* @memberof chesstitians.LastDelCard
* @static
* @param {chesstitians.ILastDelCard=} [properties] Properties to set
* @returns {chesstitians.LastDelCard} LastDelCard instance
*/
LastDelCard.create = function create(properties) {
return new LastDelCard(properties);
};
/**
* Encodes the specified LastDelCard message. Does not implicitly {@link chesstitians.LastDelCard.verify|verify} messages.
* @function encode
* @memberof chesstitians.LastDelCard
* @static
* @param {chesstitians.ILastDelCard} message LastDelCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
LastDelCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Cards != null && message.Cards.length) {
writer.uint32(/* id 1, wireType 2 =*/10).fork();
for (var i = 0; i < message.Cards.length; ++i)
writer.int32(message.Cards[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified LastDelCard message, length delimited. Does not implicitly {@link chesstitians.LastDelCard.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.LastDelCard
* @static
* @param {chesstitians.ILastDelCard} message LastDelCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
LastDelCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a LastDelCard message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.LastDelCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.LastDelCard} LastDelCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
LastDelCard.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.LastDelCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.Cards && message.Cards.length))
message.Cards = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Cards.push(reader.int32());
} else
message.Cards.push(reader.int32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a LastDelCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.LastDelCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.LastDelCard} LastDelCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
LastDelCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a LastDelCard message.
* @function verify
* @memberof chesstitians.LastDelCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
LastDelCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Cards != null && message.hasOwnProperty("Cards")) {
if (!Array.isArray(message.Cards))
return "Cards: array expected";
for (var i = 0; i < message.Cards.length; ++i)
if (!$util.isInteger(message.Cards[i]))
return "Cards: integer[] expected";
}
return null;
};
/**
* Creates a LastDelCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.LastDelCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.LastDelCard} LastDelCard
*/
LastDelCard.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.LastDelCard)
return object;
var message = new $root.chesstitians.LastDelCard();
if (object.Cards) {
if (!Array.isArray(object.Cards))
throw TypeError(".chesstitians.LastDelCard.Cards: array expected");
message.Cards = [];
for (var i = 0; i < object.Cards.length; ++i)
message.Cards[i] = object.Cards[i] | 0;
}
return message;
};
/**
* Creates a plain object from a LastDelCard message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.LastDelCard
* @static
* @param {chesstitians.LastDelCard} message LastDelCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
LastDelCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Cards = [];
if (message.Cards && message.Cards.length) {
object.Cards = [];
for (var j = 0; j < message.Cards.length; ++j)
object.Cards[j] = message.Cards[j];
}
return object;
};
/**
* Converts this LastDelCard to JSON.
* @function toJSON
* @memberof chesstitians.LastDelCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
LastDelCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for LastDelCard
* @function getTypeUrl
* @memberof chesstitians.LastDelCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
LastDelCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.LastDelCard";
};
return LastDelCard;
})();
chesstitians.SCChesstitiansRoomInfo = (function() {
/**
* Properties of a SCChesstitiansRoomInfo.
* @memberof chesstitians
* @interface ISCChesstitiansRoomInfo
* @property {number|null} [RoomId] SCChesstitiansRoomInfo RoomId
* @property {number|null} [Creator] SCChesstitiansRoomInfo Creator
* @property {number|null} [GameId] SCChesstitiansRoomInfo GameId
* @property {number|null} [RoomMode] SCChesstitiansRoomInfo RoomMode
* @property {Array.<number>|null} [Params] SCChesstitiansRoomInfo Params
* @property {number|null} [BankerPos] SCChesstitiansRoomInfo BankerPos
* @property {number|null} [State] SCChesstitiansRoomInfo State
* @property {number|null} [TimeOut] SCChesstitiansRoomInfo TimeOut
* @property {Array.<chesstitians.IChesstitiansPlayerData>|null} [Players] SCChesstitiansRoomInfo Players
* @property {number|null} [AudienceNum] SCChesstitiansRoomInfo AudienceNum
* @property {number|null} [CurOpIdx] SCChesstitiansRoomInfo CurOpIdx
* @property {Array.<chesstitians.ILastDelCard>|null} [LastDelCards] SCChesstitiansRoomInfo LastDelCards
* @property {number|null} [NumOfGames] SCChesstitiansRoomInfo NumOfGames
* @property {number|null} [TotalOfGames] SCChesstitiansRoomInfo TotalOfGames
* @property {number|null} [MasterSnid] SCChesstitiansRoomInfo MasterSnid
* @property {number|null} [BaseScore] SCChesstitiansRoomInfo BaseScore
* @property {number|null} [MaxPlayerNum] SCChesstitiansRoomInfo MaxPlayerNum
* @property {Array.<number>|null} [WinSnids] SCChesstitiansRoomInfo WinSnids
* @property {number|null} [IsMatch] SCChesstitiansRoomInfo IsMatch
* @property {number|null} [Round] SCChesstitiansRoomInfo Round
* @property {number|null} [CurPlayerNum] SCChesstitiansRoomInfo CurPlayerNum
* @property {number|null} [NextNeed] SCChesstitiansRoomInfo NextNeed
* @property {number|null} [MatchFinals] SCChesstitiansRoomInfo MatchFinals
*/
/**
* Constructs a new SCChesstitiansRoomInfo.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansRoomInfo.
* @implements ISCChesstitiansRoomInfo
* @constructor
* @param {chesstitians.ISCChesstitiansRoomInfo=} [properties] Properties to set
*/
function SCChesstitiansRoomInfo(properties) {
this.Params = [];
this.Players = [];
this.LastDelCards = [];
this.WinSnids = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansRoomInfo RoomId.
* @member {number} RoomId
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.RoomId = 0;
/**
* SCChesstitiansRoomInfo Creator.
* @member {number} Creator
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.Creator = 0;
/**
* SCChesstitiansRoomInfo GameId.
* @member {number} GameId
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.GameId = 0;
/**
* SCChesstitiansRoomInfo RoomMode.
* @member {number} RoomMode
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.RoomMode = 0;
/**
* SCChesstitiansRoomInfo Params.
* @member {Array.<number>} Params
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.Params = $util.emptyArray;
/**
* SCChesstitiansRoomInfo BankerPos.
* @member {number} BankerPos
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.BankerPos = 0;
/**
* SCChesstitiansRoomInfo State.
* @member {number} State
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.State = 0;
/**
* SCChesstitiansRoomInfo TimeOut.
* @member {number} TimeOut
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.TimeOut = 0;
/**
* SCChesstitiansRoomInfo Players.
* @member {Array.<chesstitians.IChesstitiansPlayerData>} Players
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.Players = $util.emptyArray;
/**
* SCChesstitiansRoomInfo AudienceNum.
* @member {number} AudienceNum
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.AudienceNum = 0;
/**
* SCChesstitiansRoomInfo CurOpIdx.
* @member {number} CurOpIdx
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.CurOpIdx = 0;
/**
* SCChesstitiansRoomInfo LastDelCards.
* @member {Array.<chesstitians.ILastDelCard>} LastDelCards
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.LastDelCards = $util.emptyArray;
/**
* SCChesstitiansRoomInfo NumOfGames.
* @member {number} NumOfGames
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.NumOfGames = 0;
/**
* SCChesstitiansRoomInfo TotalOfGames.
* @member {number} TotalOfGames
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.TotalOfGames = 0;
/**
* SCChesstitiansRoomInfo MasterSnid.
* @member {number} MasterSnid
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.MasterSnid = 0;
/**
* SCChesstitiansRoomInfo BaseScore.
* @member {number} BaseScore
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.BaseScore = 0;
/**
* SCChesstitiansRoomInfo MaxPlayerNum.
* @member {number} MaxPlayerNum
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.MaxPlayerNum = 0;
/**
* SCChesstitiansRoomInfo WinSnids.
* @member {Array.<number>} WinSnids
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.WinSnids = $util.emptyArray;
/**
* SCChesstitiansRoomInfo IsMatch.
* @member {number} IsMatch
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.IsMatch = 0;
/**
* SCChesstitiansRoomInfo Round.
* @member {number} Round
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.Round = 0;
/**
* SCChesstitiansRoomInfo CurPlayerNum.
* @member {number} CurPlayerNum
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.CurPlayerNum = 0;
/**
* SCChesstitiansRoomInfo NextNeed.
* @member {number} NextNeed
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.NextNeed = 0;
/**
* SCChesstitiansRoomInfo MatchFinals.
* @member {number} MatchFinals
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
*/
SCChesstitiansRoomInfo.prototype.MatchFinals = 0;
/**
* Creates a new SCChesstitiansRoomInfo instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {chesstitians.ISCChesstitiansRoomInfo=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansRoomInfo} SCChesstitiansRoomInfo instance
*/
SCChesstitiansRoomInfo.create = function create(properties) {
return new SCChesstitiansRoomInfo(properties);
};
/**
* Encodes the specified SCChesstitiansRoomInfo message. Does not implicitly {@link chesstitians.SCChesstitiansRoomInfo.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {chesstitians.ISCChesstitiansRoomInfo} message SCChesstitiansRoomInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansRoomInfo.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.RoomId != null && Object.hasOwnProperty.call(message, "RoomId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.RoomId);
if (message.Creator != null && Object.hasOwnProperty.call(message, "Creator"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Creator);
if (message.GameId != null && Object.hasOwnProperty.call(message, "GameId"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.GameId);
if (message.RoomMode != null && Object.hasOwnProperty.call(message, "RoomMode"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.RoomMode);
if (message.Params != null && message.Params.length) {
writer.uint32(/* id 5, wireType 2 =*/42).fork();
for (var i = 0; i < message.Params.length; ++i)
writer.int32(message.Params[i]);
writer.ldelim();
}
if (message.BankerPos != null && Object.hasOwnProperty.call(message, "BankerPos"))
writer.uint32(/* id 6, wireType 0 =*/48).int32(message.BankerPos);
if (message.State != null && Object.hasOwnProperty.call(message, "State"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.State);
if (message.TimeOut != null && Object.hasOwnProperty.call(message, "TimeOut"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.TimeOut);
if (message.Players != null && message.Players.length)
for (var i = 0; i < message.Players.length; ++i)
$root.chesstitians.ChesstitiansPlayerData.encode(message.Players[i], writer.uint32(/* id 9, wireType 2 =*/74).fork()).ldelim();
if (message.AudienceNum != null && Object.hasOwnProperty.call(message, "AudienceNum"))
writer.uint32(/* id 11, wireType 0 =*/88).int32(message.AudienceNum);
if (message.CurOpIdx != null && Object.hasOwnProperty.call(message, "CurOpIdx"))
writer.uint32(/* id 12, wireType 0 =*/96).int32(message.CurOpIdx);
if (message.LastDelCards != null && message.LastDelCards.length)
for (var i = 0; i < message.LastDelCards.length; ++i)
$root.chesstitians.LastDelCard.encode(message.LastDelCards[i], writer.uint32(/* id 13, wireType 2 =*/106).fork()).ldelim();
if (message.NumOfGames != null && Object.hasOwnProperty.call(message, "NumOfGames"))
writer.uint32(/* id 14, wireType 0 =*/112).int32(message.NumOfGames);
if (message.TotalOfGames != null && Object.hasOwnProperty.call(message, "TotalOfGames"))
writer.uint32(/* id 15, wireType 0 =*/120).int32(message.TotalOfGames);
if (message.MasterSnid != null && Object.hasOwnProperty.call(message, "MasterSnid"))
writer.uint32(/* id 16, wireType 0 =*/128).int32(message.MasterSnid);
if (message.BaseScore != null && Object.hasOwnProperty.call(message, "BaseScore"))
writer.uint32(/* id 17, wireType 0 =*/136).int32(message.BaseScore);
if (message.MaxPlayerNum != null && Object.hasOwnProperty.call(message, "MaxPlayerNum"))
writer.uint32(/* id 18, wireType 0 =*/144).int32(message.MaxPlayerNum);
if (message.WinSnids != null && message.WinSnids.length) {
writer.uint32(/* id 19, wireType 2 =*/154).fork();
for (var i = 0; i < message.WinSnids.length; ++i)
writer.int32(message.WinSnids[i]);
writer.ldelim();
}
if (message.IsMatch != null && Object.hasOwnProperty.call(message, "IsMatch"))
writer.uint32(/* id 20, wireType 0 =*/160).int32(message.IsMatch);
if (message.Round != null && Object.hasOwnProperty.call(message, "Round"))
writer.uint32(/* id 22, wireType 0 =*/176).int32(message.Round);
if (message.CurPlayerNum != null && Object.hasOwnProperty.call(message, "CurPlayerNum"))
writer.uint32(/* id 24, wireType 0 =*/192).int32(message.CurPlayerNum);
if (message.NextNeed != null && Object.hasOwnProperty.call(message, "NextNeed"))
writer.uint32(/* id 25, wireType 0 =*/200).int32(message.NextNeed);
if (message.MatchFinals != null && Object.hasOwnProperty.call(message, "MatchFinals"))
writer.uint32(/* id 26, wireType 0 =*/208).int32(message.MatchFinals);
return writer;
};
/**
* Encodes the specified SCChesstitiansRoomInfo message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansRoomInfo.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {chesstitians.ISCChesstitiansRoomInfo} message SCChesstitiansRoomInfo message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansRoomInfo.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansRoomInfo message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansRoomInfo} SCChesstitiansRoomInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansRoomInfo.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansRoomInfo();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.RoomId = reader.int32();
break;
}
case 2: {
message.Creator = reader.int32();
break;
}
case 3: {
message.GameId = reader.int32();
break;
}
case 4: {
message.RoomMode = reader.int32();
break;
}
case 5: {
if (!(message.Params && message.Params.length))
message.Params = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Params.push(reader.int32());
} else
message.Params.push(reader.int32());
break;
}
case 6: {
message.BankerPos = reader.int32();
break;
}
case 7: {
message.State = reader.int32();
break;
}
case 8: {
message.TimeOut = reader.int32();
break;
}
case 9: {
if (!(message.Players && message.Players.length))
message.Players = [];
message.Players.push($root.chesstitians.ChesstitiansPlayerData.decode(reader, reader.uint32()));
break;
}
case 11: {
message.AudienceNum = reader.int32();
break;
}
case 12: {
message.CurOpIdx = reader.int32();
break;
}
case 13: {
if (!(message.LastDelCards && message.LastDelCards.length))
message.LastDelCards = [];
message.LastDelCards.push($root.chesstitians.LastDelCard.decode(reader, reader.uint32()));
break;
}
case 14: {
message.NumOfGames = reader.int32();
break;
}
case 15: {
message.TotalOfGames = reader.int32();
break;
}
case 16: {
message.MasterSnid = reader.int32();
break;
}
case 17: {
message.BaseScore = reader.int32();
break;
}
case 18: {
message.MaxPlayerNum = reader.int32();
break;
}
case 19: {
if (!(message.WinSnids && message.WinSnids.length))
message.WinSnids = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.WinSnids.push(reader.int32());
} else
message.WinSnids.push(reader.int32());
break;
}
case 20: {
message.IsMatch = reader.int32();
break;
}
case 22: {
message.Round = reader.int32();
break;
}
case 24: {
message.CurPlayerNum = reader.int32();
break;
}
case 25: {
message.NextNeed = reader.int32();
break;
}
case 26: {
message.MatchFinals = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansRoomInfo message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansRoomInfo} SCChesstitiansRoomInfo
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansRoomInfo.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansRoomInfo message.
* @function verify
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansRoomInfo.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.RoomId != null && message.hasOwnProperty("RoomId"))
if (!$util.isInteger(message.RoomId))
return "RoomId: integer expected";
if (message.Creator != null && message.hasOwnProperty("Creator"))
if (!$util.isInteger(message.Creator))
return "Creator: integer expected";
if (message.GameId != null && message.hasOwnProperty("GameId"))
if (!$util.isInteger(message.GameId))
return "GameId: integer expected";
if (message.RoomMode != null && message.hasOwnProperty("RoomMode"))
if (!$util.isInteger(message.RoomMode))
return "RoomMode: integer expected";
if (message.Params != null && message.hasOwnProperty("Params")) {
if (!Array.isArray(message.Params))
return "Params: array expected";
for (var i = 0; i < message.Params.length; ++i)
if (!$util.isInteger(message.Params[i]))
return "Params: integer[] expected";
}
if (message.BankerPos != null && message.hasOwnProperty("BankerPos"))
if (!$util.isInteger(message.BankerPos))
return "BankerPos: integer expected";
if (message.State != null && message.hasOwnProperty("State"))
if (!$util.isInteger(message.State))
return "State: integer expected";
if (message.TimeOut != null && message.hasOwnProperty("TimeOut"))
if (!$util.isInteger(message.TimeOut))
return "TimeOut: integer expected";
if (message.Players != null && message.hasOwnProperty("Players")) {
if (!Array.isArray(message.Players))
return "Players: array expected";
for (var i = 0; i < message.Players.length; ++i) {
var error = $root.chesstitians.ChesstitiansPlayerData.verify(message.Players[i]);
if (error)
return "Players." + error;
}
}
if (message.AudienceNum != null && message.hasOwnProperty("AudienceNum"))
if (!$util.isInteger(message.AudienceNum))
return "AudienceNum: integer expected";
if (message.CurOpIdx != null && message.hasOwnProperty("CurOpIdx"))
if (!$util.isInteger(message.CurOpIdx))
return "CurOpIdx: integer expected";
if (message.LastDelCards != null && message.hasOwnProperty("LastDelCards")) {
if (!Array.isArray(message.LastDelCards))
return "LastDelCards: array expected";
for (var i = 0; i < message.LastDelCards.length; ++i) {
var error = $root.chesstitians.LastDelCard.verify(message.LastDelCards[i]);
if (error)
return "LastDelCards." + error;
}
}
if (message.NumOfGames != null && message.hasOwnProperty("NumOfGames"))
if (!$util.isInteger(message.NumOfGames))
return "NumOfGames: integer expected";
if (message.TotalOfGames != null && message.hasOwnProperty("TotalOfGames"))
if (!$util.isInteger(message.TotalOfGames))
return "TotalOfGames: integer expected";
if (message.MasterSnid != null && message.hasOwnProperty("MasterSnid"))
if (!$util.isInteger(message.MasterSnid))
return "MasterSnid: integer expected";
if (message.BaseScore != null && message.hasOwnProperty("BaseScore"))
if (!$util.isInteger(message.BaseScore))
return "BaseScore: integer expected";
if (message.MaxPlayerNum != null && message.hasOwnProperty("MaxPlayerNum"))
if (!$util.isInteger(message.MaxPlayerNum))
return "MaxPlayerNum: integer expected";
if (message.WinSnids != null && message.hasOwnProperty("WinSnids")) {
if (!Array.isArray(message.WinSnids))
return "WinSnids: array expected";
for (var i = 0; i < message.WinSnids.length; ++i)
if (!$util.isInteger(message.WinSnids[i]))
return "WinSnids: integer[] expected";
}
if (message.IsMatch != null && message.hasOwnProperty("IsMatch"))
if (!$util.isInteger(message.IsMatch))
return "IsMatch: integer expected";
if (message.Round != null && message.hasOwnProperty("Round"))
if (!$util.isInteger(message.Round))
return "Round: integer expected";
if (message.CurPlayerNum != null && message.hasOwnProperty("CurPlayerNum"))
if (!$util.isInteger(message.CurPlayerNum))
return "CurPlayerNum: integer expected";
if (message.NextNeed != null && message.hasOwnProperty("NextNeed"))
if (!$util.isInteger(message.NextNeed))
return "NextNeed: integer expected";
if (message.MatchFinals != null && message.hasOwnProperty("MatchFinals"))
if (!$util.isInteger(message.MatchFinals))
return "MatchFinals: integer expected";
return null;
};
/**
* Creates a SCChesstitiansRoomInfo message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansRoomInfo} SCChesstitiansRoomInfo
*/
SCChesstitiansRoomInfo.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansRoomInfo)
return object;
var message = new $root.chesstitians.SCChesstitiansRoomInfo();
if (object.RoomId != null)
message.RoomId = object.RoomId | 0;
if (object.Creator != null)
message.Creator = object.Creator | 0;
if (object.GameId != null)
message.GameId = object.GameId | 0;
if (object.RoomMode != null)
message.RoomMode = object.RoomMode | 0;
if (object.Params) {
if (!Array.isArray(object.Params))
throw TypeError(".chesstitians.SCChesstitiansRoomInfo.Params: array expected");
message.Params = [];
for (var i = 0; i < object.Params.length; ++i)
message.Params[i] = object.Params[i] | 0;
}
if (object.BankerPos != null)
message.BankerPos = object.BankerPos | 0;
if (object.State != null)
message.State = object.State | 0;
if (object.TimeOut != null)
message.TimeOut = object.TimeOut | 0;
if (object.Players) {
if (!Array.isArray(object.Players))
throw TypeError(".chesstitians.SCChesstitiansRoomInfo.Players: array expected");
message.Players = [];
for (var i = 0; i < object.Players.length; ++i) {
if (typeof object.Players[i] !== "object")
throw TypeError(".chesstitians.SCChesstitiansRoomInfo.Players: object expected");
message.Players[i] = $root.chesstitians.ChesstitiansPlayerData.fromObject(object.Players[i]);
}
}
if (object.AudienceNum != null)
message.AudienceNum = object.AudienceNum | 0;
if (object.CurOpIdx != null)
message.CurOpIdx = object.CurOpIdx | 0;
if (object.LastDelCards) {
if (!Array.isArray(object.LastDelCards))
throw TypeError(".chesstitians.SCChesstitiansRoomInfo.LastDelCards: array expected");
message.LastDelCards = [];
for (var i = 0; i < object.LastDelCards.length; ++i) {
if (typeof object.LastDelCards[i] !== "object")
throw TypeError(".chesstitians.SCChesstitiansRoomInfo.LastDelCards: object expected");
message.LastDelCards[i] = $root.chesstitians.LastDelCard.fromObject(object.LastDelCards[i]);
}
}
if (object.NumOfGames != null)
message.NumOfGames = object.NumOfGames | 0;
if (object.TotalOfGames != null)
message.TotalOfGames = object.TotalOfGames | 0;
if (object.MasterSnid != null)
message.MasterSnid = object.MasterSnid | 0;
if (object.BaseScore != null)
message.BaseScore = object.BaseScore | 0;
if (object.MaxPlayerNum != null)
message.MaxPlayerNum = object.MaxPlayerNum | 0;
if (object.WinSnids) {
if (!Array.isArray(object.WinSnids))
throw TypeError(".chesstitians.SCChesstitiansRoomInfo.WinSnids: array expected");
message.WinSnids = [];
for (var i = 0; i < object.WinSnids.length; ++i)
message.WinSnids[i] = object.WinSnids[i] | 0;
}
if (object.IsMatch != null)
message.IsMatch = object.IsMatch | 0;
if (object.Round != null)
message.Round = object.Round | 0;
if (object.CurPlayerNum != null)
message.CurPlayerNum = object.CurPlayerNum | 0;
if (object.NextNeed != null)
message.NextNeed = object.NextNeed | 0;
if (object.MatchFinals != null)
message.MatchFinals = object.MatchFinals | 0;
return message;
};
/**
* Creates a plain object from a SCChesstitiansRoomInfo message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {chesstitians.SCChesstitiansRoomInfo} message SCChesstitiansRoomInfo
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansRoomInfo.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults) {
object.Params = [];
object.Players = [];
object.LastDelCards = [];
object.WinSnids = [];
}
if (options.defaults) {
object.RoomId = 0;
object.Creator = 0;
object.GameId = 0;
object.RoomMode = 0;
object.BankerPos = 0;
object.State = 0;
object.TimeOut = 0;
object.AudienceNum = 0;
object.CurOpIdx = 0;
object.NumOfGames = 0;
object.TotalOfGames = 0;
object.MasterSnid = 0;
object.BaseScore = 0;
object.MaxPlayerNum = 0;
object.IsMatch = 0;
object.Round = 0;
object.CurPlayerNum = 0;
object.NextNeed = 0;
object.MatchFinals = 0;
}
if (message.RoomId != null && message.hasOwnProperty("RoomId"))
object.RoomId = message.RoomId;
if (message.Creator != null && message.hasOwnProperty("Creator"))
object.Creator = message.Creator;
if (message.GameId != null && message.hasOwnProperty("GameId"))
object.GameId = message.GameId;
if (message.RoomMode != null && message.hasOwnProperty("RoomMode"))
object.RoomMode = message.RoomMode;
if (message.Params && message.Params.length) {
object.Params = [];
for (var j = 0; j < message.Params.length; ++j)
object.Params[j] = message.Params[j];
}
if (message.BankerPos != null && message.hasOwnProperty("BankerPos"))
object.BankerPos = message.BankerPos;
if (message.State != null && message.hasOwnProperty("State"))
object.State = message.State;
if (message.TimeOut != null && message.hasOwnProperty("TimeOut"))
object.TimeOut = message.TimeOut;
if (message.Players && message.Players.length) {
object.Players = [];
for (var j = 0; j < message.Players.length; ++j)
object.Players[j] = $root.chesstitians.ChesstitiansPlayerData.toObject(message.Players[j], options);
}
if (message.AudienceNum != null && message.hasOwnProperty("AudienceNum"))
object.AudienceNum = message.AudienceNum;
if (message.CurOpIdx != null && message.hasOwnProperty("CurOpIdx"))
object.CurOpIdx = message.CurOpIdx;
if (message.LastDelCards && message.LastDelCards.length) {
object.LastDelCards = [];
for (var j = 0; j < message.LastDelCards.length; ++j)
object.LastDelCards[j] = $root.chesstitians.LastDelCard.toObject(message.LastDelCards[j], options);
}
if (message.NumOfGames != null && message.hasOwnProperty("NumOfGames"))
object.NumOfGames = message.NumOfGames;
if (message.TotalOfGames != null && message.hasOwnProperty("TotalOfGames"))
object.TotalOfGames = message.TotalOfGames;
if (message.MasterSnid != null && message.hasOwnProperty("MasterSnid"))
object.MasterSnid = message.MasterSnid;
if (message.BaseScore != null && message.hasOwnProperty("BaseScore"))
object.BaseScore = message.BaseScore;
if (message.MaxPlayerNum != null && message.hasOwnProperty("MaxPlayerNum"))
object.MaxPlayerNum = message.MaxPlayerNum;
if (message.WinSnids && message.WinSnids.length) {
object.WinSnids = [];
for (var j = 0; j < message.WinSnids.length; ++j)
object.WinSnids[j] = message.WinSnids[j];
}
if (message.IsMatch != null && message.hasOwnProperty("IsMatch"))
object.IsMatch = message.IsMatch;
if (message.Round != null && message.hasOwnProperty("Round"))
object.Round = message.Round;
if (message.CurPlayerNum != null && message.hasOwnProperty("CurPlayerNum"))
object.CurPlayerNum = message.CurPlayerNum;
if (message.NextNeed != null && message.hasOwnProperty("NextNeed"))
object.NextNeed = message.NextNeed;
if (message.MatchFinals != null && message.hasOwnProperty("MatchFinals"))
object.MatchFinals = message.MatchFinals;
return object;
};
/**
* Converts this SCChesstitiansRoomInfo to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansRoomInfo
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansRoomInfo.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansRoomInfo
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansRoomInfo
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansRoomInfo.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansRoomInfo";
};
return SCChesstitiansRoomInfo;
})();
chesstitians.SCChesstitiansRoomState = (function() {
/**
* Properties of a SCChesstitiansRoomState.
* @memberof chesstitians
* @interface ISCChesstitiansRoomState
* @property {number|null} [State] SCChesstitiansRoomState State
* @property {Array.<number|Long>|null} [Params] SCChesstitiansRoomState Params
*/
/**
* Constructs a new SCChesstitiansRoomState.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansRoomState.
* @implements ISCChesstitiansRoomState
* @constructor
* @param {chesstitians.ISCChesstitiansRoomState=} [properties] Properties to set
*/
function SCChesstitiansRoomState(properties) {
this.Params = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansRoomState State.
* @member {number} State
* @memberof chesstitians.SCChesstitiansRoomState
* @instance
*/
SCChesstitiansRoomState.prototype.State = 0;
/**
* SCChesstitiansRoomState Params.
* @member {Array.<number|Long>} Params
* @memberof chesstitians.SCChesstitiansRoomState
* @instance
*/
SCChesstitiansRoomState.prototype.Params = $util.emptyArray;
/**
* Creates a new SCChesstitiansRoomState instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {chesstitians.ISCChesstitiansRoomState=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansRoomState} SCChesstitiansRoomState instance
*/
SCChesstitiansRoomState.create = function create(properties) {
return new SCChesstitiansRoomState(properties);
};
/**
* Encodes the specified SCChesstitiansRoomState message. Does not implicitly {@link chesstitians.SCChesstitiansRoomState.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {chesstitians.ISCChesstitiansRoomState} message SCChesstitiansRoomState message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansRoomState.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.State != null && Object.hasOwnProperty.call(message, "State"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.State);
if (message.Params != null && message.Params.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.Params.length; ++i)
writer.int64(message.Params[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified SCChesstitiansRoomState message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansRoomState.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {chesstitians.ISCChesstitiansRoomState} message SCChesstitiansRoomState message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansRoomState.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansRoomState message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansRoomState} SCChesstitiansRoomState
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansRoomState.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansRoomState();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.State = reader.int32();
break;
}
case 2: {
if (!(message.Params && message.Params.length))
message.Params = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Params.push(reader.int64());
} else
message.Params.push(reader.int64());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansRoomState message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansRoomState} SCChesstitiansRoomState
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansRoomState.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansRoomState message.
* @function verify
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansRoomState.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.State != null && message.hasOwnProperty("State"))
if (!$util.isInteger(message.State))
return "State: integer expected";
if (message.Params != null && message.hasOwnProperty("Params")) {
if (!Array.isArray(message.Params))
return "Params: array expected";
for (var i = 0; i < message.Params.length; ++i)
if (!$util.isInteger(message.Params[i]) && !(message.Params[i] && $util.isInteger(message.Params[i].low) && $util.isInteger(message.Params[i].high)))
return "Params: integer|Long[] expected";
}
return null;
};
/**
* Creates a SCChesstitiansRoomState message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansRoomState} SCChesstitiansRoomState
*/
SCChesstitiansRoomState.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansRoomState)
return object;
var message = new $root.chesstitians.SCChesstitiansRoomState();
if (object.State != null)
message.State = object.State | 0;
if (object.Params) {
if (!Array.isArray(object.Params))
throw TypeError(".chesstitians.SCChesstitiansRoomState.Params: array expected");
message.Params = [];
for (var i = 0; i < object.Params.length; ++i)
if ($util.Long)
(message.Params[i] = $util.Long.fromValue(object.Params[i])).unsigned = false;
else if (typeof object.Params[i] === "string")
message.Params[i] = parseInt(object.Params[i], 10);
else if (typeof object.Params[i] === "number")
message.Params[i] = object.Params[i];
else if (typeof object.Params[i] === "object")
message.Params[i] = new $util.LongBits(object.Params[i].low >>> 0, object.Params[i].high >>> 0).toNumber();
}
return message;
};
/**
* Creates a plain object from a SCChesstitiansRoomState message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {chesstitians.SCChesstitiansRoomState} message SCChesstitiansRoomState
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansRoomState.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Params = [];
if (options.defaults)
object.State = 0;
if (message.State != null && message.hasOwnProperty("State"))
object.State = message.State;
if (message.Params && message.Params.length) {
object.Params = [];
for (var j = 0; j < message.Params.length; ++j)
if (typeof message.Params[j] === "number")
object.Params[j] = options.longs === String ? String(message.Params[j]) : message.Params[j];
else
object.Params[j] = options.longs === String ? $util.Long.prototype.toString.call(message.Params[j]) : options.longs === Number ? new $util.LongBits(message.Params[j].low >>> 0, message.Params[j].high >>> 0).toNumber() : message.Params[j];
}
return object;
};
/**
* Converts this SCChesstitiansRoomState to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansRoomState
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansRoomState.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansRoomState
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansRoomState
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansRoomState.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansRoomState";
};
return SCChesstitiansRoomState;
})();
chesstitians.CSChesstitiansPlayerOp = (function() {
/**
* Properties of a CSChesstitiansPlayerOp.
* @memberof chesstitians
* @interface ICSChesstitiansPlayerOp
* @property {number|null} [OpCode] CSChesstitiansPlayerOp OpCode
* @property {Array.<number|Long>|null} [OpParam] CSChesstitiansPlayerOp OpParam
*/
/**
* Constructs a new CSChesstitiansPlayerOp.
* @memberof chesstitians
* @classdesc Represents a CSChesstitiansPlayerOp.
* @implements ICSChesstitiansPlayerOp
* @constructor
* @param {chesstitians.ICSChesstitiansPlayerOp=} [properties] Properties to set
*/
function CSChesstitiansPlayerOp(properties) {
this.OpParam = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* CSChesstitiansPlayerOp OpCode.
* @member {number} OpCode
* @memberof chesstitians.CSChesstitiansPlayerOp
* @instance
*/
CSChesstitiansPlayerOp.prototype.OpCode = 0;
/**
* CSChesstitiansPlayerOp OpParam.
* @member {Array.<number|Long>} OpParam
* @memberof chesstitians.CSChesstitiansPlayerOp
* @instance
*/
CSChesstitiansPlayerOp.prototype.OpParam = $util.emptyArray;
/**
* Creates a new CSChesstitiansPlayerOp instance using the specified properties.
* @function create
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {chesstitians.ICSChesstitiansPlayerOp=} [properties] Properties to set
* @returns {chesstitians.CSChesstitiansPlayerOp} CSChesstitiansPlayerOp instance
*/
CSChesstitiansPlayerOp.create = function create(properties) {
return new CSChesstitiansPlayerOp(properties);
};
/**
* Encodes the specified CSChesstitiansPlayerOp message. Does not implicitly {@link chesstitians.CSChesstitiansPlayerOp.verify|verify} messages.
* @function encode
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {chesstitians.ICSChesstitiansPlayerOp} message CSChesstitiansPlayerOp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CSChesstitiansPlayerOp.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.OpCode != null && Object.hasOwnProperty.call(message, "OpCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.OpCode);
if (message.OpParam != null && message.OpParam.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.OpParam.length; ++i)
writer.int64(message.OpParam[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified CSChesstitiansPlayerOp message, length delimited. Does not implicitly {@link chesstitians.CSChesstitiansPlayerOp.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {chesstitians.ICSChesstitiansPlayerOp} message CSChesstitiansPlayerOp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
CSChesstitiansPlayerOp.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a CSChesstitiansPlayerOp message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.CSChesstitiansPlayerOp} CSChesstitiansPlayerOp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CSChesstitiansPlayerOp.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.CSChesstitiansPlayerOp();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.OpCode = reader.int32();
break;
}
case 2: {
if (!(message.OpParam && message.OpParam.length))
message.OpParam = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.OpParam.push(reader.int64());
} else
message.OpParam.push(reader.int64());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a CSChesstitiansPlayerOp message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.CSChesstitiansPlayerOp} CSChesstitiansPlayerOp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
CSChesstitiansPlayerOp.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a CSChesstitiansPlayerOp message.
* @function verify
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
CSChesstitiansPlayerOp.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.OpCode != null && message.hasOwnProperty("OpCode"))
if (!$util.isInteger(message.OpCode))
return "OpCode: integer expected";
if (message.OpParam != null && message.hasOwnProperty("OpParam")) {
if (!Array.isArray(message.OpParam))
return "OpParam: array expected";
for (var i = 0; i < message.OpParam.length; ++i)
if (!$util.isInteger(message.OpParam[i]) && !(message.OpParam[i] && $util.isInteger(message.OpParam[i].low) && $util.isInteger(message.OpParam[i].high)))
return "OpParam: integer|Long[] expected";
}
return null;
};
/**
* Creates a CSChesstitiansPlayerOp message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.CSChesstitiansPlayerOp} CSChesstitiansPlayerOp
*/
CSChesstitiansPlayerOp.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.CSChesstitiansPlayerOp)
return object;
var message = new $root.chesstitians.CSChesstitiansPlayerOp();
if (object.OpCode != null)
message.OpCode = object.OpCode | 0;
if (object.OpParam) {
if (!Array.isArray(object.OpParam))
throw TypeError(".chesstitians.CSChesstitiansPlayerOp.OpParam: array expected");
message.OpParam = [];
for (var i = 0; i < object.OpParam.length; ++i)
if ($util.Long)
(message.OpParam[i] = $util.Long.fromValue(object.OpParam[i])).unsigned = false;
else if (typeof object.OpParam[i] === "string")
message.OpParam[i] = parseInt(object.OpParam[i], 10);
else if (typeof object.OpParam[i] === "number")
message.OpParam[i] = object.OpParam[i];
else if (typeof object.OpParam[i] === "object")
message.OpParam[i] = new $util.LongBits(object.OpParam[i].low >>> 0, object.OpParam[i].high >>> 0).toNumber();
}
return message;
};
/**
* Creates a plain object from a CSChesstitiansPlayerOp message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {chesstitians.CSChesstitiansPlayerOp} message CSChesstitiansPlayerOp
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
CSChesstitiansPlayerOp.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.OpParam = [];
if (options.defaults)
object.OpCode = 0;
if (message.OpCode != null && message.hasOwnProperty("OpCode"))
object.OpCode = message.OpCode;
if (message.OpParam && message.OpParam.length) {
object.OpParam = [];
for (var j = 0; j < message.OpParam.length; ++j)
if (typeof message.OpParam[j] === "number")
object.OpParam[j] = options.longs === String ? String(message.OpParam[j]) : message.OpParam[j];
else
object.OpParam[j] = options.longs === String ? $util.Long.prototype.toString.call(message.OpParam[j]) : options.longs === Number ? new $util.LongBits(message.OpParam[j].low >>> 0, message.OpParam[j].high >>> 0).toNumber() : message.OpParam[j];
}
return object;
};
/**
* Converts this CSChesstitiansPlayerOp to JSON.
* @function toJSON
* @memberof chesstitians.CSChesstitiansPlayerOp
* @instance
* @returns {Object.<string,*>} JSON object
*/
CSChesstitiansPlayerOp.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for CSChesstitiansPlayerOp
* @function getTypeUrl
* @memberof chesstitians.CSChesstitiansPlayerOp
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
CSChesstitiansPlayerOp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.CSChesstitiansPlayerOp";
};
return CSChesstitiansPlayerOp;
})();
chesstitians.SCChesstitiansPlayerOp = (function() {
/**
* Properties of a SCChesstitiansPlayerOp.
* @memberof chesstitians
* @interface ISCChesstitiansPlayerOp
* @property {number|null} [OpCode] SCChesstitiansPlayerOp OpCode
* @property {Array.<number|Long>|null} [OpParam] SCChesstitiansPlayerOp OpParam
* @property {number|null} [SnId] SCChesstitiansPlayerOp SnId
* @property {chesstitians.OpResultCode|null} [OpRetCode] SCChesstitiansPlayerOp OpRetCode
*/
/**
* Constructs a new SCChesstitiansPlayerOp.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansPlayerOp.
* @implements ISCChesstitiansPlayerOp
* @constructor
* @param {chesstitians.ISCChesstitiansPlayerOp=} [properties] Properties to set
*/
function SCChesstitiansPlayerOp(properties) {
this.OpParam = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansPlayerOp OpCode.
* @member {number} OpCode
* @memberof chesstitians.SCChesstitiansPlayerOp
* @instance
*/
SCChesstitiansPlayerOp.prototype.OpCode = 0;
/**
* SCChesstitiansPlayerOp OpParam.
* @member {Array.<number|Long>} OpParam
* @memberof chesstitians.SCChesstitiansPlayerOp
* @instance
*/
SCChesstitiansPlayerOp.prototype.OpParam = $util.emptyArray;
/**
* SCChesstitiansPlayerOp SnId.
* @member {number} SnId
* @memberof chesstitians.SCChesstitiansPlayerOp
* @instance
*/
SCChesstitiansPlayerOp.prototype.SnId = 0;
/**
* SCChesstitiansPlayerOp OpRetCode.
* @member {chesstitians.OpResultCode} OpRetCode
* @memberof chesstitians.SCChesstitiansPlayerOp
* @instance
*/
SCChesstitiansPlayerOp.prototype.OpRetCode = 0;
/**
* Creates a new SCChesstitiansPlayerOp instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {chesstitians.ISCChesstitiansPlayerOp=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansPlayerOp} SCChesstitiansPlayerOp instance
*/
SCChesstitiansPlayerOp.create = function create(properties) {
return new SCChesstitiansPlayerOp(properties);
};
/**
* Encodes the specified SCChesstitiansPlayerOp message. Does not implicitly {@link chesstitians.SCChesstitiansPlayerOp.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {chesstitians.ISCChesstitiansPlayerOp} message SCChesstitiansPlayerOp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansPlayerOp.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.OpCode != null && Object.hasOwnProperty.call(message, "OpCode"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.OpCode);
if (message.OpParam != null && message.OpParam.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.OpParam.length; ++i)
writer.int64(message.OpParam[i]);
writer.ldelim();
}
if (message.SnId != null && Object.hasOwnProperty.call(message, "SnId"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.SnId);
if (message.OpRetCode != null && Object.hasOwnProperty.call(message, "OpRetCode"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.OpRetCode);
return writer;
};
/**
* Encodes the specified SCChesstitiansPlayerOp message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansPlayerOp.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {chesstitians.ISCChesstitiansPlayerOp} message SCChesstitiansPlayerOp message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansPlayerOp.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansPlayerOp message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansPlayerOp} SCChesstitiansPlayerOp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansPlayerOp.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansPlayerOp();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.OpCode = reader.int32();
break;
}
case 2: {
if (!(message.OpParam && message.OpParam.length))
message.OpParam = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.OpParam.push(reader.int64());
} else
message.OpParam.push(reader.int64());
break;
}
case 3: {
message.SnId = reader.int32();
break;
}
case 4: {
message.OpRetCode = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansPlayerOp message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansPlayerOp} SCChesstitiansPlayerOp
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansPlayerOp.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansPlayerOp message.
* @function verify
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansPlayerOp.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.OpCode != null && message.hasOwnProperty("OpCode"))
if (!$util.isInteger(message.OpCode))
return "OpCode: integer expected";
if (message.OpParam != null && message.hasOwnProperty("OpParam")) {
if (!Array.isArray(message.OpParam))
return "OpParam: array expected";
for (var i = 0; i < message.OpParam.length; ++i)
if (!$util.isInteger(message.OpParam[i]) && !(message.OpParam[i] && $util.isInteger(message.OpParam[i].low) && $util.isInteger(message.OpParam[i].high)))
return "OpParam: integer|Long[] expected";
}
if (message.SnId != null && message.hasOwnProperty("SnId"))
if (!$util.isInteger(message.SnId))
return "SnId: integer expected";
if (message.OpRetCode != null && message.hasOwnProperty("OpRetCode"))
switch (message.OpRetCode) {
default:
return "OpRetCode: enum value expected";
case 0:
case 1:
break;
}
return null;
};
/**
* Creates a SCChesstitiansPlayerOp message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansPlayerOp} SCChesstitiansPlayerOp
*/
SCChesstitiansPlayerOp.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansPlayerOp)
return object;
var message = new $root.chesstitians.SCChesstitiansPlayerOp();
if (object.OpCode != null)
message.OpCode = object.OpCode | 0;
if (object.OpParam) {
if (!Array.isArray(object.OpParam))
throw TypeError(".chesstitians.SCChesstitiansPlayerOp.OpParam: array expected");
message.OpParam = [];
for (var i = 0; i < object.OpParam.length; ++i)
if ($util.Long)
(message.OpParam[i] = $util.Long.fromValue(object.OpParam[i])).unsigned = false;
else if (typeof object.OpParam[i] === "string")
message.OpParam[i] = parseInt(object.OpParam[i], 10);
else if (typeof object.OpParam[i] === "number")
message.OpParam[i] = object.OpParam[i];
else if (typeof object.OpParam[i] === "object")
message.OpParam[i] = new $util.LongBits(object.OpParam[i].low >>> 0, object.OpParam[i].high >>> 0).toNumber();
}
if (object.SnId != null)
message.SnId = object.SnId | 0;
switch (object.OpRetCode) {
default:
if (typeof object.OpRetCode === "number") {
message.OpRetCode = object.OpRetCode;
break;
}
break;
case "OPRC_Sucess":
case 0:
message.OpRetCode = 0;
break;
case "OPRC_Error":
case 1:
message.OpRetCode = 1;
break;
}
return message;
};
/**
* Creates a plain object from a SCChesstitiansPlayerOp message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {chesstitians.SCChesstitiansPlayerOp} message SCChesstitiansPlayerOp
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansPlayerOp.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.OpParam = [];
if (options.defaults) {
object.OpCode = 0;
object.SnId = 0;
object.OpRetCode = options.enums === String ? "OPRC_Sucess" : 0;
}
if (message.OpCode != null && message.hasOwnProperty("OpCode"))
object.OpCode = message.OpCode;
if (message.OpParam && message.OpParam.length) {
object.OpParam = [];
for (var j = 0; j < message.OpParam.length; ++j)
if (typeof message.OpParam[j] === "number")
object.OpParam[j] = options.longs === String ? String(message.OpParam[j]) : message.OpParam[j];
else
object.OpParam[j] = options.longs === String ? $util.Long.prototype.toString.call(message.OpParam[j]) : options.longs === Number ? new $util.LongBits(message.OpParam[j].low >>> 0, message.OpParam[j].high >>> 0).toNumber() : message.OpParam[j];
}
if (message.SnId != null && message.hasOwnProperty("SnId"))
object.SnId = message.SnId;
if (message.OpRetCode != null && message.hasOwnProperty("OpRetCode"))
object.OpRetCode = options.enums === String ? $root.chesstitians.OpResultCode[message.OpRetCode] === undefined ? message.OpRetCode : $root.chesstitians.OpResultCode[message.OpRetCode] : message.OpRetCode;
return object;
};
/**
* Converts this SCChesstitiansPlayerOp to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansPlayerOp
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansPlayerOp.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansPlayerOp
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansPlayerOp
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansPlayerOp.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansPlayerOp";
};
return SCChesstitiansPlayerOp;
})();
chesstitians.SCChesstitiansPlayerEnter = (function() {
/**
* Properties of a SCChesstitiansPlayerEnter.
* @memberof chesstitians
* @interface ISCChesstitiansPlayerEnter
* @property {chesstitians.IChesstitiansPlayerData|null} [Data] SCChesstitiansPlayerEnter Data
*/
/**
* Constructs a new SCChesstitiansPlayerEnter.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansPlayerEnter.
* @implements ISCChesstitiansPlayerEnter
* @constructor
* @param {chesstitians.ISCChesstitiansPlayerEnter=} [properties] Properties to set
*/
function SCChesstitiansPlayerEnter(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansPlayerEnter Data.
* @member {chesstitians.IChesstitiansPlayerData|null|undefined} Data
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @instance
*/
SCChesstitiansPlayerEnter.prototype.Data = null;
/**
* Creates a new SCChesstitiansPlayerEnter instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {chesstitians.ISCChesstitiansPlayerEnter=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansPlayerEnter} SCChesstitiansPlayerEnter instance
*/
SCChesstitiansPlayerEnter.create = function create(properties) {
return new SCChesstitiansPlayerEnter(properties);
};
/**
* Encodes the specified SCChesstitiansPlayerEnter message. Does not implicitly {@link chesstitians.SCChesstitiansPlayerEnter.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {chesstitians.ISCChesstitiansPlayerEnter} message SCChesstitiansPlayerEnter message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansPlayerEnter.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Data != null && Object.hasOwnProperty.call(message, "Data"))
$root.chesstitians.ChesstitiansPlayerData.encode(message.Data, writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified SCChesstitiansPlayerEnter message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansPlayerEnter.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {chesstitians.ISCChesstitiansPlayerEnter} message SCChesstitiansPlayerEnter message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansPlayerEnter.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansPlayerEnter message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansPlayerEnter} SCChesstitiansPlayerEnter
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansPlayerEnter.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansPlayerEnter();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Data = $root.chesstitians.ChesstitiansPlayerData.decode(reader, reader.uint32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansPlayerEnter message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansPlayerEnter} SCChesstitiansPlayerEnter
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansPlayerEnter.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansPlayerEnter message.
* @function verify
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansPlayerEnter.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Data != null && message.hasOwnProperty("Data")) {
var error = $root.chesstitians.ChesstitiansPlayerData.verify(message.Data);
if (error)
return "Data." + error;
}
return null;
};
/**
* Creates a SCChesstitiansPlayerEnter message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansPlayerEnter} SCChesstitiansPlayerEnter
*/
SCChesstitiansPlayerEnter.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansPlayerEnter)
return object;
var message = new $root.chesstitians.SCChesstitiansPlayerEnter();
if (object.Data != null) {
if (typeof object.Data !== "object")
throw TypeError(".chesstitians.SCChesstitiansPlayerEnter.Data: object expected");
message.Data = $root.chesstitians.ChesstitiansPlayerData.fromObject(object.Data);
}
return message;
};
/**
* Creates a plain object from a SCChesstitiansPlayerEnter message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {chesstitians.SCChesstitiansPlayerEnter} message SCChesstitiansPlayerEnter
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansPlayerEnter.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Data = null;
if (message.Data != null && message.hasOwnProperty("Data"))
object.Data = $root.chesstitians.ChesstitiansPlayerData.toObject(message.Data, options);
return object;
};
/**
* Converts this SCChesstitiansPlayerEnter to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansPlayerEnter.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansPlayerEnter
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansPlayerEnter
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansPlayerEnter.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansPlayerEnter";
};
return SCChesstitiansPlayerEnter;
})();
chesstitians.SCChesstitiansPlayerLeave = (function() {
/**
* Properties of a SCChesstitiansPlayerLeave.
* @memberof chesstitians
* @interface ISCChesstitiansPlayerLeave
* @property {number|null} [Pos] SCChesstitiansPlayerLeave Pos
*/
/**
* Constructs a new SCChesstitiansPlayerLeave.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansPlayerLeave.
* @implements ISCChesstitiansPlayerLeave
* @constructor
* @param {chesstitians.ISCChesstitiansPlayerLeave=} [properties] Properties to set
*/
function SCChesstitiansPlayerLeave(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansPlayerLeave Pos.
* @member {number} Pos
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @instance
*/
SCChesstitiansPlayerLeave.prototype.Pos = 0;
/**
* Creates a new SCChesstitiansPlayerLeave instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {chesstitians.ISCChesstitiansPlayerLeave=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansPlayerLeave} SCChesstitiansPlayerLeave instance
*/
SCChesstitiansPlayerLeave.create = function create(properties) {
return new SCChesstitiansPlayerLeave(properties);
};
/**
* Encodes the specified SCChesstitiansPlayerLeave message. Does not implicitly {@link chesstitians.SCChesstitiansPlayerLeave.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {chesstitians.ISCChesstitiansPlayerLeave} message SCChesstitiansPlayerLeave message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansPlayerLeave.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Pos != null && Object.hasOwnProperty.call(message, "Pos"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Pos);
return writer;
};
/**
* Encodes the specified SCChesstitiansPlayerLeave message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansPlayerLeave.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {chesstitians.ISCChesstitiansPlayerLeave} message SCChesstitiansPlayerLeave message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansPlayerLeave.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansPlayerLeave message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansPlayerLeave} SCChesstitiansPlayerLeave
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansPlayerLeave.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansPlayerLeave();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Pos = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansPlayerLeave message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansPlayerLeave} SCChesstitiansPlayerLeave
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansPlayerLeave.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansPlayerLeave message.
* @function verify
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansPlayerLeave.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Pos != null && message.hasOwnProperty("Pos"))
if (!$util.isInteger(message.Pos))
return "Pos: integer expected";
return null;
};
/**
* Creates a SCChesstitiansPlayerLeave message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansPlayerLeave} SCChesstitiansPlayerLeave
*/
SCChesstitiansPlayerLeave.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansPlayerLeave)
return object;
var message = new $root.chesstitians.SCChesstitiansPlayerLeave();
if (object.Pos != null)
message.Pos = object.Pos | 0;
return message;
};
/**
* Creates a plain object from a SCChesstitiansPlayerLeave message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {chesstitians.SCChesstitiansPlayerLeave} message SCChesstitiansPlayerLeave
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansPlayerLeave.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Pos = 0;
if (message.Pos != null && message.hasOwnProperty("Pos"))
object.Pos = message.Pos;
return object;
};
/**
* Converts this SCChesstitiansPlayerLeave to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansPlayerLeave.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansPlayerLeave
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansPlayerLeave
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansPlayerLeave.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansPlayerLeave";
};
return SCChesstitiansPlayerLeave;
})();
chesstitians.ChesstitiansPlayerGameBilled = (function() {
/**
* Properties of a ChesstitiansPlayerGameBilled.
* @memberof chesstitians
* @interface IChesstitiansPlayerGameBilled
* @property {number|null} [SnId] ChesstitiansPlayerGameBilled SnId
* @property {Array.<number>|null} [Cards] ChesstitiansPlayerGameBilled Cards
* @property {number|Long|null} [WinCoin] ChesstitiansPlayerGameBilled WinCoin
* @property {number|Long|null} [GameCoin] ChesstitiansPlayerGameBilled GameCoin
* @property {number|null} [IsWin] ChesstitiansPlayerGameBilled IsWin
*/
/**
* Constructs a new ChesstitiansPlayerGameBilled.
* @memberof chesstitians
* @classdesc Represents a ChesstitiansPlayerGameBilled.
* @implements IChesstitiansPlayerGameBilled
* @constructor
* @param {chesstitians.IChesstitiansPlayerGameBilled=} [properties] Properties to set
*/
function ChesstitiansPlayerGameBilled(properties) {
this.Cards = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* ChesstitiansPlayerGameBilled SnId.
* @member {number} SnId
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @instance
*/
ChesstitiansPlayerGameBilled.prototype.SnId = 0;
/**
* ChesstitiansPlayerGameBilled Cards.
* @member {Array.<number>} Cards
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @instance
*/
ChesstitiansPlayerGameBilled.prototype.Cards = $util.emptyArray;
/**
* ChesstitiansPlayerGameBilled WinCoin.
* @member {number|Long} WinCoin
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @instance
*/
ChesstitiansPlayerGameBilled.prototype.WinCoin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* ChesstitiansPlayerGameBilled GameCoin.
* @member {number|Long} GameCoin
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @instance
*/
ChesstitiansPlayerGameBilled.prototype.GameCoin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* ChesstitiansPlayerGameBilled IsWin.
* @member {number} IsWin
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @instance
*/
ChesstitiansPlayerGameBilled.prototype.IsWin = 0;
/**
* Creates a new ChesstitiansPlayerGameBilled instance using the specified properties.
* @function create
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {chesstitians.IChesstitiansPlayerGameBilled=} [properties] Properties to set
* @returns {chesstitians.ChesstitiansPlayerGameBilled} ChesstitiansPlayerGameBilled instance
*/
ChesstitiansPlayerGameBilled.create = function create(properties) {
return new ChesstitiansPlayerGameBilled(properties);
};
/**
* Encodes the specified ChesstitiansPlayerGameBilled message. Does not implicitly {@link chesstitians.ChesstitiansPlayerGameBilled.verify|verify} messages.
* @function encode
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {chesstitians.IChesstitiansPlayerGameBilled} message ChesstitiansPlayerGameBilled message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChesstitiansPlayerGameBilled.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.SnId != null && Object.hasOwnProperty.call(message, "SnId"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.SnId);
if (message.Cards != null && message.Cards.length) {
writer.uint32(/* id 2, wireType 2 =*/18).fork();
for (var i = 0; i < message.Cards.length; ++i)
writer.int32(message.Cards[i]);
writer.ldelim();
}
if (message.WinCoin != null && Object.hasOwnProperty.call(message, "WinCoin"))
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.WinCoin);
if (message.GameCoin != null && Object.hasOwnProperty.call(message, "GameCoin"))
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.GameCoin);
if (message.IsWin != null && Object.hasOwnProperty.call(message, "IsWin"))
writer.uint32(/* id 5, wireType 0 =*/40).int32(message.IsWin);
return writer;
};
/**
* Encodes the specified ChesstitiansPlayerGameBilled message, length delimited. Does not implicitly {@link chesstitians.ChesstitiansPlayerGameBilled.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {chesstitians.IChesstitiansPlayerGameBilled} message ChesstitiansPlayerGameBilled message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
ChesstitiansPlayerGameBilled.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a ChesstitiansPlayerGameBilled message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.ChesstitiansPlayerGameBilled} ChesstitiansPlayerGameBilled
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChesstitiansPlayerGameBilled.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.ChesstitiansPlayerGameBilled();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.SnId = reader.int32();
break;
}
case 2: {
if (!(message.Cards && message.Cards.length))
message.Cards = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Cards.push(reader.int32());
} else
message.Cards.push(reader.int32());
break;
}
case 3: {
message.WinCoin = reader.int64();
break;
}
case 4: {
message.GameCoin = reader.int64();
break;
}
case 5: {
message.IsWin = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a ChesstitiansPlayerGameBilled message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.ChesstitiansPlayerGameBilled} ChesstitiansPlayerGameBilled
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
ChesstitiansPlayerGameBilled.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a ChesstitiansPlayerGameBilled message.
* @function verify
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
ChesstitiansPlayerGameBilled.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.SnId != null && message.hasOwnProperty("SnId"))
if (!$util.isInteger(message.SnId))
return "SnId: integer expected";
if (message.Cards != null && message.hasOwnProperty("Cards")) {
if (!Array.isArray(message.Cards))
return "Cards: array expected";
for (var i = 0; i < message.Cards.length; ++i)
if (!$util.isInteger(message.Cards[i]))
return "Cards: integer[] expected";
}
if (message.WinCoin != null && message.hasOwnProperty("WinCoin"))
if (!$util.isInteger(message.WinCoin) && !(message.WinCoin && $util.isInteger(message.WinCoin.low) && $util.isInteger(message.WinCoin.high)))
return "WinCoin: integer|Long expected";
if (message.GameCoin != null && message.hasOwnProperty("GameCoin"))
if (!$util.isInteger(message.GameCoin) && !(message.GameCoin && $util.isInteger(message.GameCoin.low) && $util.isInteger(message.GameCoin.high)))
return "GameCoin: integer|Long expected";
if (message.IsWin != null && message.hasOwnProperty("IsWin"))
if (!$util.isInteger(message.IsWin))
return "IsWin: integer expected";
return null;
};
/**
* Creates a ChesstitiansPlayerGameBilled message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.ChesstitiansPlayerGameBilled} ChesstitiansPlayerGameBilled
*/
ChesstitiansPlayerGameBilled.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.ChesstitiansPlayerGameBilled)
return object;
var message = new $root.chesstitians.ChesstitiansPlayerGameBilled();
if (object.SnId != null)
message.SnId = object.SnId | 0;
if (object.Cards) {
if (!Array.isArray(object.Cards))
throw TypeError(".chesstitians.ChesstitiansPlayerGameBilled.Cards: array expected");
message.Cards = [];
for (var i = 0; i < object.Cards.length; ++i)
message.Cards[i] = object.Cards[i] | 0;
}
if (object.WinCoin != null)
if ($util.Long)
(message.WinCoin = $util.Long.fromValue(object.WinCoin)).unsigned = false;
else if (typeof object.WinCoin === "string")
message.WinCoin = parseInt(object.WinCoin, 10);
else if (typeof object.WinCoin === "number")
message.WinCoin = object.WinCoin;
else if (typeof object.WinCoin === "object")
message.WinCoin = new $util.LongBits(object.WinCoin.low >>> 0, object.WinCoin.high >>> 0).toNumber();
if (object.GameCoin != null)
if ($util.Long)
(message.GameCoin = $util.Long.fromValue(object.GameCoin)).unsigned = false;
else if (typeof object.GameCoin === "string")
message.GameCoin = parseInt(object.GameCoin, 10);
else if (typeof object.GameCoin === "number")
message.GameCoin = object.GameCoin;
else if (typeof object.GameCoin === "object")
message.GameCoin = new $util.LongBits(object.GameCoin.low >>> 0, object.GameCoin.high >>> 0).toNumber();
if (object.IsWin != null)
message.IsWin = object.IsWin | 0;
return message;
};
/**
* Creates a plain object from a ChesstitiansPlayerGameBilled message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {chesstitians.ChesstitiansPlayerGameBilled} message ChesstitiansPlayerGameBilled
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
ChesstitiansPlayerGameBilled.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Cards = [];
if (options.defaults) {
object.SnId = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.WinCoin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.WinCoin = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.GameCoin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.GameCoin = options.longs === String ? "0" : 0;
object.IsWin = 0;
}
if (message.SnId != null && message.hasOwnProperty("SnId"))
object.SnId = message.SnId;
if (message.Cards && message.Cards.length) {
object.Cards = [];
for (var j = 0; j < message.Cards.length; ++j)
object.Cards[j] = message.Cards[j];
}
if (message.WinCoin != null && message.hasOwnProperty("WinCoin"))
if (typeof message.WinCoin === "number")
object.WinCoin = options.longs === String ? String(message.WinCoin) : message.WinCoin;
else
object.WinCoin = options.longs === String ? $util.Long.prototype.toString.call(message.WinCoin) : options.longs === Number ? new $util.LongBits(message.WinCoin.low >>> 0, message.WinCoin.high >>> 0).toNumber() : message.WinCoin;
if (message.GameCoin != null && message.hasOwnProperty("GameCoin"))
if (typeof message.GameCoin === "number")
object.GameCoin = options.longs === String ? String(message.GameCoin) : message.GameCoin;
else
object.GameCoin = options.longs === String ? $util.Long.prototype.toString.call(message.GameCoin) : options.longs === Number ? new $util.LongBits(message.GameCoin.low >>> 0, message.GameCoin.high >>> 0).toNumber() : message.GameCoin;
if (message.IsWin != null && message.hasOwnProperty("IsWin"))
object.IsWin = message.IsWin;
return object;
};
/**
* Converts this ChesstitiansPlayerGameBilled to JSON.
* @function toJSON
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @instance
* @returns {Object.<string,*>} JSON object
*/
ChesstitiansPlayerGameBilled.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for ChesstitiansPlayerGameBilled
* @function getTypeUrl
* @memberof chesstitians.ChesstitiansPlayerGameBilled
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
ChesstitiansPlayerGameBilled.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.ChesstitiansPlayerGameBilled";
};
return ChesstitiansPlayerGameBilled;
})();
chesstitians.SCChesstitiansGameBilled = (function() {
/**
* Properties of a SCChesstitiansGameBilled.
* @memberof chesstitians
* @interface ISCChesstitiansGameBilled
* @property {Array.<chesstitians.IChesstitiansPlayerGameBilled>|null} [Datas] SCChesstitiansGameBilled Datas
*/
/**
* Constructs a new SCChesstitiansGameBilled.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansGameBilled.
* @implements ISCChesstitiansGameBilled
* @constructor
* @param {chesstitians.ISCChesstitiansGameBilled=} [properties] Properties to set
*/
function SCChesstitiansGameBilled(properties) {
this.Datas = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansGameBilled Datas.
* @member {Array.<chesstitians.IChesstitiansPlayerGameBilled>} Datas
* @memberof chesstitians.SCChesstitiansGameBilled
* @instance
*/
SCChesstitiansGameBilled.prototype.Datas = $util.emptyArray;
/**
* Creates a new SCChesstitiansGameBilled instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {chesstitians.ISCChesstitiansGameBilled=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansGameBilled} SCChesstitiansGameBilled instance
*/
SCChesstitiansGameBilled.create = function create(properties) {
return new SCChesstitiansGameBilled(properties);
};
/**
* Encodes the specified SCChesstitiansGameBilled message. Does not implicitly {@link chesstitians.SCChesstitiansGameBilled.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {chesstitians.ISCChesstitiansGameBilled} message SCChesstitiansGameBilled message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansGameBilled.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Datas != null && message.Datas.length)
for (var i = 0; i < message.Datas.length; ++i)
$root.chesstitians.ChesstitiansPlayerGameBilled.encode(message.Datas[i], writer.uint32(/* id 1, wireType 2 =*/10).fork()).ldelim();
return writer;
};
/**
* Encodes the specified SCChesstitiansGameBilled message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansGameBilled.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {chesstitians.ISCChesstitiansGameBilled} message SCChesstitiansGameBilled message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansGameBilled.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansGameBilled message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansGameBilled} SCChesstitiansGameBilled
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansGameBilled.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansGameBilled();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.Datas && message.Datas.length))
message.Datas = [];
message.Datas.push($root.chesstitians.ChesstitiansPlayerGameBilled.decode(reader, reader.uint32()));
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansGameBilled message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansGameBilled} SCChesstitiansGameBilled
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansGameBilled.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansGameBilled message.
* @function verify
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansGameBilled.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Datas != null && message.hasOwnProperty("Datas")) {
if (!Array.isArray(message.Datas))
return "Datas: array expected";
for (var i = 0; i < message.Datas.length; ++i) {
var error = $root.chesstitians.ChesstitiansPlayerGameBilled.verify(message.Datas[i]);
if (error)
return "Datas." + error;
}
}
return null;
};
/**
* Creates a SCChesstitiansGameBilled message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansGameBilled} SCChesstitiansGameBilled
*/
SCChesstitiansGameBilled.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansGameBilled)
return object;
var message = new $root.chesstitians.SCChesstitiansGameBilled();
if (object.Datas) {
if (!Array.isArray(object.Datas))
throw TypeError(".chesstitians.SCChesstitiansGameBilled.Datas: array expected");
message.Datas = [];
for (var i = 0; i < object.Datas.length; ++i) {
if (typeof object.Datas[i] !== "object")
throw TypeError(".chesstitians.SCChesstitiansGameBilled.Datas: object expected");
message.Datas[i] = $root.chesstitians.ChesstitiansPlayerGameBilled.fromObject(object.Datas[i]);
}
}
return message;
};
/**
* Creates a plain object from a SCChesstitiansGameBilled message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {chesstitians.SCChesstitiansGameBilled} message SCChesstitiansGameBilled
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansGameBilled.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Datas = [];
if (message.Datas && message.Datas.length) {
object.Datas = [];
for (var j = 0; j < message.Datas.length; ++j)
object.Datas[j] = $root.chesstitians.ChesstitiansPlayerGameBilled.toObject(message.Datas[j], options);
}
return object;
};
/**
* Converts this SCChesstitiansGameBilled to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansGameBilled
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansGameBilled.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansGameBilled
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansGameBilled
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansGameBilled.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansGameBilled";
};
return SCChesstitiansGameBilled;
})();
chesstitians.SCChesstitiansSmallGameBilled = (function() {
/**
* Properties of a SCChesstitiansSmallGameBilled.
* @memberof chesstitians
* @interface ISCChesstitiansSmallGameBilled
* @property {number|null} [WinPos] SCChesstitiansSmallGameBilled WinPos
* @property {number|Long|null} [WinPosCoin] SCChesstitiansSmallGameBilled WinPosCoin
* @property {number|null} [LosePos] SCChesstitiansSmallGameBilled LosePos
* @property {number|Long|null} [LosePosCoin] SCChesstitiansSmallGameBilled LosePosCoin
* @property {number|Long|null} [WinCoin] SCChesstitiansSmallGameBilled WinCoin
* @property {number|Long|null} [LoseCoin] SCChesstitiansSmallGameBilled LoseCoin
*/
/**
* Constructs a new SCChesstitiansSmallGameBilled.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansSmallGameBilled.
* @implements ISCChesstitiansSmallGameBilled
* @constructor
* @param {chesstitians.ISCChesstitiansSmallGameBilled=} [properties] Properties to set
*/
function SCChesstitiansSmallGameBilled(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansSmallGameBilled WinPos.
* @member {number} WinPos
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @instance
*/
SCChesstitiansSmallGameBilled.prototype.WinPos = 0;
/**
* SCChesstitiansSmallGameBilled WinPosCoin.
* @member {number|Long} WinPosCoin
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @instance
*/
SCChesstitiansSmallGameBilled.prototype.WinPosCoin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* SCChesstitiansSmallGameBilled LosePos.
* @member {number} LosePos
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @instance
*/
SCChesstitiansSmallGameBilled.prototype.LosePos = 0;
/**
* SCChesstitiansSmallGameBilled LosePosCoin.
* @member {number|Long} LosePosCoin
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @instance
*/
SCChesstitiansSmallGameBilled.prototype.LosePosCoin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* SCChesstitiansSmallGameBilled WinCoin.
* @member {number|Long} WinCoin
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @instance
*/
SCChesstitiansSmallGameBilled.prototype.WinCoin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* SCChesstitiansSmallGameBilled LoseCoin.
* @member {number|Long} LoseCoin
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @instance
*/
SCChesstitiansSmallGameBilled.prototype.LoseCoin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* Creates a new SCChesstitiansSmallGameBilled instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {chesstitians.ISCChesstitiansSmallGameBilled=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansSmallGameBilled} SCChesstitiansSmallGameBilled instance
*/
SCChesstitiansSmallGameBilled.create = function create(properties) {
return new SCChesstitiansSmallGameBilled(properties);
};
/**
* Encodes the specified SCChesstitiansSmallGameBilled message. Does not implicitly {@link chesstitians.SCChesstitiansSmallGameBilled.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {chesstitians.ISCChesstitiansSmallGameBilled} message SCChesstitiansSmallGameBilled message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansSmallGameBilled.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.WinPos != null && Object.hasOwnProperty.call(message, "WinPos"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.WinPos);
if (message.WinPosCoin != null && Object.hasOwnProperty.call(message, "WinPosCoin"))
writer.uint32(/* id 2, wireType 0 =*/16).int64(message.WinPosCoin);
if (message.LosePos != null && Object.hasOwnProperty.call(message, "LosePos"))
writer.uint32(/* id 3, wireType 0 =*/24).int32(message.LosePos);
if (message.LosePosCoin != null && Object.hasOwnProperty.call(message, "LosePosCoin"))
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.LosePosCoin);
if (message.WinCoin != null && Object.hasOwnProperty.call(message, "WinCoin"))
writer.uint32(/* id 5, wireType 0 =*/40).int64(message.WinCoin);
if (message.LoseCoin != null && Object.hasOwnProperty.call(message, "LoseCoin"))
writer.uint32(/* id 6, wireType 0 =*/48).int64(message.LoseCoin);
return writer;
};
/**
* Encodes the specified SCChesstitiansSmallGameBilled message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansSmallGameBilled.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {chesstitians.ISCChesstitiansSmallGameBilled} message SCChesstitiansSmallGameBilled message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansSmallGameBilled.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansSmallGameBilled message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansSmallGameBilled} SCChesstitiansSmallGameBilled
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansSmallGameBilled.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansSmallGameBilled();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.WinPos = reader.int32();
break;
}
case 2: {
message.WinPosCoin = reader.int64();
break;
}
case 3: {
message.LosePos = reader.int32();
break;
}
case 4: {
message.LosePosCoin = reader.int64();
break;
}
case 5: {
message.WinCoin = reader.int64();
break;
}
case 6: {
message.LoseCoin = reader.int64();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansSmallGameBilled message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansSmallGameBilled} SCChesstitiansSmallGameBilled
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansSmallGameBilled.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansSmallGameBilled message.
* @function verify
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansSmallGameBilled.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.WinPos != null && message.hasOwnProperty("WinPos"))
if (!$util.isInteger(message.WinPos))
return "WinPos: integer expected";
if (message.WinPosCoin != null && message.hasOwnProperty("WinPosCoin"))
if (!$util.isInteger(message.WinPosCoin) && !(message.WinPosCoin && $util.isInteger(message.WinPosCoin.low) && $util.isInteger(message.WinPosCoin.high)))
return "WinPosCoin: integer|Long expected";
if (message.LosePos != null && message.hasOwnProperty("LosePos"))
if (!$util.isInteger(message.LosePos))
return "LosePos: integer expected";
if (message.LosePosCoin != null && message.hasOwnProperty("LosePosCoin"))
if (!$util.isInteger(message.LosePosCoin) && !(message.LosePosCoin && $util.isInteger(message.LosePosCoin.low) && $util.isInteger(message.LosePosCoin.high)))
return "LosePosCoin: integer|Long expected";
if (message.WinCoin != null && message.hasOwnProperty("WinCoin"))
if (!$util.isInteger(message.WinCoin) && !(message.WinCoin && $util.isInteger(message.WinCoin.low) && $util.isInteger(message.WinCoin.high)))
return "WinCoin: integer|Long expected";
if (message.LoseCoin != null && message.hasOwnProperty("LoseCoin"))
if (!$util.isInteger(message.LoseCoin) && !(message.LoseCoin && $util.isInteger(message.LoseCoin.low) && $util.isInteger(message.LoseCoin.high)))
return "LoseCoin: integer|Long expected";
return null;
};
/**
* Creates a SCChesstitiansSmallGameBilled message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansSmallGameBilled} SCChesstitiansSmallGameBilled
*/
SCChesstitiansSmallGameBilled.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansSmallGameBilled)
return object;
var message = new $root.chesstitians.SCChesstitiansSmallGameBilled();
if (object.WinPos != null)
message.WinPos = object.WinPos | 0;
if (object.WinPosCoin != null)
if ($util.Long)
(message.WinPosCoin = $util.Long.fromValue(object.WinPosCoin)).unsigned = false;
else if (typeof object.WinPosCoin === "string")
message.WinPosCoin = parseInt(object.WinPosCoin, 10);
else if (typeof object.WinPosCoin === "number")
message.WinPosCoin = object.WinPosCoin;
else if (typeof object.WinPosCoin === "object")
message.WinPosCoin = new $util.LongBits(object.WinPosCoin.low >>> 0, object.WinPosCoin.high >>> 0).toNumber();
if (object.LosePos != null)
message.LosePos = object.LosePos | 0;
if (object.LosePosCoin != null)
if ($util.Long)
(message.LosePosCoin = $util.Long.fromValue(object.LosePosCoin)).unsigned = false;
else if (typeof object.LosePosCoin === "string")
message.LosePosCoin = parseInt(object.LosePosCoin, 10);
else if (typeof object.LosePosCoin === "number")
message.LosePosCoin = object.LosePosCoin;
else if (typeof object.LosePosCoin === "object")
message.LosePosCoin = new $util.LongBits(object.LosePosCoin.low >>> 0, object.LosePosCoin.high >>> 0).toNumber();
if (object.WinCoin != null)
if ($util.Long)
(message.WinCoin = $util.Long.fromValue(object.WinCoin)).unsigned = false;
else if (typeof object.WinCoin === "string")
message.WinCoin = parseInt(object.WinCoin, 10);
else if (typeof object.WinCoin === "number")
message.WinCoin = object.WinCoin;
else if (typeof object.WinCoin === "object")
message.WinCoin = new $util.LongBits(object.WinCoin.low >>> 0, object.WinCoin.high >>> 0).toNumber();
if (object.LoseCoin != null)
if ($util.Long)
(message.LoseCoin = $util.Long.fromValue(object.LoseCoin)).unsigned = false;
else if (typeof object.LoseCoin === "string")
message.LoseCoin = parseInt(object.LoseCoin, 10);
else if (typeof object.LoseCoin === "number")
message.LoseCoin = object.LoseCoin;
else if (typeof object.LoseCoin === "object")
message.LoseCoin = new $util.LongBits(object.LoseCoin.low >>> 0, object.LoseCoin.high >>> 0).toNumber();
return message;
};
/**
* Creates a plain object from a SCChesstitiansSmallGameBilled message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {chesstitians.SCChesstitiansSmallGameBilled} message SCChesstitiansSmallGameBilled
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansSmallGameBilled.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.WinPos = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.WinPosCoin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.WinPosCoin = options.longs === String ? "0" : 0;
object.LosePos = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.LosePosCoin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.LosePosCoin = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.WinCoin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.WinCoin = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.LoseCoin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.LoseCoin = options.longs === String ? "0" : 0;
}
if (message.WinPos != null && message.hasOwnProperty("WinPos"))
object.WinPos = message.WinPos;
if (message.WinPosCoin != null && message.hasOwnProperty("WinPosCoin"))
if (typeof message.WinPosCoin === "number")
object.WinPosCoin = options.longs === String ? String(message.WinPosCoin) : message.WinPosCoin;
else
object.WinPosCoin = options.longs === String ? $util.Long.prototype.toString.call(message.WinPosCoin) : options.longs === Number ? new $util.LongBits(message.WinPosCoin.low >>> 0, message.WinPosCoin.high >>> 0).toNumber() : message.WinPosCoin;
if (message.LosePos != null && message.hasOwnProperty("LosePos"))
object.LosePos = message.LosePos;
if (message.LosePosCoin != null && message.hasOwnProperty("LosePosCoin"))
if (typeof message.LosePosCoin === "number")
object.LosePosCoin = options.longs === String ? String(message.LosePosCoin) : message.LosePosCoin;
else
object.LosePosCoin = options.longs === String ? $util.Long.prototype.toString.call(message.LosePosCoin) : options.longs === Number ? new $util.LongBits(message.LosePosCoin.low >>> 0, message.LosePosCoin.high >>> 0).toNumber() : message.LosePosCoin;
if (message.WinCoin != null && message.hasOwnProperty("WinCoin"))
if (typeof message.WinCoin === "number")
object.WinCoin = options.longs === String ? String(message.WinCoin) : message.WinCoin;
else
object.WinCoin = options.longs === String ? $util.Long.prototype.toString.call(message.WinCoin) : options.longs === Number ? new $util.LongBits(message.WinCoin.low >>> 0, message.WinCoin.high >>> 0).toNumber() : message.WinCoin;
if (message.LoseCoin != null && message.hasOwnProperty("LoseCoin"))
if (typeof message.LoseCoin === "number")
object.LoseCoin = options.longs === String ? String(message.LoseCoin) : message.LoseCoin;
else
object.LoseCoin = options.longs === String ? $util.Long.prototype.toString.call(message.LoseCoin) : options.longs === Number ? new $util.LongBits(message.LoseCoin.low >>> 0, message.LoseCoin.high >>> 0).toNumber() : message.LoseCoin;
return object;
};
/**
* Converts this SCChesstitiansSmallGameBilled to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansSmallGameBilled.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansSmallGameBilled
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansSmallGameBilled
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansSmallGameBilled.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansSmallGameBilled";
};
return SCChesstitiansSmallGameBilled;
})();
chesstitians.SCChesstitiansCard = (function() {
/**
* Properties of a SCChesstitiansCard.
* @memberof chesstitians
* @interface ISCChesstitiansCard
* @property {Array.<number>|null} [Cards] SCChesstitiansCard Cards
*/
/**
* Constructs a new SCChesstitiansCard.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansCard.
* @implements ISCChesstitiansCard
* @constructor
* @param {chesstitians.ISCChesstitiansCard=} [properties] Properties to set
*/
function SCChesstitiansCard(properties) {
this.Cards = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansCard Cards.
* @member {Array.<number>} Cards
* @memberof chesstitians.SCChesstitiansCard
* @instance
*/
SCChesstitiansCard.prototype.Cards = $util.emptyArray;
/**
* Creates a new SCChesstitiansCard instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {chesstitians.ISCChesstitiansCard=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansCard} SCChesstitiansCard instance
*/
SCChesstitiansCard.create = function create(properties) {
return new SCChesstitiansCard(properties);
};
/**
* Encodes the specified SCChesstitiansCard message. Does not implicitly {@link chesstitians.SCChesstitiansCard.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {chesstitians.ISCChesstitiansCard} message SCChesstitiansCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansCard.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Cards != null && message.Cards.length) {
writer.uint32(/* id 1, wireType 2 =*/10).fork();
for (var i = 0; i < message.Cards.length; ++i)
writer.int32(message.Cards[i]);
writer.ldelim();
}
return writer;
};
/**
* Encodes the specified SCChesstitiansCard message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansCard.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {chesstitians.ISCChesstitiansCard} message SCChesstitiansCard message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansCard.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansCard message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansCard} SCChesstitiansCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansCard.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansCard();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (!(message.Cards && message.Cards.length))
message.Cards = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Cards.push(reader.int32());
} else
message.Cards.push(reader.int32());
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansCard message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansCard} SCChesstitiansCard
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansCard.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansCard message.
* @function verify
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansCard.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Cards != null && message.hasOwnProperty("Cards")) {
if (!Array.isArray(message.Cards))
return "Cards: array expected";
for (var i = 0; i < message.Cards.length; ++i)
if (!$util.isInteger(message.Cards[i]))
return "Cards: integer[] expected";
}
return null;
};
/**
* Creates a SCChesstitiansCard message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansCard} SCChesstitiansCard
*/
SCChesstitiansCard.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansCard)
return object;
var message = new $root.chesstitians.SCChesstitiansCard();
if (object.Cards) {
if (!Array.isArray(object.Cards))
throw TypeError(".chesstitians.SCChesstitiansCard.Cards: array expected");
message.Cards = [];
for (var i = 0; i < object.Cards.length; ++i)
message.Cards[i] = object.Cards[i] | 0;
}
return message;
};
/**
* Creates a plain object from a SCChesstitiansCard message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {chesstitians.SCChesstitiansCard} message SCChesstitiansCard
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansCard.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Cards = [];
if (message.Cards && message.Cards.length) {
object.Cards = [];
for (var j = 0; j < message.Cards.length; ++j)
object.Cards[j] = message.Cards[j];
}
return object;
};
/**
* Converts this SCChesstitiansCard to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansCard
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansCard.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansCard
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansCard
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansCard.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansCard";
};
return SCChesstitiansCard;
})();
chesstitians.SCChesstitiansCardTest = (function() {
/**
* Properties of a SCChesstitiansCardTest.
* @memberof chesstitians
* @interface ISCChesstitiansCardTest
* @property {Object.<string,number>|null} [Grades] SCChesstitiansCardTest Grades
* @property {number|null} [Type] SCChesstitiansCardTest Type
* @property {number|Long|null} [Totalin] SCChesstitiansCardTest Totalin
* @property {number|Long|null} [Totalout] SCChesstitiansCardTest Totalout
* @property {number|null} [LoseRate] SCChesstitiansCardTest LoseRate
*/
/**
* Constructs a new SCChesstitiansCardTest.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansCardTest.
* @implements ISCChesstitiansCardTest
* @constructor
* @param {chesstitians.ISCChesstitiansCardTest=} [properties] Properties to set
*/
function SCChesstitiansCardTest(properties) {
this.Grades = {};
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansCardTest Grades.
* @member {Object.<string,number>} Grades
* @memberof chesstitians.SCChesstitiansCardTest
* @instance
*/
SCChesstitiansCardTest.prototype.Grades = $util.emptyObject;
/**
* SCChesstitiansCardTest Type.
* @member {number} Type
* @memberof chesstitians.SCChesstitiansCardTest
* @instance
*/
SCChesstitiansCardTest.prototype.Type = 0;
/**
* SCChesstitiansCardTest Totalin.
* @member {number|Long} Totalin
* @memberof chesstitians.SCChesstitiansCardTest
* @instance
*/
SCChesstitiansCardTest.prototype.Totalin = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* SCChesstitiansCardTest Totalout.
* @member {number|Long} Totalout
* @memberof chesstitians.SCChesstitiansCardTest
* @instance
*/
SCChesstitiansCardTest.prototype.Totalout = $util.Long ? $util.Long.fromBits(0,0,false) : 0;
/**
* SCChesstitiansCardTest LoseRate.
* @member {number} LoseRate
* @memberof chesstitians.SCChesstitiansCardTest
* @instance
*/
SCChesstitiansCardTest.prototype.LoseRate = 0;
/**
* Creates a new SCChesstitiansCardTest instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {chesstitians.ISCChesstitiansCardTest=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansCardTest} SCChesstitiansCardTest instance
*/
SCChesstitiansCardTest.create = function create(properties) {
return new SCChesstitiansCardTest(properties);
};
/**
* Encodes the specified SCChesstitiansCardTest message. Does not implicitly {@link chesstitians.SCChesstitiansCardTest.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {chesstitians.ISCChesstitiansCardTest} message SCChesstitiansCardTest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansCardTest.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Grades != null && Object.hasOwnProperty.call(message, "Grades"))
for (var keys = Object.keys(message.Grades), i = 0; i < keys.length; ++i)
writer.uint32(/* id 1, wireType 2 =*/10).fork().uint32(/* id 1, wireType 0 =*/8).int32(keys[i]).uint32(/* id 2, wireType 0 =*/16).int32(message.Grades[keys[i]]).ldelim();
if (message.Type != null && Object.hasOwnProperty.call(message, "Type"))
writer.uint32(/* id 2, wireType 0 =*/16).int32(message.Type);
if (message.Totalin != null && Object.hasOwnProperty.call(message, "Totalin"))
writer.uint32(/* id 3, wireType 0 =*/24).int64(message.Totalin);
if (message.Totalout != null && Object.hasOwnProperty.call(message, "Totalout"))
writer.uint32(/* id 4, wireType 0 =*/32).int64(message.Totalout);
if (message.LoseRate != null && Object.hasOwnProperty.call(message, "LoseRate"))
writer.uint32(/* id 5, wireType 1 =*/41).double(message.LoseRate);
return writer;
};
/**
* Encodes the specified SCChesstitiansCardTest message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansCardTest.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {chesstitians.ISCChesstitiansCardTest} message SCChesstitiansCardTest message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansCardTest.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansCardTest message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansCardTest} SCChesstitiansCardTest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansCardTest.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansCardTest(), key, value;
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
if (message.Grades === $util.emptyObject)
message.Grades = {};
var end2 = reader.uint32() + reader.pos;
key = 0;
value = 0;
while (reader.pos < end2) {
var tag2 = reader.uint32();
switch (tag2 >>> 3) {
case 1:
key = reader.int32();
break;
case 2:
value = reader.int32();
break;
default:
reader.skipType(tag2 & 7);
break;
}
}
message.Grades[key] = value;
break;
}
case 2: {
message.Type = reader.int32();
break;
}
case 3: {
message.Totalin = reader.int64();
break;
}
case 4: {
message.Totalout = reader.int64();
break;
}
case 5: {
message.LoseRate = reader.double();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansCardTest message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansCardTest} SCChesstitiansCardTest
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansCardTest.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansCardTest message.
* @function verify
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansCardTest.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Grades != null && message.hasOwnProperty("Grades")) {
if (!$util.isObject(message.Grades))
return "Grades: object expected";
var key = Object.keys(message.Grades);
for (var i = 0; i < key.length; ++i) {
if (!$util.key32Re.test(key[i]))
return "Grades: integer key{k:int32} expected";
if (!$util.isInteger(message.Grades[key[i]]))
return "Grades: integer{k:int32} expected";
}
}
if (message.Type != null && message.hasOwnProperty("Type"))
if (!$util.isInteger(message.Type))
return "Type: integer expected";
if (message.Totalin != null && message.hasOwnProperty("Totalin"))
if (!$util.isInteger(message.Totalin) && !(message.Totalin && $util.isInteger(message.Totalin.low) && $util.isInteger(message.Totalin.high)))
return "Totalin: integer|Long expected";
if (message.Totalout != null && message.hasOwnProperty("Totalout"))
if (!$util.isInteger(message.Totalout) && !(message.Totalout && $util.isInteger(message.Totalout.low) && $util.isInteger(message.Totalout.high)))
return "Totalout: integer|Long expected";
if (message.LoseRate != null && message.hasOwnProperty("LoseRate"))
if (typeof message.LoseRate !== "number")
return "LoseRate: number expected";
return null;
};
/**
* Creates a SCChesstitiansCardTest message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansCardTest} SCChesstitiansCardTest
*/
SCChesstitiansCardTest.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansCardTest)
return object;
var message = new $root.chesstitians.SCChesstitiansCardTest();
if (object.Grades) {
if (typeof object.Grades !== "object")
throw TypeError(".chesstitians.SCChesstitiansCardTest.Grades: object expected");
message.Grades = {};
for (var keys = Object.keys(object.Grades), i = 0; i < keys.length; ++i)
message.Grades[keys[i]] = object.Grades[keys[i]] | 0;
}
if (object.Type != null)
message.Type = object.Type | 0;
if (object.Totalin != null)
if ($util.Long)
(message.Totalin = $util.Long.fromValue(object.Totalin)).unsigned = false;
else if (typeof object.Totalin === "string")
message.Totalin = parseInt(object.Totalin, 10);
else if (typeof object.Totalin === "number")
message.Totalin = object.Totalin;
else if (typeof object.Totalin === "object")
message.Totalin = new $util.LongBits(object.Totalin.low >>> 0, object.Totalin.high >>> 0).toNumber();
if (object.Totalout != null)
if ($util.Long)
(message.Totalout = $util.Long.fromValue(object.Totalout)).unsigned = false;
else if (typeof object.Totalout === "string")
message.Totalout = parseInt(object.Totalout, 10);
else if (typeof object.Totalout === "number")
message.Totalout = object.Totalout;
else if (typeof object.Totalout === "object")
message.Totalout = new $util.LongBits(object.Totalout.low >>> 0, object.Totalout.high >>> 0).toNumber();
if (object.LoseRate != null)
message.LoseRate = Number(object.LoseRate);
return message;
};
/**
* Creates a plain object from a SCChesstitiansCardTest message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {chesstitians.SCChesstitiansCardTest} message SCChesstitiansCardTest
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansCardTest.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.objects || options.defaults)
object.Grades = {};
if (options.defaults) {
object.Type = 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.Totalin = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.Totalin = options.longs === String ? "0" : 0;
if ($util.Long) {
var long = new $util.Long(0, 0, false);
object.Totalout = options.longs === String ? long.toString() : options.longs === Number ? long.toNumber() : long;
} else
object.Totalout = options.longs === String ? "0" : 0;
object.LoseRate = 0;
}
var keys2;
if (message.Grades && (keys2 = Object.keys(message.Grades)).length) {
object.Grades = {};
for (var j = 0; j < keys2.length; ++j)
object.Grades[keys2[j]] = message.Grades[keys2[j]];
}
if (message.Type != null && message.hasOwnProperty("Type"))
object.Type = message.Type;
if (message.Totalin != null && message.hasOwnProperty("Totalin"))
if (typeof message.Totalin === "number")
object.Totalin = options.longs === String ? String(message.Totalin) : message.Totalin;
else
object.Totalin = options.longs === String ? $util.Long.prototype.toString.call(message.Totalin) : options.longs === Number ? new $util.LongBits(message.Totalin.low >>> 0, message.Totalin.high >>> 0).toNumber() : message.Totalin;
if (message.Totalout != null && message.hasOwnProperty("Totalout"))
if (typeof message.Totalout === "number")
object.Totalout = options.longs === String ? String(message.Totalout) : message.Totalout;
else
object.Totalout = options.longs === String ? $util.Long.prototype.toString.call(message.Totalout) : options.longs === Number ? new $util.LongBits(message.Totalout.low >>> 0, message.Totalout.high >>> 0).toNumber() : message.Totalout;
if (message.LoseRate != null && message.hasOwnProperty("LoseRate"))
object.LoseRate = options.json && !isFinite(message.LoseRate) ? String(message.LoseRate) : message.LoseRate;
return object;
};
/**
* Converts this SCChesstitiansCardTest to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansCardTest
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansCardTest.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansCardTest
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansCardTest
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansCardTest.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansCardTest";
};
return SCChesstitiansCardTest;
})();
chesstitians.SCChesstitiansCurOpPos = (function() {
/**
* Properties of a SCChesstitiansCurOpPos.
* @memberof chesstitians
* @interface ISCChesstitiansCurOpPos
* @property {number|null} [Pos] SCChesstitiansCurOpPos Pos
* @property {boolean|null} [IsNew] SCChesstitiansCurOpPos IsNew
* @property {Array.<number>|null} [Cards] SCChesstitiansCurOpPos Cards
* @property {number|null} [ExDelay] SCChesstitiansCurOpPos ExDelay
*/
/**
* Constructs a new SCChesstitiansCurOpPos.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansCurOpPos.
* @implements ISCChesstitiansCurOpPos
* @constructor
* @param {chesstitians.ISCChesstitiansCurOpPos=} [properties] Properties to set
*/
function SCChesstitiansCurOpPos(properties) {
this.Cards = [];
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansCurOpPos Pos.
* @member {number} Pos
* @memberof chesstitians.SCChesstitiansCurOpPos
* @instance
*/
SCChesstitiansCurOpPos.prototype.Pos = 0;
/**
* SCChesstitiansCurOpPos IsNew.
* @member {boolean} IsNew
* @memberof chesstitians.SCChesstitiansCurOpPos
* @instance
*/
SCChesstitiansCurOpPos.prototype.IsNew = false;
/**
* SCChesstitiansCurOpPos Cards.
* @member {Array.<number>} Cards
* @memberof chesstitians.SCChesstitiansCurOpPos
* @instance
*/
SCChesstitiansCurOpPos.prototype.Cards = $util.emptyArray;
/**
* SCChesstitiansCurOpPos ExDelay.
* @member {number} ExDelay
* @memberof chesstitians.SCChesstitiansCurOpPos
* @instance
*/
SCChesstitiansCurOpPos.prototype.ExDelay = 0;
/**
* Creates a new SCChesstitiansCurOpPos instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {chesstitians.ISCChesstitiansCurOpPos=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansCurOpPos} SCChesstitiansCurOpPos instance
*/
SCChesstitiansCurOpPos.create = function create(properties) {
return new SCChesstitiansCurOpPos(properties);
};
/**
* Encodes the specified SCChesstitiansCurOpPos message. Does not implicitly {@link chesstitians.SCChesstitiansCurOpPos.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {chesstitians.ISCChesstitiansCurOpPos} message SCChesstitiansCurOpPos message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansCurOpPos.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Pos != null && Object.hasOwnProperty.call(message, "Pos"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Pos);
if (message.IsNew != null && Object.hasOwnProperty.call(message, "IsNew"))
writer.uint32(/* id 2, wireType 0 =*/16).bool(message.IsNew);
if (message.Cards != null && message.Cards.length) {
writer.uint32(/* id 3, wireType 2 =*/26).fork();
for (var i = 0; i < message.Cards.length; ++i)
writer.int32(message.Cards[i]);
writer.ldelim();
}
if (message.ExDelay != null && Object.hasOwnProperty.call(message, "ExDelay"))
writer.uint32(/* id 4, wireType 0 =*/32).int32(message.ExDelay);
return writer;
};
/**
* Encodes the specified SCChesstitiansCurOpPos message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansCurOpPos.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {chesstitians.ISCChesstitiansCurOpPos} message SCChesstitiansCurOpPos message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansCurOpPos.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansCurOpPos message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansCurOpPos} SCChesstitiansCurOpPos
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansCurOpPos.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansCurOpPos();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Pos = reader.int32();
break;
}
case 2: {
message.IsNew = reader.bool();
break;
}
case 3: {
if (!(message.Cards && message.Cards.length))
message.Cards = [];
if ((tag & 7) === 2) {
var end2 = reader.uint32() + reader.pos;
while (reader.pos < end2)
message.Cards.push(reader.int32());
} else
message.Cards.push(reader.int32());
break;
}
case 4: {
message.ExDelay = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansCurOpPos message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansCurOpPos} SCChesstitiansCurOpPos
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansCurOpPos.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansCurOpPos message.
* @function verify
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansCurOpPos.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Pos != null && message.hasOwnProperty("Pos"))
if (!$util.isInteger(message.Pos))
return "Pos: integer expected";
if (message.IsNew != null && message.hasOwnProperty("IsNew"))
if (typeof message.IsNew !== "boolean")
return "IsNew: boolean expected";
if (message.Cards != null && message.hasOwnProperty("Cards")) {
if (!Array.isArray(message.Cards))
return "Cards: array expected";
for (var i = 0; i < message.Cards.length; ++i)
if (!$util.isInteger(message.Cards[i]))
return "Cards: integer[] expected";
}
if (message.ExDelay != null && message.hasOwnProperty("ExDelay"))
if (!$util.isInteger(message.ExDelay))
return "ExDelay: integer expected";
return null;
};
/**
* Creates a SCChesstitiansCurOpPos message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansCurOpPos} SCChesstitiansCurOpPos
*/
SCChesstitiansCurOpPos.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansCurOpPos)
return object;
var message = new $root.chesstitians.SCChesstitiansCurOpPos();
if (object.Pos != null)
message.Pos = object.Pos | 0;
if (object.IsNew != null)
message.IsNew = Boolean(object.IsNew);
if (object.Cards) {
if (!Array.isArray(object.Cards))
throw TypeError(".chesstitians.SCChesstitiansCurOpPos.Cards: array expected");
message.Cards = [];
for (var i = 0; i < object.Cards.length; ++i)
message.Cards[i] = object.Cards[i] | 0;
}
if (object.ExDelay != null)
message.ExDelay = object.ExDelay | 0;
return message;
};
/**
* Creates a plain object from a SCChesstitiansCurOpPos message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {chesstitians.SCChesstitiansCurOpPos} message SCChesstitiansCurOpPos
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansCurOpPos.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.arrays || options.defaults)
object.Cards = [];
if (options.defaults) {
object.Pos = 0;
object.IsNew = false;
object.ExDelay = 0;
}
if (message.Pos != null && message.hasOwnProperty("Pos"))
object.Pos = message.Pos;
if (message.IsNew != null && message.hasOwnProperty("IsNew"))
object.IsNew = message.IsNew;
if (message.Cards && message.Cards.length) {
object.Cards = [];
for (var j = 0; j < message.Cards.length; ++j)
object.Cards[j] = message.Cards[j];
}
if (message.ExDelay != null && message.hasOwnProperty("ExDelay"))
object.ExDelay = message.ExDelay;
return object;
};
/**
* Converts this SCChesstitiansCurOpPos to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansCurOpPos
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansCurOpPos.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansCurOpPos
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansCurOpPos
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansCurOpPos.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansCurOpPos";
};
return SCChesstitiansCurOpPos;
})();
chesstitians.SCChesstitiansUpdateMasterSnid = (function() {
/**
* Properties of a SCChesstitiansUpdateMasterSnid.
* @memberof chesstitians
* @interface ISCChesstitiansUpdateMasterSnid
* @property {number|null} [MasterSnid] SCChesstitiansUpdateMasterSnid MasterSnid
*/
/**
* Constructs a new SCChesstitiansUpdateMasterSnid.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansUpdateMasterSnid.
* @implements ISCChesstitiansUpdateMasterSnid
* @constructor
* @param {chesstitians.ISCChesstitiansUpdateMasterSnid=} [properties] Properties to set
*/
function SCChesstitiansUpdateMasterSnid(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansUpdateMasterSnid MasterSnid.
* @member {number} MasterSnid
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @instance
*/
SCChesstitiansUpdateMasterSnid.prototype.MasterSnid = 0;
/**
* Creates a new SCChesstitiansUpdateMasterSnid instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {chesstitians.ISCChesstitiansUpdateMasterSnid=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansUpdateMasterSnid} SCChesstitiansUpdateMasterSnid instance
*/
SCChesstitiansUpdateMasterSnid.create = function create(properties) {
return new SCChesstitiansUpdateMasterSnid(properties);
};
/**
* Encodes the specified SCChesstitiansUpdateMasterSnid message. Does not implicitly {@link chesstitians.SCChesstitiansUpdateMasterSnid.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {chesstitians.ISCChesstitiansUpdateMasterSnid} message SCChesstitiansUpdateMasterSnid message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansUpdateMasterSnid.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.MasterSnid != null && Object.hasOwnProperty.call(message, "MasterSnid"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.MasterSnid);
return writer;
};
/**
* Encodes the specified SCChesstitiansUpdateMasterSnid message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansUpdateMasterSnid.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {chesstitians.ISCChesstitiansUpdateMasterSnid} message SCChesstitiansUpdateMasterSnid message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansUpdateMasterSnid.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansUpdateMasterSnid message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansUpdateMasterSnid} SCChesstitiansUpdateMasterSnid
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansUpdateMasterSnid.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansUpdateMasterSnid();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.MasterSnid = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansUpdateMasterSnid message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansUpdateMasterSnid} SCChesstitiansUpdateMasterSnid
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansUpdateMasterSnid.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansUpdateMasterSnid message.
* @function verify
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansUpdateMasterSnid.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.MasterSnid != null && message.hasOwnProperty("MasterSnid"))
if (!$util.isInteger(message.MasterSnid))
return "MasterSnid: integer expected";
return null;
};
/**
* Creates a SCChesstitiansUpdateMasterSnid message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansUpdateMasterSnid} SCChesstitiansUpdateMasterSnid
*/
SCChesstitiansUpdateMasterSnid.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansUpdateMasterSnid)
return object;
var message = new $root.chesstitians.SCChesstitiansUpdateMasterSnid();
if (object.MasterSnid != null)
message.MasterSnid = object.MasterSnid | 0;
return message;
};
/**
* Creates a plain object from a SCChesstitiansUpdateMasterSnid message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {chesstitians.SCChesstitiansUpdateMasterSnid} message SCChesstitiansUpdateMasterSnid
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansUpdateMasterSnid.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.MasterSnid = 0;
if (message.MasterSnid != null && message.hasOwnProperty("MasterSnid"))
object.MasterSnid = message.MasterSnid;
return object;
};
/**
* Converts this SCChesstitiansUpdateMasterSnid to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansUpdateMasterSnid.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansUpdateMasterSnid
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansUpdateMasterSnid
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansUpdateMasterSnid.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansUpdateMasterSnid";
};
return SCChesstitiansUpdateMasterSnid;
})();
chesstitians.SCChesstitiansUpdateAudienceNum = (function() {
/**
* Properties of a SCChesstitiansUpdateAudienceNum.
* @memberof chesstitians
* @interface ISCChesstitiansUpdateAudienceNum
* @property {number|null} [AudienceNum] SCChesstitiansUpdateAudienceNum AudienceNum
*/
/**
* Constructs a new SCChesstitiansUpdateAudienceNum.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansUpdateAudienceNum.
* @implements ISCChesstitiansUpdateAudienceNum
* @constructor
* @param {chesstitians.ISCChesstitiansUpdateAudienceNum=} [properties] Properties to set
*/
function SCChesstitiansUpdateAudienceNum(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansUpdateAudienceNum AudienceNum.
* @member {number} AudienceNum
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @instance
*/
SCChesstitiansUpdateAudienceNum.prototype.AudienceNum = 0;
/**
* Creates a new SCChesstitiansUpdateAudienceNum instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {chesstitians.ISCChesstitiansUpdateAudienceNum=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansUpdateAudienceNum} SCChesstitiansUpdateAudienceNum instance
*/
SCChesstitiansUpdateAudienceNum.create = function create(properties) {
return new SCChesstitiansUpdateAudienceNum(properties);
};
/**
* Encodes the specified SCChesstitiansUpdateAudienceNum message. Does not implicitly {@link chesstitians.SCChesstitiansUpdateAudienceNum.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {chesstitians.ISCChesstitiansUpdateAudienceNum} message SCChesstitiansUpdateAudienceNum message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansUpdateAudienceNum.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.AudienceNum != null && Object.hasOwnProperty.call(message, "AudienceNum"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.AudienceNum);
return writer;
};
/**
* Encodes the specified SCChesstitiansUpdateAudienceNum message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansUpdateAudienceNum.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {chesstitians.ISCChesstitiansUpdateAudienceNum} message SCChesstitiansUpdateAudienceNum message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansUpdateAudienceNum.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansUpdateAudienceNum message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansUpdateAudienceNum} SCChesstitiansUpdateAudienceNum
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansUpdateAudienceNum.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansUpdateAudienceNum();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.AudienceNum = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansUpdateAudienceNum message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansUpdateAudienceNum} SCChesstitiansUpdateAudienceNum
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansUpdateAudienceNum.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansUpdateAudienceNum message.
* @function verify
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansUpdateAudienceNum.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.AudienceNum != null && message.hasOwnProperty("AudienceNum"))
if (!$util.isInteger(message.AudienceNum))
return "AudienceNum: integer expected";
return null;
};
/**
* Creates a SCChesstitiansUpdateAudienceNum message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansUpdateAudienceNum} SCChesstitiansUpdateAudienceNum
*/
SCChesstitiansUpdateAudienceNum.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansUpdateAudienceNum)
return object;
var message = new $root.chesstitians.SCChesstitiansUpdateAudienceNum();
if (object.AudienceNum != null)
message.AudienceNum = object.AudienceNum | 0;
return message;
};
/**
* Creates a plain object from a SCChesstitiansUpdateAudienceNum message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {chesstitians.SCChesstitiansUpdateAudienceNum} message SCChesstitiansUpdateAudienceNum
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansUpdateAudienceNum.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.AudienceNum = 0;
if (message.AudienceNum != null && message.hasOwnProperty("AudienceNum"))
object.AudienceNum = message.AudienceNum;
return object;
};
/**
* Converts this SCChesstitiansUpdateAudienceNum to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansUpdateAudienceNum.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansUpdateAudienceNum
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansUpdateAudienceNum
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansUpdateAudienceNum.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansUpdateAudienceNum";
};
return SCChesstitiansUpdateAudienceNum;
})();
chesstitians.SCChesstitiansAIData = (function() {
/**
* Properties of a SCChesstitiansAIData.
* @memberof chesstitians
* @interface ISCChesstitiansAIData
* @property {number|null} [BombNum] SCChesstitiansAIData BombNum
* @property {string|null} [CardPlayActionSeq] SCChesstitiansAIData CardPlayActionSeq
* @property {string|null} [LastMove_0] SCChesstitiansAIData LastMove_0
* @property {string|null} [LastMove_1] SCChesstitiansAIData LastMove_1
* @property {string|null} [LastMove_2] SCChesstitiansAIData LastMove_2
* @property {string|null} [LastMove_3] SCChesstitiansAIData LastMove_3
* @property {number|null} [NumCardsLeft_0] SCChesstitiansAIData NumCardsLeft_0
* @property {number|null} [NumCardsLeft_1] SCChesstitiansAIData NumCardsLeft_1
* @property {number|null} [NumCardsLeft_2] SCChesstitiansAIData NumCardsLeft_2
* @property {number|null} [NumCardsLeft_3] SCChesstitiansAIData NumCardsLeft_3
* @property {string|null} [OtherHandCards] SCChesstitiansAIData OtherHandCards
* @property {string|null} [PlayedCards_0] SCChesstitiansAIData PlayedCards_0
* @property {string|null} [PlayedCards_1] SCChesstitiansAIData PlayedCards_1
* @property {string|null} [PlayedCards_2] SCChesstitiansAIData PlayedCards_2
* @property {string|null} [PlayedCards_3] SCChesstitiansAIData PlayedCards_3
* @property {string|null} [PlayerHandCards] SCChesstitiansAIData PlayerHandCards
* @property {number|null} [PlayerPosition] SCChesstitiansAIData PlayerPosition
*/
/**
* Constructs a new SCChesstitiansAIData.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansAIData.
* @implements ISCChesstitiansAIData
* @constructor
* @param {chesstitians.ISCChesstitiansAIData=} [properties] Properties to set
*/
function SCChesstitiansAIData(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansAIData BombNum.
* @member {number} BombNum
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.BombNum = 0;
/**
* SCChesstitiansAIData CardPlayActionSeq.
* @member {string} CardPlayActionSeq
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.CardPlayActionSeq = "";
/**
* SCChesstitiansAIData LastMove_0.
* @member {string} LastMove_0
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.LastMove_0 = "";
/**
* SCChesstitiansAIData LastMove_1.
* @member {string} LastMove_1
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.LastMove_1 = "";
/**
* SCChesstitiansAIData LastMove_2.
* @member {string} LastMove_2
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.LastMove_2 = "";
/**
* SCChesstitiansAIData LastMove_3.
* @member {string} LastMove_3
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.LastMove_3 = "";
/**
* SCChesstitiansAIData NumCardsLeft_0.
* @member {number} NumCardsLeft_0
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.NumCardsLeft_0 = 0;
/**
* SCChesstitiansAIData NumCardsLeft_1.
* @member {number} NumCardsLeft_1
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.NumCardsLeft_1 = 0;
/**
* SCChesstitiansAIData NumCardsLeft_2.
* @member {number} NumCardsLeft_2
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.NumCardsLeft_2 = 0;
/**
* SCChesstitiansAIData NumCardsLeft_3.
* @member {number} NumCardsLeft_3
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.NumCardsLeft_3 = 0;
/**
* SCChesstitiansAIData OtherHandCards.
* @member {string} OtherHandCards
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.OtherHandCards = "";
/**
* SCChesstitiansAIData PlayedCards_0.
* @member {string} PlayedCards_0
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.PlayedCards_0 = "";
/**
* SCChesstitiansAIData PlayedCards_1.
* @member {string} PlayedCards_1
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.PlayedCards_1 = "";
/**
* SCChesstitiansAIData PlayedCards_2.
* @member {string} PlayedCards_2
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.PlayedCards_2 = "";
/**
* SCChesstitiansAIData PlayedCards_3.
* @member {string} PlayedCards_3
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.PlayedCards_3 = "";
/**
* SCChesstitiansAIData PlayerHandCards.
* @member {string} PlayerHandCards
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.PlayerHandCards = "";
/**
* SCChesstitiansAIData PlayerPosition.
* @member {number} PlayerPosition
* @memberof chesstitians.SCChesstitiansAIData
* @instance
*/
SCChesstitiansAIData.prototype.PlayerPosition = 0;
/**
* Creates a new SCChesstitiansAIData instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {chesstitians.ISCChesstitiansAIData=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansAIData} SCChesstitiansAIData instance
*/
SCChesstitiansAIData.create = function create(properties) {
return new SCChesstitiansAIData(properties);
};
/**
* Encodes the specified SCChesstitiansAIData message. Does not implicitly {@link chesstitians.SCChesstitiansAIData.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {chesstitians.ISCChesstitiansAIData} message SCChesstitiansAIData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansAIData.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.BombNum != null && Object.hasOwnProperty.call(message, "BombNum"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.BombNum);
if (message.CardPlayActionSeq != null && Object.hasOwnProperty.call(message, "CardPlayActionSeq"))
writer.uint32(/* id 2, wireType 2 =*/18).string(message.CardPlayActionSeq);
if (message.LastMove_0 != null && Object.hasOwnProperty.call(message, "LastMove_0"))
writer.uint32(/* id 3, wireType 2 =*/26).string(message.LastMove_0);
if (message.LastMove_1 != null && Object.hasOwnProperty.call(message, "LastMove_1"))
writer.uint32(/* id 4, wireType 2 =*/34).string(message.LastMove_1);
if (message.LastMove_2 != null && Object.hasOwnProperty.call(message, "LastMove_2"))
writer.uint32(/* id 5, wireType 2 =*/42).string(message.LastMove_2);
if (message.LastMove_3 != null && Object.hasOwnProperty.call(message, "LastMove_3"))
writer.uint32(/* id 6, wireType 2 =*/50).string(message.LastMove_3);
if (message.NumCardsLeft_0 != null && Object.hasOwnProperty.call(message, "NumCardsLeft_0"))
writer.uint32(/* id 7, wireType 0 =*/56).int32(message.NumCardsLeft_0);
if (message.NumCardsLeft_1 != null && Object.hasOwnProperty.call(message, "NumCardsLeft_1"))
writer.uint32(/* id 8, wireType 0 =*/64).int32(message.NumCardsLeft_1);
if (message.NumCardsLeft_2 != null && Object.hasOwnProperty.call(message, "NumCardsLeft_2"))
writer.uint32(/* id 9, wireType 0 =*/72).int32(message.NumCardsLeft_2);
if (message.NumCardsLeft_3 != null && Object.hasOwnProperty.call(message, "NumCardsLeft_3"))
writer.uint32(/* id 10, wireType 0 =*/80).int32(message.NumCardsLeft_3);
if (message.OtherHandCards != null && Object.hasOwnProperty.call(message, "OtherHandCards"))
writer.uint32(/* id 11, wireType 2 =*/90).string(message.OtherHandCards);
if (message.PlayedCards_0 != null && Object.hasOwnProperty.call(message, "PlayedCards_0"))
writer.uint32(/* id 12, wireType 2 =*/98).string(message.PlayedCards_0);
if (message.PlayedCards_1 != null && Object.hasOwnProperty.call(message, "PlayedCards_1"))
writer.uint32(/* id 13, wireType 2 =*/106).string(message.PlayedCards_1);
if (message.PlayedCards_2 != null && Object.hasOwnProperty.call(message, "PlayedCards_2"))
writer.uint32(/* id 14, wireType 2 =*/114).string(message.PlayedCards_2);
if (message.PlayedCards_3 != null && Object.hasOwnProperty.call(message, "PlayedCards_3"))
writer.uint32(/* id 15, wireType 2 =*/122).string(message.PlayedCards_3);
if (message.PlayerHandCards != null && Object.hasOwnProperty.call(message, "PlayerHandCards"))
writer.uint32(/* id 16, wireType 2 =*/130).string(message.PlayerHandCards);
if (message.PlayerPosition != null && Object.hasOwnProperty.call(message, "PlayerPosition"))
writer.uint32(/* id 17, wireType 0 =*/136).int32(message.PlayerPosition);
return writer;
};
/**
* Encodes the specified SCChesstitiansAIData message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansAIData.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {chesstitians.ISCChesstitiansAIData} message SCChesstitiansAIData message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansAIData.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansAIData message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansAIData} SCChesstitiansAIData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansAIData.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansAIData();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.BombNum = reader.int32();
break;
}
case 2: {
message.CardPlayActionSeq = reader.string();
break;
}
case 3: {
message.LastMove_0 = reader.string();
break;
}
case 4: {
message.LastMove_1 = reader.string();
break;
}
case 5: {
message.LastMove_2 = reader.string();
break;
}
case 6: {
message.LastMove_3 = reader.string();
break;
}
case 7: {
message.NumCardsLeft_0 = reader.int32();
break;
}
case 8: {
message.NumCardsLeft_1 = reader.int32();
break;
}
case 9: {
message.NumCardsLeft_2 = reader.int32();
break;
}
case 10: {
message.NumCardsLeft_3 = reader.int32();
break;
}
case 11: {
message.OtherHandCards = reader.string();
break;
}
case 12: {
message.PlayedCards_0 = reader.string();
break;
}
case 13: {
message.PlayedCards_1 = reader.string();
break;
}
case 14: {
message.PlayedCards_2 = reader.string();
break;
}
case 15: {
message.PlayedCards_3 = reader.string();
break;
}
case 16: {
message.PlayerHandCards = reader.string();
break;
}
case 17: {
message.PlayerPosition = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansAIData message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansAIData} SCChesstitiansAIData
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansAIData.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansAIData message.
* @function verify
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansAIData.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.BombNum != null && message.hasOwnProperty("BombNum"))
if (!$util.isInteger(message.BombNum))
return "BombNum: integer expected";
if (message.CardPlayActionSeq != null && message.hasOwnProperty("CardPlayActionSeq"))
if (!$util.isString(message.CardPlayActionSeq))
return "CardPlayActionSeq: string expected";
if (message.LastMove_0 != null && message.hasOwnProperty("LastMove_0"))
if (!$util.isString(message.LastMove_0))
return "LastMove_0: string expected";
if (message.LastMove_1 != null && message.hasOwnProperty("LastMove_1"))
if (!$util.isString(message.LastMove_1))
return "LastMove_1: string expected";
if (message.LastMove_2 != null && message.hasOwnProperty("LastMove_2"))
if (!$util.isString(message.LastMove_2))
return "LastMove_2: string expected";
if (message.LastMove_3 != null && message.hasOwnProperty("LastMove_3"))
if (!$util.isString(message.LastMove_3))
return "LastMove_3: string expected";
if (message.NumCardsLeft_0 != null && message.hasOwnProperty("NumCardsLeft_0"))
if (!$util.isInteger(message.NumCardsLeft_0))
return "NumCardsLeft_0: integer expected";
if (message.NumCardsLeft_1 != null && message.hasOwnProperty("NumCardsLeft_1"))
if (!$util.isInteger(message.NumCardsLeft_1))
return "NumCardsLeft_1: integer expected";
if (message.NumCardsLeft_2 != null && message.hasOwnProperty("NumCardsLeft_2"))
if (!$util.isInteger(message.NumCardsLeft_2))
return "NumCardsLeft_2: integer expected";
if (message.NumCardsLeft_3 != null && message.hasOwnProperty("NumCardsLeft_3"))
if (!$util.isInteger(message.NumCardsLeft_3))
return "NumCardsLeft_3: integer expected";
if (message.OtherHandCards != null && message.hasOwnProperty("OtherHandCards"))
if (!$util.isString(message.OtherHandCards))
return "OtherHandCards: string expected";
if (message.PlayedCards_0 != null && message.hasOwnProperty("PlayedCards_0"))
if (!$util.isString(message.PlayedCards_0))
return "PlayedCards_0: string expected";
if (message.PlayedCards_1 != null && message.hasOwnProperty("PlayedCards_1"))
if (!$util.isString(message.PlayedCards_1))
return "PlayedCards_1: string expected";
if (message.PlayedCards_2 != null && message.hasOwnProperty("PlayedCards_2"))
if (!$util.isString(message.PlayedCards_2))
return "PlayedCards_2: string expected";
if (message.PlayedCards_3 != null && message.hasOwnProperty("PlayedCards_3"))
if (!$util.isString(message.PlayedCards_3))
return "PlayedCards_3: string expected";
if (message.PlayerHandCards != null && message.hasOwnProperty("PlayerHandCards"))
if (!$util.isString(message.PlayerHandCards))
return "PlayerHandCards: string expected";
if (message.PlayerPosition != null && message.hasOwnProperty("PlayerPosition"))
if (!$util.isInteger(message.PlayerPosition))
return "PlayerPosition: integer expected";
return null;
};
/**
* Creates a SCChesstitiansAIData message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansAIData} SCChesstitiansAIData
*/
SCChesstitiansAIData.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansAIData)
return object;
var message = new $root.chesstitians.SCChesstitiansAIData();
if (object.BombNum != null)
message.BombNum = object.BombNum | 0;
if (object.CardPlayActionSeq != null)
message.CardPlayActionSeq = String(object.CardPlayActionSeq);
if (object.LastMove_0 != null)
message.LastMove_0 = String(object.LastMove_0);
if (object.LastMove_1 != null)
message.LastMove_1 = String(object.LastMove_1);
if (object.LastMove_2 != null)
message.LastMove_2 = String(object.LastMove_2);
if (object.LastMove_3 != null)
message.LastMove_3 = String(object.LastMove_3);
if (object.NumCardsLeft_0 != null)
message.NumCardsLeft_0 = object.NumCardsLeft_0 | 0;
if (object.NumCardsLeft_1 != null)
message.NumCardsLeft_1 = object.NumCardsLeft_1 | 0;
if (object.NumCardsLeft_2 != null)
message.NumCardsLeft_2 = object.NumCardsLeft_2 | 0;
if (object.NumCardsLeft_3 != null)
message.NumCardsLeft_3 = object.NumCardsLeft_3 | 0;
if (object.OtherHandCards != null)
message.OtherHandCards = String(object.OtherHandCards);
if (object.PlayedCards_0 != null)
message.PlayedCards_0 = String(object.PlayedCards_0);
if (object.PlayedCards_1 != null)
message.PlayedCards_1 = String(object.PlayedCards_1);
if (object.PlayedCards_2 != null)
message.PlayedCards_2 = String(object.PlayedCards_2);
if (object.PlayedCards_3 != null)
message.PlayedCards_3 = String(object.PlayedCards_3);
if (object.PlayerHandCards != null)
message.PlayerHandCards = String(object.PlayerHandCards);
if (object.PlayerPosition != null)
message.PlayerPosition = object.PlayerPosition | 0;
return message;
};
/**
* Creates a plain object from a SCChesstitiansAIData message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {chesstitians.SCChesstitiansAIData} message SCChesstitiansAIData
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansAIData.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults) {
object.BombNum = 0;
object.CardPlayActionSeq = "";
object.LastMove_0 = "";
object.LastMove_1 = "";
object.LastMove_2 = "";
object.LastMove_3 = "";
object.NumCardsLeft_0 = 0;
object.NumCardsLeft_1 = 0;
object.NumCardsLeft_2 = 0;
object.NumCardsLeft_3 = 0;
object.OtherHandCards = "";
object.PlayedCards_0 = "";
object.PlayedCards_1 = "";
object.PlayedCards_2 = "";
object.PlayedCards_3 = "";
object.PlayerHandCards = "";
object.PlayerPosition = 0;
}
if (message.BombNum != null && message.hasOwnProperty("BombNum"))
object.BombNum = message.BombNum;
if (message.CardPlayActionSeq != null && message.hasOwnProperty("CardPlayActionSeq"))
object.CardPlayActionSeq = message.CardPlayActionSeq;
if (message.LastMove_0 != null && message.hasOwnProperty("LastMove_0"))
object.LastMove_0 = message.LastMove_0;
if (message.LastMove_1 != null && message.hasOwnProperty("LastMove_1"))
object.LastMove_1 = message.LastMove_1;
if (message.LastMove_2 != null && message.hasOwnProperty("LastMove_2"))
object.LastMove_2 = message.LastMove_2;
if (message.LastMove_3 != null && message.hasOwnProperty("LastMove_3"))
object.LastMove_3 = message.LastMove_3;
if (message.NumCardsLeft_0 != null && message.hasOwnProperty("NumCardsLeft_0"))
object.NumCardsLeft_0 = message.NumCardsLeft_0;
if (message.NumCardsLeft_1 != null && message.hasOwnProperty("NumCardsLeft_1"))
object.NumCardsLeft_1 = message.NumCardsLeft_1;
if (message.NumCardsLeft_2 != null && message.hasOwnProperty("NumCardsLeft_2"))
object.NumCardsLeft_2 = message.NumCardsLeft_2;
if (message.NumCardsLeft_3 != null && message.hasOwnProperty("NumCardsLeft_3"))
object.NumCardsLeft_3 = message.NumCardsLeft_3;
if (message.OtherHandCards != null && message.hasOwnProperty("OtherHandCards"))
object.OtherHandCards = message.OtherHandCards;
if (message.PlayedCards_0 != null && message.hasOwnProperty("PlayedCards_0"))
object.PlayedCards_0 = message.PlayedCards_0;
if (message.PlayedCards_1 != null && message.hasOwnProperty("PlayedCards_1"))
object.PlayedCards_1 = message.PlayedCards_1;
if (message.PlayedCards_2 != null && message.hasOwnProperty("PlayedCards_2"))
object.PlayedCards_2 = message.PlayedCards_2;
if (message.PlayedCards_3 != null && message.hasOwnProperty("PlayedCards_3"))
object.PlayedCards_3 = message.PlayedCards_3;
if (message.PlayerHandCards != null && message.hasOwnProperty("PlayerHandCards"))
object.PlayerHandCards = message.PlayerHandCards;
if (message.PlayerPosition != null && message.hasOwnProperty("PlayerPosition"))
object.PlayerPosition = message.PlayerPosition;
return object;
};
/**
* Converts this SCChesstitiansAIData to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansAIData
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansAIData.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansAIData
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansAIData
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansAIData.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansAIData";
};
return SCChesstitiansAIData;
})();
chesstitians.SCChesstitiansFirstOpPos = (function() {
/**
* Properties of a SCChesstitiansFirstOpPos.
* @memberof chesstitians
* @interface ISCChesstitiansFirstOpPos
* @property {number|null} [Pos] SCChesstitiansFirstOpPos Pos
*/
/**
* Constructs a new SCChesstitiansFirstOpPos.
* @memberof chesstitians
* @classdesc Represents a SCChesstitiansFirstOpPos.
* @implements ISCChesstitiansFirstOpPos
* @constructor
* @param {chesstitians.ISCChesstitiansFirstOpPos=} [properties] Properties to set
*/
function SCChesstitiansFirstOpPos(properties) {
if (properties)
for (var keys = Object.keys(properties), i = 0; i < keys.length; ++i)
if (properties[keys[i]] != null)
this[keys[i]] = properties[keys[i]];
}
/**
* SCChesstitiansFirstOpPos Pos.
* @member {number} Pos
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @instance
*/
SCChesstitiansFirstOpPos.prototype.Pos = 0;
/**
* Creates a new SCChesstitiansFirstOpPos instance using the specified properties.
* @function create
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {chesstitians.ISCChesstitiansFirstOpPos=} [properties] Properties to set
* @returns {chesstitians.SCChesstitiansFirstOpPos} SCChesstitiansFirstOpPos instance
*/
SCChesstitiansFirstOpPos.create = function create(properties) {
return new SCChesstitiansFirstOpPos(properties);
};
/**
* Encodes the specified SCChesstitiansFirstOpPos message. Does not implicitly {@link chesstitians.SCChesstitiansFirstOpPos.verify|verify} messages.
* @function encode
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {chesstitians.ISCChesstitiansFirstOpPos} message SCChesstitiansFirstOpPos message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansFirstOpPos.encode = function encode(message, writer) {
if (!writer)
writer = $Writer.create();
if (message.Pos != null && Object.hasOwnProperty.call(message, "Pos"))
writer.uint32(/* id 1, wireType 0 =*/8).int32(message.Pos);
return writer;
};
/**
* Encodes the specified SCChesstitiansFirstOpPos message, length delimited. Does not implicitly {@link chesstitians.SCChesstitiansFirstOpPos.verify|verify} messages.
* @function encodeDelimited
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {chesstitians.ISCChesstitiansFirstOpPos} message SCChesstitiansFirstOpPos message or plain object to encode
* @param {$protobuf.Writer} [writer] Writer to encode to
* @returns {$protobuf.Writer} Writer
*/
SCChesstitiansFirstOpPos.encodeDelimited = function encodeDelimited(message, writer) {
return this.encode(message, writer).ldelim();
};
/**
* Decodes a SCChesstitiansFirstOpPos message from the specified reader or buffer.
* @function decode
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @param {number} [length] Message length if known beforehand
* @returns {chesstitians.SCChesstitiansFirstOpPos} SCChesstitiansFirstOpPos
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansFirstOpPos.decode = function decode(reader, length) {
if (!(reader instanceof $Reader))
reader = $Reader.create(reader);
var end = length === undefined ? reader.len : reader.pos + length, message = new $root.chesstitians.SCChesstitiansFirstOpPos();
while (reader.pos < end) {
var tag = reader.uint32();
switch (tag >>> 3) {
case 1: {
message.Pos = reader.int32();
break;
}
default:
reader.skipType(tag & 7);
break;
}
}
return message;
};
/**
* Decodes a SCChesstitiansFirstOpPos message from the specified reader or buffer, length delimited.
* @function decodeDelimited
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {$protobuf.Reader|Uint8Array} reader Reader or buffer to decode from
* @returns {chesstitians.SCChesstitiansFirstOpPos} SCChesstitiansFirstOpPos
* @throws {Error} If the payload is not a reader or valid buffer
* @throws {$protobuf.util.ProtocolError} If required fields are missing
*/
SCChesstitiansFirstOpPos.decodeDelimited = function decodeDelimited(reader) {
if (!(reader instanceof $Reader))
reader = new $Reader(reader);
return this.decode(reader, reader.uint32());
};
/**
* Verifies a SCChesstitiansFirstOpPos message.
* @function verify
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {Object.<string,*>} message Plain object to verify
* @returns {string|null} `null` if valid, otherwise the reason why it is not
*/
SCChesstitiansFirstOpPos.verify = function verify(message) {
if (typeof message !== "object" || message === null)
return "object expected";
if (message.Pos != null && message.hasOwnProperty("Pos"))
if (!$util.isInteger(message.Pos))
return "Pos: integer expected";
return null;
};
/**
* Creates a SCChesstitiansFirstOpPos message from a plain object. Also converts values to their respective internal types.
* @function fromObject
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {Object.<string,*>} object Plain object
* @returns {chesstitians.SCChesstitiansFirstOpPos} SCChesstitiansFirstOpPos
*/
SCChesstitiansFirstOpPos.fromObject = function fromObject(object) {
if (object instanceof $root.chesstitians.SCChesstitiansFirstOpPos)
return object;
var message = new $root.chesstitians.SCChesstitiansFirstOpPos();
if (object.Pos != null)
message.Pos = object.Pos | 0;
return message;
};
/**
* Creates a plain object from a SCChesstitiansFirstOpPos message. Also converts values to other types if specified.
* @function toObject
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {chesstitians.SCChesstitiansFirstOpPos} message SCChesstitiansFirstOpPos
* @param {$protobuf.IConversionOptions} [options] Conversion options
* @returns {Object.<string,*>} Plain object
*/
SCChesstitiansFirstOpPos.toObject = function toObject(message, options) {
if (!options)
options = {};
var object = {};
if (options.defaults)
object.Pos = 0;
if (message.Pos != null && message.hasOwnProperty("Pos"))
object.Pos = message.Pos;
return object;
};
/**
* Converts this SCChesstitiansFirstOpPos to JSON.
* @function toJSON
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @instance
* @returns {Object.<string,*>} JSON object
*/
SCChesstitiansFirstOpPos.prototype.toJSON = function toJSON() {
return this.constructor.toObject(this, $protobuf.util.toJSONOptions);
};
/**
* Gets the default type url for SCChesstitiansFirstOpPos
* @function getTypeUrl
* @memberof chesstitians.SCChesstitiansFirstOpPos
* @static
* @param {string} [typeUrlPrefix] your custom typeUrlPrefix(default "type.googleapis.com")
* @returns {string} The default type url
*/
SCChesstitiansFirstOpPos.getTypeUrl = function getTypeUrl(typeUrlPrefix) {
if (typeUrlPrefix === undefined) {
typeUrlPrefix = "type.googleapis.com";
}
return typeUrlPrefix + "/chesstitians.SCChesstitiansFirstOpPos";
};
return SCChesstitiansFirstOpPos;
})();
return chesstitians;
})();
module.exports = $root;