Commit 051fc7f6 authored by Chunchi Che's avatar Chunchi Che

remove chainIndex in CardState

parent 2f59f2df
...@@ -8,12 +8,12 @@ export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => { ...@@ -8,12 +8,12 @@ export default (_chainEnd: ygopro.StocGameMessage.MsgChainEnd) => {
break; break;
} }
const target = cardStore.find(chain); // const target = cardStore.find(chain);
if (target) { // if (target) {
target.chainIndex = undefined; // target.chainIndex = undefined;
} else { // } else {
console.warn(`<ChainEnd>target from ${chain} is null`); // console.warn(`<ChainEnd>target from ${chain} is null`);
} // }
} }
// 目前selected字段只会涉及连锁过程某些卡成为效果对象, // 目前selected字段只会涉及连锁过程某些卡成为效果对象,
......
...@@ -17,7 +17,7 @@ export default async (chainSolved: ygopro.StocGameMessage.MsgChainSolved) => { ...@@ -17,7 +17,7 @@ export default async (chainSolved: ygopro.StocGameMessage.MsgChainSolved) => {
// 设置被连锁状态为空,解除连锁 // 设置被连锁状态为空,解除连锁
const target = cardStore.find(location); const target = cardStore.find(location);
if (target) { if (target) {
target.chainIndex = undefined; // target.chainIndex = undefined;
} else { } else {
console.warn(`<ChainSolved>target from ${location} is null`); console.warn(`<ChainSolved>target from ${location} is null`);
} }
......
...@@ -16,7 +16,7 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => { ...@@ -16,7 +16,7 @@ export default async (chaining: ygopro.StocGameMessage.MsgChaining) => {
const target = cardStore.find(location); const target = cardStore.find(location);
if (target) { if (target) {
// 设置连锁序号 // 设置连锁序号
target.chainIndex = matStore.chains.length; // target.chainIndex = matStore.chains.length;
const meta = fetchCard(chaining.code); const meta = fetchCard(chaining.code);
// 这里不能设置`code`,因为存在一个场景: // 这里不能设置`code`,因为存在一个场景:
......
...@@ -22,8 +22,6 @@ export interface CardType { ...@@ -22,8 +22,6 @@ export interface CardType {
}>; // 选择位置状态下的互动信息 }>; // 选择位置状态下的互动信息
counters: { [type: number]: number }; // 指示器 counters: { [type: number]: number }; // 指示器
isToken: boolean; // 是否是token isToken: boolean; // 是否是token
chainIndex?: number /*连锁的序号,如果为空表示不在连锁
TODO: 目前是妥协的设计,因为其实一张卡是可以在同一个连锁链中被连锁多次的,这里为了避免太过复杂只保存最后的连锁序号*/;
selected: boolean; // 当前卡是否被选择成为效果的对象 selected: boolean; // 当前卡是否被选择成为效果的对象
} }
......
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