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(
return {
location: {
controler: controller,
location: action.zone,
zone: action.zone,
position: action.position,
},
idleInteractivities: [],
......
......@@ -32,7 +32,7 @@ class CardArray extends Array<CardState> implements ArrayCardState {
occupant: await fetchCard(id, true),
location: {
controler: controller,
location: this.zone,
zone: this.zone,
position:
position == undefined ? ygopro.CardPosition.FACEUP_ATTACK : position,
},
......@@ -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)
.fill(null)
.map((_) => ({
location: {
location,
zone,
},
idleInteractivities: [],
counters: {},
......
......@@ -109,7 +109,7 @@ export interface CardState {
occupant?: CardMeta; // 占据此位置的卡牌元信息
location: {
controler?: number; // 控制这个位置的玩家,0或1
location: ygopro.CardZone; // 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区
zone: ygopro.CardZone; // 怪兽区/魔法陷阱区/手牌/卡组/墓地/除外区
position?: ygopro.CardPosition; // 卡片的姿势:攻击还是守备
}; // 位置信息,叫location的原因是为了和ygo对齐
idleInteractivities: Interactivity<number>[]; // IDLE状态下的互动信息
......@@ -123,6 +123,20 @@ export interface CardState {
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> {
interactType: InteractType;
// 如果`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