Commit a1abc554 authored by Chunchi Che's avatar Chunchi Che

rerange Card

parent a48d933c
...@@ -19,27 +19,6 @@ export interface CardMeta { ...@@ -19,27 +19,6 @@ export interface CardMeta {
}; };
} }
interface CardTransform {
position?: {
x: number;
y: number;
z: number;
};
rotation?: {
x: number;
y: number;
z: number;
};
}
/*
* `Neos`中表示卡牌的通用结构
* */
export interface Card {
meta: CardMeta;
transform: CardTransform;
}
/* /*
* 返回卡片元数据 * 返回卡片元数据
* *
......
import { createAsyncThunk, ActionReducerMapBuilder } from "@reduxjs/toolkit"; import { createAsyncThunk, ActionReducerMapBuilder } from "@reduxjs/toolkit";
import { DuelState } from "./mod"; import { DuelState } from "./mod";
import { RootState } from "../../store"; import { RootState } from "../../store";
import { Card, fetchCard, CardMeta } from "../../api/cards"; import { fetchCard, CardMeta } from "../../api/cards";
import { judgeSelf } from "./util"; import { judgeSelf } from "./util";
import * as UICONFIG from "../../config/ui"; import * as UICONFIG from "../../config/ui";
import { Card } from "./util";
export interface Hands { export interface Hands {
cards: Card[]; cards: Card[];
......
/* /*
* 对局内状态更新逻辑的一些共用函数 * 对局内状态更新逻辑的一些共用函数和数据结构
* *
* */ * */
import { CardMeta } from "../../api/cards";
/* /*
* 通过`player`和`selfType`判断是应该处理自己还是对手 * 通过`player`和`selfType`判断是应该处理自己还是对手
* */ * */
...@@ -21,3 +23,24 @@ export function judgeSelf( ...@@ -21,3 +23,24 @@ export function judgeSelf(
return false; return false;
} }
} }
/*
* `Neos`中表示卡牌的通用结构
* */
export interface Card {
meta: CardMeta;
transform: CardTransform;
}
interface CardTransform {
position?: {
x: number;
y: number;
z: number;
};
rotation?: {
x: number;
y: number;
z: number;
};
}
...@@ -16,7 +16,7 @@ ...@@ -16,7 +16,7 @@
import React from "react"; import React from "react";
import type { RootState } from "../../store"; import type { RootState } from "../../store";
import { Card } from "../../api/cards"; import { Card } from "../../reducers/duel/util";
/* /*
* 通用的决斗界面抽象接口 * 通用的决斗界面抽象接口
......
import * as BABYLON from "@babylonjs/core"; import * as BABYLON from "@babylonjs/core";
import * as CONFIG from "../../../config/ui"; import * as CONFIG from "../../../config/ui";
import { Card } from "../../../api/cards"; import { Card } from "../../../reducers/duel/util";
export default (hands: Card[], scene: BABYLON.Scene) => { export default (hands: Card[], scene: BABYLON.Scene) => {
const handShape = CONFIG.HandShape(); const handShape = CONFIG.HandShape();
......
...@@ -17,7 +17,7 @@ import renderCemetery from "./cemetery"; ...@@ -17,7 +17,7 @@ import renderCemetery from "./cemetery";
import renderExclusion from "./exclusion"; import renderExclusion from "./exclusion";
import renderField from "./field"; import renderField from "./field";
import * as CONFIG from "../../../config/ui"; import * as CONFIG from "../../../config/ui";
import { Card } from "../../../api/cards"; import { Card } from "../../../reducers/duel/util";
import { selectCurrentPlayer } from "../../../reducers/duel/turnSlice"; import { selectCurrentPlayer } from "../../../reducers/duel/turnSlice";
import { selectCurrentPhase } from "../../../reducers/duel/phaseSlice"; import { selectCurrentPhase } from "../../../reducers/duel/phaseSlice";
......
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