Add state grabbers

This commit is contained in:
2020-04-16 17:53:04 +03:00
parent fc75b007c8
commit c3428afabb
7 changed files with 57 additions and 10 deletions

View File

@ -1,16 +1,12 @@
import { ActionController, registerAction } from './ActionController';
import { Args } from '../Common';
import { Task } from '../Storage/TaskQueue';
import { grabResources } from '../Page/ResourcesBlock';
import { grabActiveVillageId } from '../Page/VillageBlock';
import { VillageState } from '../Storage/VillageState';
import { StateGrabberManager } from '../State/StateGrabberManager';
@registerAction
export class StoreVillageState extends ActionController {
async run(args: Args, task: Task): Promise<any> {
const villageId = grabActiveVillageId();
const resources = grabResources();
const state = new VillageState(villageId);
state.storeResources(resources);
const manager = new StateGrabberManager();
manager.grab();
}
}