2023-04-23 12:40:54 +09:00
|
|
|
"use strict";
|
2023-06-10 00:06:54 +09:00
|
|
|
const AsyncFunction = async function () {}.constructor;
|
|
|
|
|
2023-04-23 12:40:54 +09:00
|
|
|
function discard(target, card) {
|
|
|
|
console.log("DIS!CAR!D!");
|
|
|
|
postMessage({ type: "game", game: { command: "discard", target: target, card: card } });
|
|
|
|
}
|
|
|
|
|
|
|
|
function selectUser() {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
function selectCard(count, target) {
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
onmessage = e => {
|
|
|
|
console.log(e);
|
|
|
|
switch (e.data.type) {
|
|
|
|
case "run":
|
2023-06-10 00:06:54 +09:00
|
|
|
let fun = new AsyncFunction("target", "players", e.data.function);
|
2023-04-23 12:40:54 +09:00
|
|
|
fun(e.data.target, e.data.players);
|
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|