misc: storedActionHelper 저장 키에 map, unit 지정

This commit is contained in:
2022-03-23 20:12:59 +09:00
parent b8542b6bce
commit ef911ba5cc
5 changed files with 12 additions and 5 deletions
+3 -4
View File
@@ -1,5 +1,4 @@
import type { TurnObj } from '@/defs';
import { clone } from 'lodash';
import { ref } from 'vue';
@@ -9,9 +8,9 @@ export class StoredActionsHelper {
public readonly recentActionsKey: string;
public readonly storedActionsKey: string;
constructor(protected serverNick: string, protected type: 'general' | 'nation', protected maxRecent = 10) {
this.recentActionsKey = `${serverNick}_${type}RecentActions`;
this.storedActionsKey = `${serverNick}_${type}StoredActions`;
constructor(protected serverNick: string, protected type: 'general' | 'nation', protected mapName: string, protected unitSet: string, protected maxRecent = 10) {
this.recentActionsKey = `${serverNick}_${mapName}_${unitSet}_${type}RecentActions`;
this.storedActionsKey = `${serverNick}_${mapName}_${unitSet}_${type}StoredActions`;
this.loadRecentActions();
this.loadStoredActions();
}