Commit fed01778 authored by Chunchi Che's avatar Chunchi Che

fix posChange

parent 80533877
import { ygopro } from "@/api";
import MsgPosChange = ygopro.StocGameMessage.MsgPosChange;
import { cardStore, fetchEsHintMeta, matStore } from "@/stores";
import { cardStore, fetchEsHintMeta } from "@/stores";
export default (posChange: MsgPosChange) => {
const { location, controler, sequence } = posChange.card_info;
cardStore.at(location, controler, sequence).position = posChange.cur_position;
switch (location) {
case ygopro.CardZone.MZONE: {
matStore.monsters.of(controler)[sequence].location.position =
posChange.cur_position;
break;
}
case ygopro.CardZone.SZONE: {
matStore.magics.of(controler)[sequence].location.position =
posChange.cur_position;
break;
}
default: {
console.log(`Unhandled zone ${location}`);
}
const target = cardStore.at(location, controler, sequence);
if (target) {
target.position = posChange.cur_position;
} else {
console.warn(`<PosChange>target from ${posChange.card_info} is null`);
}
fetchEsHintMeta({
originMsg: 1600,
});
......
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