Commit 7e1e9952 authored by Chunchi Che's avatar Chunchi Che

update field slice

parent 8eb301bd
Pipeline #19754 passed with stages
in 5 minutes and 16 seconds
......@@ -16,7 +16,7 @@ import {
} from "./generic";
export interface FieldState {
inner?: CardState;
inner: CardState;
}
// 初始化场地区状态
......@@ -74,7 +74,7 @@ export const clearFieldPlaceInteractivitiesImpl: CaseReducer<
const player = action.payload;
const field = judgeSelf(player, state) ? state.meField : state.opField;
if (field && field.inner) {
if (field) {
field.inner.placeInteractivities = undefined;
}
};
......@@ -91,7 +91,7 @@ export const addFieldIdleInteractivitiesImpl: CaseReducer<
? state.meField
: state.opField;
if (field && field.inner) {
if (field) {
field.inner.idleInteractivities.push(action.payload.interactivity);
}
};
......@@ -104,7 +104,7 @@ export const clearFieldIdleInteractivitiesImpl: CaseReducer<
? state.meField
: state.opField;
if (field && field.inner) {
if (field) {
field.inner.idleInteractivities = [];
}
};
......@@ -121,7 +121,7 @@ export const fieldCase = (builder: ActionReducerMapBuilder<DuelState>) => {
if (sequence == 0) {
const meta = { id: code, data: {}, text: {} };
const field = judgeSelf(controler, state) ? state.meField : state.opField;
if (field && field.inner) {
if (field) {
field.inner.occupant = meta;
}
}
......@@ -132,7 +132,7 @@ export const fieldCase = (builder: ActionReducerMapBuilder<DuelState>) => {
const meta = action.payload.meta;
const field = judgeSelf(controler, state) ? state.meField : state.opField;
if (field && field.inner) {
if (field) {
field.inner.occupant = meta;
}
});
......@@ -146,7 +146,7 @@ export const removeFieldImpl: DuelReducer<{ controler: number }> = (
const controler = action.payload.controler;
const field = judgeSelf(controler, state) ? state.meField : state.opField;
if (field && field.inner) {
if (field) {
field.inner.occupant = undefined;
}
};
......
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