Commit 9d8825d3 authored by Chunchi Che's avatar Chunchi Che

update store

parent cfd5585e
Pipeline #21421 passed with stages
in 15 minutes and 29 seconds
...@@ -42,7 +42,7 @@ function reloadDuelField( ...@@ -42,7 +42,7 @@ function reloadDuelField(
return { return {
location: { location: {
controler: controller, controler: controller,
location: action.zone, zone: action.zone,
position: action.position, position: action.position,
}, },
idleInteractivities: [], idleInteractivities: [],
......
...@@ -32,7 +32,7 @@ class CardArray extends Array<CardState> implements ArrayCardState { ...@@ -32,7 +32,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
occupant: await fetchCard(id, true), occupant: await fetchCard(id, true),
location: { location: {
controler: controller, controler: controller,
location: this.zone, zone: this.zone,
position: position:
position == undefined ? ygopro.CardPosition.FACEUP_ATTACK : position, position == undefined ? ygopro.CardPosition.FACEUP_ATTACK : position,
}, },
...@@ -127,12 +127,12 @@ const isMe = (controller: number): boolean => { ...@@ -127,12 +127,12 @@ const isMe = (controller: number): boolean => {
/** /**
* 生成一个指定长度的卡片数组 * 生成一个指定长度的卡片数组
*/ */
const genBlock = (location: ygopro.CardZone, n: number) => const genBlock = (zone: ygopro.CardZone, n: number) =>
Array(n) Array(n)
.fill(null) .fill(null)
.map((_) => ({ .map((_) => ({
location: { location: {
location, zone,
}, },
idleInteractivities: [], idleInteractivities: [],
counters: {}, counters: {},
......
...@@ -109,7 +109,7 @@ export interface CardState { ...@@ -109,7 +109,7 @@ export interface CardState {
occupant?: CardMeta; // 占据此位置的卡牌元信息 occupant?: CardMeta; // 占据此位置的卡牌元信息
location: { location: {
controler?: number; // 控制这个位置的玩家,0或1 controler?: number; // 控制这个位置的玩家,0或1
location: ygopro.CardZone; // 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区 zone: ygopro.CardZone; // 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区
position?: ygopro.CardPosition; // 卡片的姿势:攻击还是守备 position?: ygopro.CardPosition; // 卡片的姿势:攻击还是守备
}; // 位置信息,叫location的原因是为了和ygo对齐 }; // 位置信息,叫location的原因是为了和ygo对齐
idleInteractivities: Interactivity<number>[]; // IDLE状态下的互动信息 idleInteractivities: Interactivity<number>[]; // IDLE状态下的互动信息
...@@ -123,6 +123,20 @@ export interface CardState { ...@@ -123,6 +123,20 @@ export interface CardState {
reload?: boolean; // 这个字段会在收到MSG_RELOAD_FIELD的时候设置成true,在收到MSG_UPDATE_DATE的时候设置成false reload?: boolean; // 这个字段会在收到MSG_RELOAD_FIELD的时候设置成true,在收到MSG_UPDATE_DATE的时候设置成false
} }
export interface BlockState {
// 位置信息
location: {
controller: number;
zone: ygopro.CardZone;
};
// 选择位置状态下的互动信息
placeInteractivity?: Interactivity<{
controler: number;
zone: ygopro.CardZone;
sequence: number;
}>;
}
export interface Interactivity<T> { export interface Interactivity<T> {
interactType: InteractType; interactType: InteractType;
// 如果`interactType`是`ACTIVATE`,这个字段是对应的效果编号 // 如果`interactType`是`ACTIVATE`,这个字段是对应的效果编号
......
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