Add state grabbers
This commit is contained in:
		| @@ -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(); | ||||
|     } | ||||
| } | ||||
|   | ||||
		Reference in New Issue
	
	Block a user