Add quick actions and mass resources to level upgrade

This commit is contained in:
2020-04-12 16:41:23 +03:00
parent 9d37697b13
commit ed66b0a308
14 changed files with 250 additions and 36 deletions

View File

@ -0,0 +1,22 @@
import { Args, Command } from '../Common';
import { Task } from '../Storage/TaskQueue';
import { TaskController, registerTask } from './TaskController';
import { GoToPageAction } from '../Action/GoToPageAction';
import { CompleteTaskAction } from '../Action/CompleteTaskAction';
import { path } from '../utils';
import { UpgradeResourceToLevel } from '../Action/UpgradeResourceToLevel';
@registerTask
export class ResourcesToLevel extends TaskController {
async run(task: Task) {
const args: Args = { ...task.args, taskId: task.id };
this.scheduler.scheduleActions([
new Command(GoToPageAction.name, {
...args,
path: path('/dorf1.php', { newdid: args.villageId }),
}),
new Command(UpgradeResourceToLevel.name, args),
new Command(CompleteTaskAction.name, args),
]);
}
}