feat(WIP): 턴 조작기 고급 기능
- 잘라내기, 복사하기, 붙여넣기 - 반복하기 - 비우기 - 지우고 당기기, 뒤로 밀기
This commit is contained in:
@@ -4,7 +4,7 @@ import { ref } from 'vue';
|
||||
|
||||
export class StoredActionsHelper {
|
||||
public readonly recentActions = ref<TurnObj[]>([]);
|
||||
public readonly storedActions = ref(new Map<string, Record<number, TurnObj>>());
|
||||
public readonly storedActions = ref(new Map<string, [number[], TurnObj][]>());
|
||||
public readonly recentActionsKey: string;
|
||||
public readonly storedActionsKey: string;
|
||||
|
||||
@@ -32,11 +32,11 @@ export class StoredActionsHelper {
|
||||
}
|
||||
|
||||
loadStoredActions() {
|
||||
const rawValue: [string, Record<number, TurnObj>][] = JSON.parse(localStorage.getItem(this.storedActionsKey) ?? '[]');
|
||||
const rawValue: [string, [number[], TurnObj][]][] = JSON.parse(localStorage.getItem(this.storedActionsKey) ?? '[]');
|
||||
this.storedActions.value = new Map(rawValue);
|
||||
}
|
||||
|
||||
setStoredActions(actionKey: string, actions: Record<number, TurnObj>) {
|
||||
setStoredActions(actionKey: string, actions: [number[], TurnObj][]) {
|
||||
this.storedActions.value.set(actionKey, actions);
|
||||
this.saveStoredActions();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user