Commit bb640b14 authored by Chunchi Che's avatar Chunchi Che

disable unused code

parent b7d038b3
...@@ -18,12 +18,17 @@ ...@@ -18,12 +18,17 @@
"interface" "interface"
], ],
"simple-import-sort/imports": "warn", "simple-import-sort/imports": "warn",
"simple-import-sort/exports": "warn" "simple-import-sort/exports": "warn",
"no-unused-vars": "off",
"@typescript-eslint/no-unused-vars": [
"error", { "argsIgnorePattern": "^_", "varsIgnorePattern": "^_" }
]
}, },
"settings": { "settings": {
"import/resolver": { "import/resolver": {
"node": true, "node": true,
"typescript": true "typescript": true
} }
} },
"ignorePatterns": ["src/api/ocgcore/idl/ocgcore.ts"]
} }
...@@ -26,7 +26,7 @@ export default (data: Uint8Array) => { ...@@ -26,7 +26,7 @@ export default (data: Uint8Array) => {
let offset = 1; let offset = 1;
if (dataView.byteLength > 17) { if (dataView.byteLength > 17) {
// data长度大于17,会多传一个大师规则字段 // data长度大于17,会多传一个大师规则字段
const masterRule = dataView.getUint8(offset); // TODO const _masterRule = dataView.getUint8(offset); // TODO
offset += 1; offset += 1;
} }
......
...@@ -12,6 +12,7 @@ interface ImportMeta { ...@@ -12,6 +12,7 @@ interface ImportMeta {
readonly env: ImportMetaEnv; readonly env: ImportMetaEnv;
} }
/* eslint @typescript-eslint/no-unused-vars: 0 */
import { EventEmitter } from "eventemitter3"; import { EventEmitter } from "eventemitter3";
/* eslint no-var: 0 */ /* eslint no-var: 0 */
......
import { ygopro } from "@/api"; import { ygopro } from "@/api";
type MsgReloadField = ygopro.StocGameMessage.MsgReloadField; type MsgReloadField = ygopro.StocGameMessage.MsgReloadField;
export default (field: MsgReloadField) => { export default (_field: MsgReloadField) => {
// TODO: 断线重连比较复杂,先留着后面时实现 // TODO: 断线重连比较复杂,先留着后面时实现
}; };
...@@ -12,8 +12,8 @@ type MsgSelectChain = ygopro.StocGameMessage.MsgSelectChain; ...@@ -12,8 +12,8 @@ type MsgSelectChain = ygopro.StocGameMessage.MsgSelectChain;
export default (selectChain: MsgSelectChain) => { export default (selectChain: MsgSelectChain) => {
const spCount = selectChain.special_count; const spCount = selectChain.special_count;
const forced = selectChain.forced; const forced = selectChain.forced;
const hint0 = selectChain.hint0; const _hint0 = selectChain.hint0;
const hint1 = selectChain.hint1; const _hint1 = selectChain.hint1;
const chains = selectChain.chains; const chains = selectChain.chains;
let handle_flag = 0; let handle_flag = 0;
......
...@@ -4,7 +4,7 @@ import { messageStore } from "@/stores"; ...@@ -4,7 +4,7 @@ import { messageStore } from "@/stores";
type MsgSelectPosition = ygopro.StocGameMessage.MsgSelectPosition; type MsgSelectPosition = ygopro.StocGameMessage.MsgSelectPosition;
export default (selectPosition: MsgSelectPosition) => { export default (selectPosition: MsgSelectPosition) => {
const player = selectPosition.player; const _player = selectPosition.player;
const positions = selectPosition.positions; const positions = selectPosition.positions;
messageStore.positionModal.positions = positions.map( messageStore.positionModal.positions = positions.map(
......
...@@ -4,7 +4,7 @@ import { messageStore } from "@/stores"; ...@@ -4,7 +4,7 @@ import { messageStore } from "@/stores";
type MsgSelectYesNo = ygopro.StocGameMessage.MsgSelectYesNo; type MsgSelectYesNo = ygopro.StocGameMessage.MsgSelectYesNo;
export default async (selectYesNo: MsgSelectYesNo) => { export default async (selectYesNo: MsgSelectYesNo) => {
const player = selectYesNo.player; const _player = selectYesNo.player;
const effect_description = selectYesNo.effect_description; const effect_description = selectYesNo.effect_description;
messageStore.yesNoModal.msg = await getStrings(effect_description); messageStore.yesNoModal.msg = await getStrings(effect_description);
......
...@@ -19,12 +19,12 @@ export default function handleHsPlayerChange(pb: ygopro.YgoStocMsg) { ...@@ -19,12 +19,12 @@ export default function handleHsPlayerChange(pb: ygopro.YgoStocMsg) {
case ygopro.StocHsPlayerChange.State.MOVE: { case ygopro.StocHsPlayerChange.State.MOVE: {
console.log("Player " + change.pos + " moved to " + change.moved_pos); console.log("Player " + change.pos + " moved to " + change.moved_pos);
let src = change.pos; let _src = change.pos;
let dst = change.moved_pos; let _dst = change.moved_pos;
console.log("Currently unsupport Move type of StocHsPlayerChange."); console.log("Currently unsupport Move type of StocHsPlayerChange.");
// todo // TODO
break; break;
} }
......
...@@ -2,7 +2,7 @@ import { ygopro } from "@/api"; ...@@ -2,7 +2,7 @@ import { ygopro } from "@/api";
import { joinStore } from "@/stores"; import { joinStore } from "@/stores";
export default function handleJoinGame(pb: ygopro.YgoStocMsg) { export default function handleJoinGame(pb: ygopro.YgoStocMsg) {
const msg = pb.stoc_join_game; const _msg = pb.stoc_join_game;
// todo // TODO
joinStore.value = true; joinStore.value = true;
} }
...@@ -67,7 +67,7 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => { ...@@ -67,7 +67,7 @@ export const Card: FC<{ idx: number }> = React.memo(({ idx }) => {
}, []); }, []);
const [highlight, setHighlight] = useState(false); const [highlight, setHighlight] = useState(false);
const [shadowOpacity, setShadowOpacity] = useState(0); // TODO 透明度 // const [shadowOpacity, setShadowOpacity] = useState(0); // TODO: 透明度
// >>> 动画 >>> // >>> 动画 >>>
/** 动画序列的promise */ /** 动画序列的promise */
......
import { easings } from "@react-spring/web";
import { ygopro } from "@/api"; import { ygopro } from "@/api";
import { type CardType, isMe, matStore } from "@/stores"; import { type CardType, matStore } from "@/stores";
import { matConfig } from "../../utils";
import { SpringApi } from "./types"; import { SpringApi } from "./types";
import { asyncStart } from "./utils"; import { asyncStart } from "./utils";
......
import { easings } from "@react-spring/web";
import { ygopro } from "@/api"; import { ygopro } from "@/api";
import { type CardType, isMe } from "@/stores"; import { type CardType, isMe } from "@/stores";
import { matConfig } from "../../utils"; import { matConfig } from "../../utils";
import { SpringApi } from "./types"; import { SpringApi } from "./types";
import { asyncStart } from "./utils";
const { const {
PLANE_ROTATE_X,
BLOCK_WIDTH, BLOCK_WIDTH,
BLOCK_HEIGHT_M, BLOCK_HEIGHT_M,
BLOCK_HEIGHT_S, BLOCK_HEIGHT_S,
CARD_RATIO,
COL_GAP, COL_GAP,
ROW_GAP, ROW_GAP,
HAND_MARGIN_TOP,
HAND_CARD_HEIGHT,
HAND_CIRCLE_CENTER_OFFSET_Y,
DECK_OFFSET_X, DECK_OFFSET_X,
DECK_OFFSET_Y, DECK_OFFSET_Y,
DECK_ROTATE_Z, DECK_ROTATE_Z,
DECK_CARD_HEIGHT, DECK_CARD_HEIGHT,
} = matConfig; } = matConfig;
const { HAND, GRAVE, REMOVED, DECK, EXTRA, MZONE, SZONE, TZONE } = const { DECK, EXTRA } = ygopro.CardZone;
ygopro.CardZone;
export const moveToDeck = async (props: { card: CardType; api: SpringApi }) => { export const moveToDeck = async (props: { card: CardType; api: SpringApi }) => {
const { card, api } = props; const { card, api } = props;
// report // report
const { location } = card; const { location } = card;
const { controller, zone, sequence, position } = location; const { controller, zone, sequence } = location;
const rightX = DECK_OFFSET_X.value + 2 * (BLOCK_WIDTH.value + COL_GAP.value); const rightX = DECK_OFFSET_X.value + 2 * (BLOCK_WIDTH.value + COL_GAP.value);
const leftX = -rightX; const leftX = -rightX;
......
...@@ -8,23 +8,15 @@ import { SpringApi } from "./types"; ...@@ -8,23 +8,15 @@ import { SpringApi } from "./types";
import { asyncStart } from "./utils"; import { asyncStart } from "./utils";
const { const {
PLANE_ROTATE_X,
BLOCK_WIDTH, BLOCK_WIDTH,
BLOCK_HEIGHT_M, BLOCK_HEIGHT_M,
BLOCK_HEIGHT_S, BLOCK_HEIGHT_S,
CARD_RATIO, CARD_RATIO,
COL_GAP, COL_GAP,
ROW_GAP, ROW_GAP,
HAND_MARGIN_TOP,
HAND_CARD_HEIGHT,
HAND_CIRCLE_CENTER_OFFSET_Y,
DECK_OFFSET_X,
DECK_OFFSET_Y,
DECK_ROTATE_Z,
} = matConfig; } = matConfig;
const { HAND, GRAVE, REMOVED, DECK, EXTRA, MZONE, SZONE, TZONE } = const { MZONE, SZONE } = ygopro.CardZone;
ygopro.CardZone;
export const moveToGround = async (props: { export const moveToGround = async (props: {
card: CardType; card: CardType;
......
import { easings } from "@react-spring/web";
import { ygopro } from "@/api"; import { ygopro } from "@/api";
import { cardStore, type CardType, isMe } from "@/stores"; import { cardStore, type CardType, isMe } from "@/stores";
import { matConfig } from "../../utils"; import { matConfig } from "../../utils";
import { SpringApi } from "./types"; import { SpringApi } from "./types";
import { asyncStart } from "./utils";
const { const {
PLANE_ROTATE_X,
BLOCK_WIDTH,
BLOCK_HEIGHT_M, BLOCK_HEIGHT_M,
BLOCK_HEIGHT_S, BLOCK_HEIGHT_S,
CARD_RATIO, CARD_RATIO,
COL_GAP,
ROW_GAP, ROW_GAP,
HAND_MARGIN_TOP, HAND_MARGIN_TOP,
HAND_CARD_HEIGHT, HAND_CARD_HEIGHT,
HAND_CIRCLE_CENTER_OFFSET_Y, HAND_CIRCLE_CENTER_OFFSET_Y,
DECK_OFFSET_X,
DECK_OFFSET_Y,
DECK_ROTATE_Z,
} = matConfig; } = matConfig;
const { HAND, GRAVE, REMOVED, DECK, EXTRA, MZONE, SZONE, TZONE } = const { HAND } = ygopro.CardZone;
ygopro.CardZone;
export const moveToHand = async (props: { card: CardType; api: SpringApi }) => { export const moveToHand = async (props: { card: CardType; api: SpringApi }) => {
const { card, api } = props; const { card, api } = props;
const { zone, sequence, controller } = card.location; const { sequence, controller } = card.location;
// 手卡会有很复杂的计算... // 手卡会有很复杂的计算...
const hand_circle_center_x = 0; const hand_circle_center_x = 0;
const hand_circle_center_y = const hand_circle_center_y =
......
import { easings } from "@react-spring/web";
import { ygopro } from "@/api"; import { ygopro } from "@/api";
import { type CardType, isMe } from "@/stores"; import { type CardType, isMe } from "@/stores";
import { matConfig } from "../../utils"; import { matConfig } from "../../utils";
import { SpringApi } from "./types"; import { SpringApi } from "./types";
import { asyncStart } from "./utils";
const { const { BLOCK_WIDTH, BLOCK_HEIGHT_M, BLOCK_HEIGHT_S, COL_GAP, ROW_GAP } =
PLANE_ROTATE_X, matConfig;
BLOCK_WIDTH,
BLOCK_HEIGHT_M,
BLOCK_HEIGHT_S,
CARD_RATIO,
COL_GAP,
ROW_GAP,
HAND_MARGIN_TOP,
HAND_CARD_HEIGHT,
HAND_CIRCLE_CENTER_OFFSET_Y,
DECK_OFFSET_X,
DECK_OFFSET_Y,
DECK_ROTATE_Z,
} = matConfig;
const { HAND, GRAVE, REMOVED, DECK, EXTRA, MZONE, SZONE, TZONE } = const { GRAVE } = ygopro.CardZone;
ygopro.CardZone;
export const moveToOutside = async (props: { export const moveToOutside = async (props: {
card: CardType; card: CardType;
...@@ -32,7 +15,7 @@ export const moveToOutside = async (props: { ...@@ -32,7 +15,7 @@ export const moveToOutside = async (props: {
}) => { }) => {
const { card, api } = props; const { card, api } = props;
// report // report
const { zone, sequence, controller, position } = card.location; const { zone, controller, position } = card.location;
let x = (BLOCK_WIDTH.value + COL_GAP.value) * 3, let x = (BLOCK_WIDTH.value + COL_GAP.value) * 3,
y = zone === GRAVE ? BLOCK_HEIGHT_M.value + ROW_GAP.value : 0; y = zone === GRAVE ? BLOCK_HEIGHT_M.value + ROW_GAP.value : 0;
......
import { type SpringRef, type SpringValue } from "@react-spring/web"; import { type SpringRef } from "@react-spring/web";
export type SpringApi = SpringRef<{ export type SpringApi = SpringRef<{
x: number; x: number;
......
...@@ -7,7 +7,7 @@ import { cardStore } from "@/stores"; ...@@ -7,7 +7,7 @@ import { cardStore } from "@/stores";
import { Bg } from "../Bg"; import { Bg } from "../Bg";
import { Card } from "../Card"; import { Card } from "../Card";
import { type CSSConfig, matConfig, toCssProperties } from "../utils"; import { matConfig, toCssProperties } from "../utils";
// 后面再改名 // 后面再改名
export const Mat: FC = () => { export const Mat: FC = () => {
...@@ -23,7 +23,7 @@ export const Mat: FC = () => { ...@@ -23,7 +23,7 @@ export const Mat: FC = () => {
<Plane> <Plane>
<Bg /> <Bg />
<CardContainer> <CardContainer>
{snap.map((cardSnap, i) => ( {snap.map((_cardSnap, i) => (
<Card key={i} idx={i} /> <Card key={i} idx={i} />
))} ))}
</CardContainer> </CardContainer>
......
type CSSValue = [number, string] | number; // type CSSValue = [number, string] | number;
export type CSSConfig = Record<string, { value: number; unit: UNIT }>; export type CSSConfig = Record<string, { value: number; unit: UNIT }>;
......
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