Commit bb640b14 authored by Chunchi Che's avatar Chunchi Che

disable unused code

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