ExtinctionOnline/static/js/card-module.js

25 lines
539 B
JavaScript
Raw Normal View History

"use strict";
2023-06-10 00:06:54 +09:00
const AsyncFunction = async function () {}.constructor;
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);
fun(e.data.target, e.data.players);
break;
}
}