Commit 619b2226 authored by Chunchi Che's avatar Chunchi Che

update toss.ts

parent 49aa13b5
......@@ -2,5 +2,19 @@ import { ygopro } from "@/api";
import MsgToss = ygopro.StocGameMessage.MsgToss;
export default (toss: MsgToss) => {
console.log(toss);
const tossType = toss.toss_type;
for (const x of toss.res) {
if (tossType == MsgToss.TossType.DICE) {
console.log(`骰子结果:${x}`);
} else if (tossType == MsgToss.TossType.COIN) {
if (x) {
console.log(`硬币正面`);
} else {
console.log(`硬币反面`);
}
} else {
console.log(`Unknown tossType = ${tossType}`);
}
}
};
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