Commit f35bc744 authored by chechunchi's avatar chechunchi

sync neos-protobuf

parent b68b030e
neos-protobuf @ 2caaa3aa
Subproject commit 68a20f07e1f2185f68cbf9c83cc61db591498c2d Subproject commit 2caaa3aa310f699ebf5b52a08413d0a555ac4065
...@@ -10766,9 +10766,10 @@ export namespace ygopro { ...@@ -10766,9 +10766,10 @@ export namespace ygopro {
constructor(data?: any[] | { constructor(data?: any[] | {
zone?: CardZone; zone?: CardZone;
from_locations?: CardLocation[]; from_locations?: CardLocation[];
overlay_locations?: CardLocation[];
}) { }) {
super(); super();
pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2], this.#one_of_decls); pb_1.Message.initialize(this, Array.isArray(data) ? data : [], 0, -1, [2, 3], this.#one_of_decls);
if (!Array.isArray(data) && typeof data == "object") { if (!Array.isArray(data) && typeof data == "object") {
if ("zone" in data && data.zone != undefined) { if ("zone" in data && data.zone != undefined) {
this.zone = data.zone; this.zone = data.zone;
...@@ -10776,6 +10777,9 @@ export namespace ygopro { ...@@ -10776,6 +10777,9 @@ export namespace ygopro {
if ("from_locations" in data && data.from_locations != undefined) { if ("from_locations" in data && data.from_locations != undefined) {
this.from_locations = data.from_locations; this.from_locations = data.from_locations;
} }
if ("overlay_locations" in data && data.overlay_locations != undefined) {
this.overlay_locations = data.overlay_locations;
}
} }
} }
get zone() { get zone() {
...@@ -10790,9 +10794,16 @@ export namespace ygopro { ...@@ -10790,9 +10794,16 @@ export namespace ygopro {
set from_locations(value: CardLocation[]) { set from_locations(value: CardLocation[]) {
pb_1.Message.setRepeatedWrapperField(this, 2, value); pb_1.Message.setRepeatedWrapperField(this, 2, value);
} }
get overlay_locations() {
return pb_1.Message.getRepeatedWrapperField(this, CardLocation, 3) as CardLocation[];
}
set overlay_locations(value: CardLocation[]) {
pb_1.Message.setRepeatedWrapperField(this, 3, value);
}
static fromObject(data: { static fromObject(data: {
zone?: CardZone; zone?: CardZone;
from_locations?: ReturnType<typeof CardLocation.prototype.toObject>[]; from_locations?: ReturnType<typeof CardLocation.prototype.toObject>[];
overlay_locations?: ReturnType<typeof CardLocation.prototype.toObject>[];
}): MsgShuffleSetCard { }): MsgShuffleSetCard {
const message = new MsgShuffleSetCard({}); const message = new MsgShuffleSetCard({});
if (data.zone != null) { if (data.zone != null) {
...@@ -10801,12 +10812,16 @@ export namespace ygopro { ...@@ -10801,12 +10812,16 @@ export namespace ygopro {
if (data.from_locations != null) { if (data.from_locations != null) {
message.from_locations = data.from_locations.map(item => CardLocation.fromObject(item)); message.from_locations = data.from_locations.map(item => CardLocation.fromObject(item));
} }
if (data.overlay_locations != null) {
message.overlay_locations = data.overlay_locations.map(item => CardLocation.fromObject(item));
}
return message; return message;
} }
toObject() { toObject() {
const data: { const data: {
zone?: CardZone; zone?: CardZone;
from_locations?: ReturnType<typeof CardLocation.prototype.toObject>[]; from_locations?: ReturnType<typeof CardLocation.prototype.toObject>[];
overlay_locations?: ReturnType<typeof CardLocation.prototype.toObject>[];
} = {}; } = {};
if (this.zone != null) { if (this.zone != null) {
data.zone = this.zone; data.zone = this.zone;
...@@ -10814,6 +10829,9 @@ export namespace ygopro { ...@@ -10814,6 +10829,9 @@ export namespace ygopro {
if (this.from_locations != null) { if (this.from_locations != null) {
data.from_locations = this.from_locations.map((item: CardLocation) => item.toObject()); data.from_locations = this.from_locations.map((item: CardLocation) => item.toObject());
} }
if (this.overlay_locations != null) {
data.overlay_locations = this.overlay_locations.map((item: CardLocation) => item.toObject());
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
...@@ -10824,6 +10842,8 @@ export namespace ygopro { ...@@ -10824,6 +10842,8 @@ export namespace ygopro {
writer.writeEnum(1, this.zone); writer.writeEnum(1, this.zone);
if (this.from_locations.length) if (this.from_locations.length)
writer.writeRepeatedMessage(2, this.from_locations, (item: CardLocation) => item.serialize(writer)); writer.writeRepeatedMessage(2, this.from_locations, (item: CardLocation) => item.serialize(writer));
if (this.overlay_locations.length)
writer.writeRepeatedMessage(3, this.overlay_locations, (item: CardLocation) => item.serialize(writer));
if (!w) if (!w)
return writer.getResultBuffer(); return writer.getResultBuffer();
} }
...@@ -10839,6 +10859,9 @@ export namespace ygopro { ...@@ -10839,6 +10859,9 @@ export namespace ygopro {
case 2: case 2:
reader.readMessage(message.from_locations, () => pb_1.Message.addToRepeatedWrapperField(message, 2, CardLocation.deserialize(reader), CardLocation)); reader.readMessage(message.from_locations, () => pb_1.Message.addToRepeatedWrapperField(message, 2, CardLocation.deserialize(reader), CardLocation));
break; break;
case 3:
reader.readMessage(message.overlay_locations, () => pb_1.Message.addToRepeatedWrapperField(message, 3, CardLocation.deserialize(reader), CardLocation));
break;
default: reader.skipField(); default: reader.skipField();
} }
} }
......
...@@ -16,16 +16,17 @@ export default (data: Uint8Array) => { ...@@ -16,16 +16,17 @@ export default (data: Uint8Array) => {
const zone = numberToCardZone(reader.inner.readUint8()); const zone = numberToCardZone(reader.inner.readUint8());
const count = reader.inner.readUint8(); const count = reader.inner.readUint8();
const from_locations = []; const from_locations = [];
const _overlay_locations = []; // TODO: 这个字段是否有用? const overlay_locations = []; // TODO: 这个字段是否有用?
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {
from_locations.push(reader.readCardLocation()); from_locations.push(reader.readCardLocation());
} }
for (let i = 0; i < count; i++) { for (let i = 0; i < count; i++) {
_overlay_locations.push(reader.readCardLocation()); overlay_locations.push(reader.readCardLocation());
} }
return new MsgShuffleSetCard({ return new MsgShuffleSetCard({
zone, zone,
from_locations, from_locations,
overlay_locations
}); });
}; };
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment