Commit 2984f1c7 authored by Chunchi Che's avatar Chunchi Che

Merge branch 'feat/select_counter' into 'main'

Feat/select counter

See merge request !158
parents 9511809e b0599432
Pipeline #21019 passed with stages
in 18 minutes and 28 seconds
neos-protobuf @ ff89698e
Subproject commit 76135099fbeb0a69b7f8562bd755975593794e4b Subproject commit ff89698e6fb11829a7170fdf38de646e720bd96d
...@@ -2668,7 +2668,7 @@ export namespace ygopro { ...@@ -2668,7 +2668,7 @@ export namespace ygopro {
} }
} }
export class CtosGameMsgResponse extends pb_1.Message { export class CtosGameMsgResponse extends pb_1.Message {
#one_of_decls: number[][] = [[1, 2, 3, 4, 5, 6, 7, 8, 9]]; #one_of_decls: number[][] = [[1, 2, 3, 4, 5, 6, 7, 8, 9, 10]];
constructor( constructor(
data?: data?:
| any[] | any[]
...@@ -2683,6 +2683,7 @@ export namespace ygopro { ...@@ -2683,6 +2683,7 @@ export namespace ygopro {
select_option?: never; select_option?: never;
select_battle_cmd?: never; select_battle_cmd?: never;
select_unselect_card?: never; select_unselect_card?: never;
select_counter_response?: never;
} }
| { | {
select_idle_cmd?: never; select_idle_cmd?: never;
...@@ -2694,6 +2695,7 @@ export namespace ygopro { ...@@ -2694,6 +2695,7 @@ export namespace ygopro {
select_option?: never; select_option?: never;
select_battle_cmd?: never; select_battle_cmd?: never;
select_unselect_card?: never; select_unselect_card?: never;
select_counter_response?: never;
} }
| { | {
select_idle_cmd?: never; select_idle_cmd?: never;
...@@ -2705,6 +2707,7 @@ export namespace ygopro { ...@@ -2705,6 +2707,7 @@ export namespace ygopro {
select_option?: never; select_option?: never;
select_battle_cmd?: never; select_battle_cmd?: never;
select_unselect_card?: never; select_unselect_card?: never;
select_counter_response?: never;
} }
| { | {
select_idle_cmd?: never; select_idle_cmd?: never;
...@@ -2716,6 +2719,7 @@ export namespace ygopro { ...@@ -2716,6 +2719,7 @@ export namespace ygopro {
select_option?: never; select_option?: never;
select_battle_cmd?: never; select_battle_cmd?: never;
select_unselect_card?: never; select_unselect_card?: never;
select_counter_response?: never;
} }
| { | {
select_idle_cmd?: never; select_idle_cmd?: never;
...@@ -2727,6 +2731,7 @@ export namespace ygopro { ...@@ -2727,6 +2731,7 @@ export namespace ygopro {
select_option?: never; select_option?: never;
select_battle_cmd?: never; select_battle_cmd?: never;
select_unselect_card?: never; select_unselect_card?: never;
select_counter_response?: never;
} }
| { | {
select_idle_cmd?: never; select_idle_cmd?: never;
...@@ -2738,6 +2743,7 @@ export namespace ygopro { ...@@ -2738,6 +2743,7 @@ export namespace ygopro {
select_option?: never; select_option?: never;
select_battle_cmd?: never; select_battle_cmd?: never;
select_unselect_card?: never; select_unselect_card?: never;
select_counter_response?: never;
} }
| { | {
select_idle_cmd?: never; select_idle_cmd?: never;
...@@ -2749,6 +2755,7 @@ export namespace ygopro { ...@@ -2749,6 +2755,7 @@ export namespace ygopro {
select_option?: CtosGameMsgResponse.SelectOptionResponse; select_option?: CtosGameMsgResponse.SelectOptionResponse;
select_battle_cmd?: never; select_battle_cmd?: never;
select_unselect_card?: never; select_unselect_card?: never;
select_counter_response?: never;
} }
| { | {
select_idle_cmd?: never; select_idle_cmd?: never;
...@@ -2760,6 +2767,7 @@ export namespace ygopro { ...@@ -2760,6 +2767,7 @@ export namespace ygopro {
select_option?: never; select_option?: never;
select_battle_cmd?: CtosGameMsgResponse.SelectBattleCmdResponse; select_battle_cmd?: CtosGameMsgResponse.SelectBattleCmdResponse;
select_unselect_card?: never; select_unselect_card?: never;
select_counter_response?: never;
} }
| { | {
select_idle_cmd?: never; select_idle_cmd?: never;
...@@ -2771,6 +2779,19 @@ export namespace ygopro { ...@@ -2771,6 +2779,19 @@ export namespace ygopro {
select_option?: never; select_option?: never;
select_battle_cmd?: never; select_battle_cmd?: never;
select_unselect_card?: CtosGameMsgResponse.SelectUnselectCardResponse; select_unselect_card?: CtosGameMsgResponse.SelectUnselectCardResponse;
select_counter_response?: never;
}
| {
select_idle_cmd?: never;
select_place?: never;
select_card?: never;
select_chain?: never;
select_effect_yn?: never;
select_position?: never;
select_option?: never;
select_battle_cmd?: never;
select_unselect_card?: never;
select_counter_response?: CtosGameMsgResponse.SelectCounterResponse;
} }
)) ))
) { ) {
...@@ -2817,6 +2838,12 @@ export namespace ygopro { ...@@ -2817,6 +2838,12 @@ export namespace ygopro {
) { ) {
this.select_unselect_card = data.select_unselect_card; this.select_unselect_card = data.select_unselect_card;
} }
if (
"select_counter_response" in data &&
data.select_counter_response != undefined
) {
this.select_counter_response = data.select_counter_response;
}
} }
} }
get select_idle_cmd() { get select_idle_cmd() {
...@@ -2938,6 +2965,21 @@ export namespace ygopro { ...@@ -2938,6 +2965,21 @@ export namespace ygopro {
get has_select_unselect_card() { get has_select_unselect_card() {
return pb_1.Message.getField(this, 9) != null; return pb_1.Message.getField(this, 9) != null;
} }
get select_counter_response() {
return pb_1.Message.getWrapperField(
this,
CtosGameMsgResponse.SelectCounterResponse,
10
) as CtosGameMsgResponse.SelectCounterResponse;
}
set select_counter_response(
value: CtosGameMsgResponse.SelectCounterResponse
) {
pb_1.Message.setOneofWrapperField(this, 10, this.#one_of_decls[0], value);
}
get has_select_counter_response() {
return pb_1.Message.getField(this, 10) != null;
}
get gameMsgResponse() { get gameMsgResponse() {
const cases: { const cases: {
[index: number]: [index: number]:
...@@ -2950,7 +2992,8 @@ export namespace ygopro { ...@@ -2950,7 +2992,8 @@ export namespace ygopro {
| "select_position" | "select_position"
| "select_option" | "select_option"
| "select_battle_cmd" | "select_battle_cmd"
| "select_unselect_card"; | "select_unselect_card"
| "select_counter_response";
} = { } = {
0: "none", 0: "none",
1: "select_idle_cmd", 1: "select_idle_cmd",
...@@ -2962,9 +3005,10 @@ export namespace ygopro { ...@@ -2962,9 +3005,10 @@ export namespace ygopro {
7: "select_option", 7: "select_option",
8: "select_battle_cmd", 8: "select_battle_cmd",
9: "select_unselect_card", 9: "select_unselect_card",
10: "select_counter_response",
}; };
return cases[ return cases[
pb_1.Message.computeOneofCase(this, [1, 2, 3, 4, 5, 6, 7, 8, 9]) pb_1.Message.computeOneofCase(this, [1, 2, 3, 4, 5, 6, 7, 8, 9, 10])
]; ];
} }
static fromObject(data: { static fromObject(data: {
...@@ -2995,6 +3039,9 @@ export namespace ygopro { ...@@ -2995,6 +3039,9 @@ export namespace ygopro {
select_unselect_card?: ReturnType< select_unselect_card?: ReturnType<
typeof CtosGameMsgResponse.SelectUnselectCardResponse.prototype.toObject typeof CtosGameMsgResponse.SelectUnselectCardResponse.prototype.toObject
>; >;
select_counter_response?: ReturnType<
typeof CtosGameMsgResponse.SelectCounterResponse.prototype.toObject
>;
}): CtosGameMsgResponse { }): CtosGameMsgResponse {
const message = new CtosGameMsgResponse({}); const message = new CtosGameMsgResponse({});
if (data.select_idle_cmd != null) { if (data.select_idle_cmd != null) {
...@@ -3046,6 +3093,12 @@ export namespace ygopro { ...@@ -3046,6 +3093,12 @@ export namespace ygopro {
data.select_unselect_card data.select_unselect_card
); );
} }
if (data.select_counter_response != null) {
message.select_counter_response =
CtosGameMsgResponse.SelectCounterResponse.fromObject(
data.select_counter_response
);
}
return message; return message;
} }
toObject() { toObject() {
...@@ -3077,6 +3130,9 @@ export namespace ygopro { ...@@ -3077,6 +3130,9 @@ export namespace ygopro {
select_unselect_card?: ReturnType< select_unselect_card?: ReturnType<
typeof CtosGameMsgResponse.SelectUnselectCardResponse.prototype.toObject typeof CtosGameMsgResponse.SelectUnselectCardResponse.prototype.toObject
>; >;
select_counter_response?: ReturnType<
typeof CtosGameMsgResponse.SelectCounterResponse.prototype.toObject
>;
} = {}; } = {};
if (this.select_idle_cmd != null) { if (this.select_idle_cmd != null) {
data.select_idle_cmd = this.select_idle_cmd.toObject(); data.select_idle_cmd = this.select_idle_cmd.toObject();
...@@ -3105,6 +3161,9 @@ export namespace ygopro { ...@@ -3105,6 +3161,9 @@ export namespace ygopro {
if (this.select_unselect_card != null) { if (this.select_unselect_card != null) {
data.select_unselect_card = this.select_unselect_card.toObject(); data.select_unselect_card = this.select_unselect_card.toObject();
} }
if (this.select_counter_response != null) {
data.select_counter_response = this.select_counter_response.toObject();
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
...@@ -3147,6 +3206,10 @@ export namespace ygopro { ...@@ -3147,6 +3206,10 @@ export namespace ygopro {
writer.writeMessage(9, this.select_unselect_card, () => writer.writeMessage(9, this.select_unselect_card, () =>
this.select_unselect_card.serialize(writer) this.select_unselect_card.serialize(writer)
); );
if (this.has_select_counter_response)
writer.writeMessage(10, this.select_counter_response, () =>
this.select_counter_response.serialize(writer)
);
if (!w) return writer.getResultBuffer(); if (!w) return writer.getResultBuffer();
} }
static deserialize( static deserialize(
...@@ -3240,6 +3303,14 @@ export namespace ygopro { ...@@ -3240,6 +3303,14 @@ export namespace ygopro {
)) ))
); );
break; break;
case 10:
reader.readMessage(
message.select_counter_response,
() =>
(message.select_counter_response =
CtosGameMsgResponse.SelectCounterResponse.deserialize(reader))
);
break;
default: default:
reader.skipField(); reader.skipField();
} }
...@@ -4064,6 +4135,89 @@ export namespace ygopro { ...@@ -4064,6 +4135,89 @@ export namespace ygopro {
return SelectUnselectCardResponse.deserialize(bytes); return SelectUnselectCardResponse.deserialize(bytes);
} }
} }
export class SelectCounterResponse extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(
data?:
| any[]
| {
selected_count?: number[];
}
) {
super();
pb_1.Message.initialize(
this,
Array.isArray(data) ? data : [],
0,
-1,
[1],
this.#one_of_decls
);
if (!Array.isArray(data) && typeof data == "object") {
if ("selected_count" in data && data.selected_count != undefined) {
this.selected_count = data.selected_count;
}
}
}
get selected_count() {
return pb_1.Message.getFieldWithDefault(this, 1, []) as number[];
}
set selected_count(value: number[]) {
pb_1.Message.setField(this, 1, value);
}
static fromObject(data: {
selected_count?: number[];
}): SelectCounterResponse {
const message = new SelectCounterResponse({});
if (data.selected_count != null) {
message.selected_count = data.selected_count;
}
return message;
}
toObject() {
const data: {
selected_count?: number[];
} = {};
if (this.selected_count != null) {
data.selected_count = this.selected_count;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.selected_count.length)
writer.writePackedInt32(1, this.selected_count);
if (!w) return writer.getResultBuffer();
}
static deserialize(
bytes: Uint8Array | pb_1.BinaryReader
): SelectCounterResponse {
const reader =
bytes instanceof pb_1.BinaryReader
? bytes
: new pb_1.BinaryReader(bytes),
message = new SelectCounterResponse();
while (reader.nextField()) {
if (reader.isEndGroup()) break;
switch (reader.getFieldNumber()) {
case 1:
message.selected_count = reader.readPackedInt32();
break;
default:
reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): SelectCounterResponse {
return SelectCounterResponse.deserialize(bytes);
}
}
} }
export class StocJoinGame extends pb_1.Message { export class StocJoinGame extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
...@@ -5446,7 +5600,7 @@ export namespace ygopro { ...@@ -5446,7 +5600,7 @@ export namespace ygopro {
#one_of_decls: number[][] = [ #one_of_decls: number[][] = [
[ [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 21, 22, 23, 24, 25, 26, 27, 28,
], ],
]; ];
constructor( constructor(
...@@ -5481,6 +5635,7 @@ export namespace ygopro { ...@@ -5481,6 +5635,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5510,6 +5665,7 @@ export namespace ygopro { ...@@ -5510,6 +5665,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5539,6 +5695,7 @@ export namespace ygopro { ...@@ -5539,6 +5695,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5568,6 +5725,7 @@ export namespace ygopro { ...@@ -5568,6 +5725,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5597,6 +5755,7 @@ export namespace ygopro { ...@@ -5597,6 +5755,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5626,6 +5785,7 @@ export namespace ygopro { ...@@ -5626,6 +5785,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5655,6 +5815,7 @@ export namespace ygopro { ...@@ -5655,6 +5815,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5684,6 +5845,7 @@ export namespace ygopro { ...@@ -5684,6 +5845,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5713,6 +5875,7 @@ export namespace ygopro { ...@@ -5713,6 +5875,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5742,6 +5905,7 @@ export namespace ygopro { ...@@ -5742,6 +5905,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5771,6 +5935,7 @@ export namespace ygopro { ...@@ -5771,6 +5935,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5800,6 +5965,7 @@ export namespace ygopro { ...@@ -5800,6 +5965,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5829,6 +5995,7 @@ export namespace ygopro { ...@@ -5829,6 +5995,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5858,6 +6025,7 @@ export namespace ygopro { ...@@ -5858,6 +6025,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5887,6 +6055,7 @@ export namespace ygopro { ...@@ -5887,6 +6055,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5916,6 +6085,7 @@ export namespace ygopro { ...@@ -5916,6 +6085,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5945,6 +6115,7 @@ export namespace ygopro { ...@@ -5945,6 +6115,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -5974,6 +6145,7 @@ export namespace ygopro { ...@@ -5974,6 +6145,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6003,6 +6175,7 @@ export namespace ygopro { ...@@ -6003,6 +6175,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6032,6 +6205,7 @@ export namespace ygopro { ...@@ -6032,6 +6205,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6061,6 +6235,7 @@ export namespace ygopro { ...@@ -6061,6 +6235,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6090,6 +6265,7 @@ export namespace ygopro { ...@@ -6090,6 +6265,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6119,6 +6295,7 @@ export namespace ygopro { ...@@ -6119,6 +6295,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6148,6 +6325,7 @@ export namespace ygopro { ...@@ -6148,6 +6325,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6177,6 +6355,7 @@ export namespace ygopro { ...@@ -6177,6 +6355,7 @@ export namespace ygopro {
select_sum?: StocGameMessage.MsgSelectSum; select_sum?: StocGameMessage.MsgSelectSum;
select_tribute?: never; select_tribute?: never;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6206,6 +6385,7 @@ export namespace ygopro { ...@@ -6206,6 +6385,7 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: StocGameMessage.MsgSelectTribute; select_tribute?: StocGameMessage.MsgSelectTribute;
update_counter?: never; update_counter?: never;
select_counter?: never;
} }
| { | {
start?: never; start?: never;
...@@ -6235,6 +6415,37 @@ export namespace ygopro { ...@@ -6235,6 +6415,37 @@ export namespace ygopro {
select_sum?: never; select_sum?: never;
select_tribute?: never; select_tribute?: never;
update_counter?: StocGameMessage.MsgUpdateCounter; update_counter?: StocGameMessage.MsgUpdateCounter;
select_counter?: never;
}
| {
start?: never;
draw?: never;
new_turn?: never;
new_phase?: never;
hint?: never;
select_idle_cmd?: never;
select_place?: never;
move?: never;
select_card?: never;
select_chain?: never;
select_effect_yn?: never;
select_position?: never;
select_option?: never;
shuffle_hand?: never;
select_battle_cmd?: never;
pos_change?: never;
select_unselect_card?: never;
select_yes_no?: never;
update_hp?: never;
win?: never;
wait?: never;
unimplemented?: never;
update_data?: never;
reload_field?: never;
select_sum?: never;
select_tribute?: never;
update_counter?: never;
select_counter?: StocGameMessage.MsgSelectCounter;
} }
)) ))
) { ) {
...@@ -6335,6 +6546,9 @@ export namespace ygopro { ...@@ -6335,6 +6546,9 @@ export namespace ygopro {
if ("update_counter" in data && data.update_counter != undefined) { if ("update_counter" in data && data.update_counter != undefined) {
this.update_counter = data.update_counter; this.update_counter = data.update_counter;
} }
if ("select_counter" in data && data.select_counter != undefined) {
this.select_counter = data.select_counter;
}
} }
} }
get start() { get start() {
...@@ -6688,6 +6902,19 @@ export namespace ygopro { ...@@ -6688,6 +6902,19 @@ export namespace ygopro {
get has_update_counter() { get has_update_counter() {
return pb_1.Message.getField(this, 27) != null; return pb_1.Message.getField(this, 27) != null;
} }
get select_counter() {
return pb_1.Message.getWrapperField(
this,
StocGameMessage.MsgSelectCounter,
28
) as StocGameMessage.MsgSelectCounter;
}
set select_counter(value: StocGameMessage.MsgSelectCounter) {
pb_1.Message.setOneofWrapperField(this, 28, this.#one_of_decls[0], value);
}
get has_select_counter() {
return pb_1.Message.getField(this, 28) != null;
}
get gameMsg() { get gameMsg() {
const cases: { const cases: {
[index: number]: [index: number]:
...@@ -6718,7 +6945,8 @@ export namespace ygopro { ...@@ -6718,7 +6945,8 @@ export namespace ygopro {
| "reload_field" | "reload_field"
| "select_sum" | "select_sum"
| "select_tribute" | "select_tribute"
| "update_counter"; | "update_counter"
| "select_counter";
} = { } = {
0: "none", 0: "none",
1: "start", 1: "start",
...@@ -6748,13 +6976,14 @@ export namespace ygopro { ...@@ -6748,13 +6976,14 @@ export namespace ygopro {
25: "select_sum", 25: "select_sum",
26: "select_tribute", 26: "select_tribute",
27: "update_counter", 27: "update_counter",
28: "select_counter",
}; };
return cases[ return cases[
pb_1.Message.computeOneofCase( pb_1.Message.computeOneofCase(
this, this,
[ [
1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19,
20, 21, 22, 23, 24, 25, 26, 27, 20, 21, 22, 23, 24, 25, 26, 27, 28,
] ]
) )
]; ];
...@@ -6829,6 +7058,9 @@ export namespace ygopro { ...@@ -6829,6 +7058,9 @@ export namespace ygopro {
update_counter?: ReturnType< update_counter?: ReturnType<
typeof StocGameMessage.MsgUpdateCounter.prototype.toObject typeof StocGameMessage.MsgUpdateCounter.prototype.toObject
>; >;
select_counter?: ReturnType<
typeof StocGameMessage.MsgSelectCounter.prototype.toObject
>;
}): StocGameMessage { }): StocGameMessage {
const message = new StocGameMessage({}); const message = new StocGameMessage({});
if (data.start != null) { if (data.start != null) {
...@@ -6952,6 +7184,11 @@ export namespace ygopro { ...@@ -6952,6 +7184,11 @@ export namespace ygopro {
data.update_counter data.update_counter
); );
} }
if (data.select_counter != null) {
message.select_counter = StocGameMessage.MsgSelectCounter.fromObject(
data.select_counter
);
}
return message; return message;
} }
toObject() { toObject() {
...@@ -7025,6 +7262,9 @@ export namespace ygopro { ...@@ -7025,6 +7262,9 @@ export namespace ygopro {
update_counter?: ReturnType< update_counter?: ReturnType<
typeof StocGameMessage.MsgUpdateCounter.prototype.toObject typeof StocGameMessage.MsgUpdateCounter.prototype.toObject
>; >;
select_counter?: ReturnType<
typeof StocGameMessage.MsgSelectCounter.prototype.toObject
>;
} = {}; } = {};
if (this.start != null) { if (this.start != null) {
data.start = this.start.toObject(); data.start = this.start.toObject();
...@@ -7107,6 +7347,9 @@ export namespace ygopro { ...@@ -7107,6 +7347,9 @@ export namespace ygopro {
if (this.update_counter != null) { if (this.update_counter != null) {
data.update_counter = this.update_counter.toObject(); data.update_counter = this.update_counter.toObject();
} }
if (this.select_counter != null) {
data.select_counter = this.select_counter.toObject();
}
return data; return data;
} }
serialize(): Uint8Array; serialize(): Uint8Array;
...@@ -7209,6 +7452,10 @@ export namespace ygopro { ...@@ -7209,6 +7452,10 @@ export namespace ygopro {
writer.writeMessage(27, this.update_counter, () => writer.writeMessage(27, this.update_counter, () =>
this.update_counter.serialize(writer) this.update_counter.serialize(writer)
); );
if (this.has_select_counter)
writer.writeMessage(28, this.select_counter, () =>
this.select_counter.serialize(writer)
);
if (!w) return writer.getResultBuffer(); if (!w) return writer.getResultBuffer();
} }
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StocGameMessage { static deserialize(bytes: Uint8Array | pb_1.BinaryReader): StocGameMessage {
...@@ -7425,6 +7672,14 @@ export namespace ygopro { ...@@ -7425,6 +7672,14 @@ export namespace ygopro {
StocGameMessage.MsgUpdateCounter.deserialize(reader)) StocGameMessage.MsgUpdateCounter.deserialize(reader))
); );
break; break;
case 28:
reader.readMessage(
message.select_counter,
() =>
(message.select_counter =
StocGameMessage.MsgSelectCounter.deserialize(reader))
);
break;
default: default:
reader.skipField(); reader.skipField();
} }
...@@ -13887,6 +14142,318 @@ export namespace ygopro { ...@@ -13887,6 +14142,318 @@ export namespace ygopro {
REMOVE = 2, REMOVE = 2,
} }
} }
export class MsgSelectCounter extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(
data?:
| any[]
| {
player?: number;
counter_type?: number;
min?: number;
options?: StocGameMessage.MsgSelectCounter.Info[];
}
) {
super();
pb_1.Message.initialize(
this,
Array.isArray(data) ? data : [],
0,
-1,
[4],
this.#one_of_decls
);
if (!Array.isArray(data) && typeof data == "object") {
if ("player" in data && data.player != undefined) {
this.player = data.player;
}
if ("counter_type" in data && data.counter_type != undefined) {
this.counter_type = data.counter_type;
}
if ("min" in data && data.min != undefined) {
this.min = data.min;
}
if ("options" in data && data.options != undefined) {
this.options = data.options;
}
}
}
get player() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set player(value: number) {
pb_1.Message.setField(this, 1, value);
}
get counter_type() {
return pb_1.Message.getFieldWithDefault(this, 2, 0) as number;
}
set counter_type(value: number) {
pb_1.Message.setField(this, 2, value);
}
get min() {
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set min(value: number) {
pb_1.Message.setField(this, 3, value);
}
get options() {
return pb_1.Message.getRepeatedWrapperField(
this,
StocGameMessage.MsgSelectCounter.Info,
4
) as StocGameMessage.MsgSelectCounter.Info[];
}
set options(value: StocGameMessage.MsgSelectCounter.Info[]) {
pb_1.Message.setRepeatedWrapperField(this, 4, value);
}
static fromObject(data: {
player?: number;
counter_type?: number;
min?: number;
options?: ReturnType<
typeof StocGameMessage.MsgSelectCounter.Info.prototype.toObject
>[];
}): MsgSelectCounter {
const message = new MsgSelectCounter({});
if (data.player != null) {
message.player = data.player;
}
if (data.counter_type != null) {
message.counter_type = data.counter_type;
}
if (data.min != null) {
message.min = data.min;
}
if (data.options != null) {
message.options = data.options.map((item) =>
StocGameMessage.MsgSelectCounter.Info.fromObject(item)
);
}
return message;
}
toObject() {
const data: {
player?: number;
counter_type?: number;
min?: number;
options?: ReturnType<
typeof StocGameMessage.MsgSelectCounter.Info.prototype.toObject
>[];
} = {};
if (this.player != null) {
data.player = this.player;
}
if (this.counter_type != null) {
data.counter_type = this.counter_type;
}
if (this.min != null) {
data.min = this.min;
}
if (this.options != null) {
data.options = this.options.map(
(item: StocGameMessage.MsgSelectCounter.Info) => item.toObject()
);
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.player != 0) writer.writeInt32(1, this.player);
if (this.counter_type != 0) writer.writeInt32(2, this.counter_type);
if (this.min != 0) writer.writeInt32(3, this.min);
if (this.options.length)
writer.writeRepeatedMessage(
4,
this.options,
(item: StocGameMessage.MsgSelectCounter.Info) =>
item.serialize(writer)
);
if (!w) return writer.getResultBuffer();
}
static deserialize(
bytes: Uint8Array | pb_1.BinaryReader
): MsgSelectCounter {
const reader =
bytes instanceof pb_1.BinaryReader
? bytes
: new pb_1.BinaryReader(bytes),
message = new MsgSelectCounter();
while (reader.nextField()) {
if (reader.isEndGroup()) break;
switch (reader.getFieldNumber()) {
case 1:
message.player = reader.readInt32();
break;
case 2:
message.counter_type = reader.readInt32();
break;
case 3:
message.min = reader.readInt32();
break;
case 4:
reader.readMessage(message.options, () =>
pb_1.Message.addToRepeatedWrapperField(
message,
4,
StocGameMessage.MsgSelectCounter.Info.deserialize(reader),
StocGameMessage.MsgSelectCounter.Info
)
);
break;
default:
reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): MsgSelectCounter {
return MsgSelectCounter.deserialize(bytes);
}
}
export namespace MsgSelectCounter {
export class Info extends pb_1.Message {
#one_of_decls: number[][] = [];
constructor(
data?:
| any[]
| {
code?: number;
location?: CardLocation;
counter_count?: number;
}
) {
super();
pb_1.Message.initialize(
this,
Array.isArray(data) ? data : [],
0,
-1,
[],
this.#one_of_decls
);
if (!Array.isArray(data) && typeof data == "object") {
if ("code" in data && data.code != undefined) {
this.code = data.code;
}
if ("location" in data && data.location != undefined) {
this.location = data.location;
}
if ("counter_count" in data && data.counter_count != undefined) {
this.counter_count = data.counter_count;
}
}
}
get code() {
return pb_1.Message.getFieldWithDefault(this, 1, 0) as number;
}
set code(value: number) {
pb_1.Message.setField(this, 1, value);
}
get location() {
return pb_1.Message.getWrapperField(
this,
CardLocation,
2
) as CardLocation;
}
set location(value: CardLocation) {
pb_1.Message.setWrapperField(this, 2, value);
}
get has_location() {
return pb_1.Message.getField(this, 2) != null;
}
get counter_count() {
return pb_1.Message.getFieldWithDefault(this, 3, 0) as number;
}
set counter_count(value: number) {
pb_1.Message.setField(this, 3, value);
}
static fromObject(data: {
code?: number;
location?: ReturnType<typeof CardLocation.prototype.toObject>;
counter_count?: number;
}): Info {
const message = new Info({});
if (data.code != null) {
message.code = data.code;
}
if (data.location != null) {
message.location = CardLocation.fromObject(data.location);
}
if (data.counter_count != null) {
message.counter_count = data.counter_count;
}
return message;
}
toObject() {
const data: {
code?: number;
location?: ReturnType<typeof CardLocation.prototype.toObject>;
counter_count?: number;
} = {};
if (this.code != null) {
data.code = this.code;
}
if (this.location != null) {
data.location = this.location.toObject();
}
if (this.counter_count != null) {
data.counter_count = this.counter_count;
}
return data;
}
serialize(): Uint8Array;
serialize(w: pb_1.BinaryWriter): void;
serialize(w?: pb_1.BinaryWriter): Uint8Array | void {
const writer = w || new pb_1.BinaryWriter();
if (this.code != 0) writer.writeInt32(1, this.code);
if (this.has_location)
writer.writeMessage(2, this.location, () =>
this.location.serialize(writer)
);
if (this.counter_count != 0) writer.writeInt32(3, this.counter_count);
if (!w) return writer.getResultBuffer();
}
static deserialize(bytes: Uint8Array | pb_1.BinaryReader): Info {
const reader =
bytes instanceof pb_1.BinaryReader
? bytes
: new pb_1.BinaryReader(bytes),
message = new Info();
while (reader.nextField()) {
if (reader.isEndGroup()) break;
switch (reader.getFieldNumber()) {
case 1:
message.code = reader.readInt32();
break;
case 2:
reader.readMessage(
message.location,
() => (message.location = CardLocation.deserialize(reader))
);
break;
case 3:
message.counter_count = reader.readInt32();
break;
default:
reader.skipField();
}
}
return message;
}
serializeBinary(): Uint8Array {
return this.serialize();
}
static deserializeBinary(bytes: Uint8Array): Info {
return Info.deserialize(bytes);
}
}
}
export class MsgReloadField extends pb_1.Message { export class MsgReloadField extends pb_1.Message {
#one_of_decls: number[][] = []; #one_of_decls: number[][] = [];
constructor( constructor(
......
...@@ -54,3 +54,4 @@ export const MSG_RELOAD_FIELD = 162; ...@@ -54,3 +54,4 @@ export const MSG_RELOAD_FIELD = 162;
export const MSG_SELECT_SUM = 23; export const MSG_SELECT_SUM = 23;
export const MSG_ADD_COUNTER = 101; export const MSG_ADD_COUNTER = 101;
export const MSG_REMOVE_COUNTER = 102; export const MSG_REMOVE_COUNTER = 102;
export const MSG_SELECT_COUNTER = 22;
...@@ -30,6 +30,7 @@ import MsgReloadFieldAdapter from "./reloadField"; ...@@ -30,6 +30,7 @@ import MsgReloadFieldAdapter from "./reloadField";
import MsgSelectSum from "./selectSum"; import MsgSelectSum from "./selectSum";
import MsgAddCounter from "./addCounter"; import MsgAddCounter from "./addCounter";
import MsgRemoveCounter from "./removeCounter"; import MsgRemoveCounter from "./removeCounter";
import MsgSelectCounter from "./selectCounter";
import PENETRATE from "./penetrate"; import PENETRATE from "./penetrate";
/* /*
...@@ -178,6 +179,11 @@ export default class GameMsgAdapter implements StocAdapter { ...@@ -178,6 +179,11 @@ export default class GameMsgAdapter implements StocAdapter {
break; break;
} }
case GAME_MSG.MSG_SELECT_COUNTER: {
gameMsg.select_counter = MsgSelectCounter(gameData);
break;
}
default: { default: {
gameMsg.unimplemented = new ygopro.StocGameMessage.MsgUnimplemented({ gameMsg.unimplemented = new ygopro.StocGameMessage.MsgUnimplemented({
command: func, command: func,
......
import { ygopro } from "../../../idl/ocgcore";
import { BufferReaderExt } from "../../bufferIO";
import MsgSelectCounter = ygopro.StocGameMessage.MsgSelectCounter;
/*
* Msg Select Counter
*
* @param - TODO
* @usage - TODO
**/
export default (data: Uint8Array) => {
const reader = new BufferReaderExt(data);
const player = reader.inner.readUint8();
const counterType = reader.inner.readUint16();
const min = reader.inner.readUint16();
const msg = new MsgSelectCounter({
player,
counter_type: counterType,
min,
options: [],
});
const count = reader.inner.readUint8();
for (let i = 0; i < count; i++) {
const code = reader.inner.readUint32();
const location = reader.readCardShortLocation();
const counterCount = reader.inner.readUint16();
msg.options.push(
new MsgSelectCounter.Info({
code,
location,
counter_count: counterCount,
})
);
}
return msg;
};
...@@ -27,6 +27,7 @@ import onMsgReloadField from "./reloadField"; ...@@ -27,6 +27,7 @@ import onMsgReloadField from "./reloadField";
import onMsgSelectSum from "./selectSum"; import onMsgSelectSum from "./selectSum";
import onMsgSelectTribute from "./selectTribute"; import onMsgSelectTribute from "./selectTribute";
import onMsgUpdateCounter from "./updateCounter"; import onMsgUpdateCounter from "./updateCounter";
import onMsgSelectCounter from "./selectCounter";
import { setWaiting } from "../../reducers/duel/mod"; import { setWaiting } from "../../reducers/duel/mod";
const ActiveList = [ const ActiveList = [
...@@ -181,6 +182,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) { ...@@ -181,6 +182,11 @@ export default function handleGameMsg(pb: ygopro.YgoStocMsg) {
break; break;
} }
case "select_counter": {
onMsgSelectCounter(msg.select_counter, dispatch);
break;
}
case "unimplemented": { case "unimplemented": {
onUnimplemented(msg.unimplemented, dispatch); onUnimplemented(msg.unimplemented, dispatch);
......
import { ygopro } from "../../api/ocgcore/idl/ocgcore";
import { AppDispatch } from "../../store";
import MsgSelectCounter = ygopro.StocGameMessage.MsgSelectCounter;
export default (selectCounter: MsgSelectCounter, dispatch: AppDispatch) => {
console.log(selectCounter);
};
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