ExtinctionOnline/static/js/card-module.js
noyciy7037 8136e91a0f
Some checks failed
Extinction Online CI / build (false, 6.0.x, linux-x64) (push) Failing after 3s
Extinction Online CI / build (false, 6.0.x, osx-x64) (push) Failing after 0s
Extinction Online CI / build (false, 6.0.x, win-x64) (push) Failing after 1s
Extinction Online CI / build (true, 6.0.x, linux-x64) (push) Failing after 1s
Extinction Online CI / build (true, 6.0.x, osx-x64) (push) Failing after 1s
Extinction Online CI / build (true, 6.0.x, win-x64) (push) Failing after 1s
add some communication functions
2023-06-10 00:06:54 +09:00

25 lines
539 B
JavaScript

"use strict";
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":
let fun = new AsyncFunction("target", "players", e.data.function);
fun(e.data.target, e.data.players);
break;
}
}