Auto build warehouse, granary and crop fields

This commit is contained in:
2020-07-01 18:06:11 +03:00
parent 7653c7b6e7
commit effc1b1626
14 changed files with 252 additions and 54 deletions

View File

@ -7,6 +7,7 @@ import { BuildingContractGrabber } from './BuildingContractGrabber';
import { ForgePageGrabber } from './ForgePageGrabber';
import { GuildHallPageGrabber } from './GuildHallPageGrabber';
import { VillageFactory } from '../VillageFactory';
import { VillageBuildingsPageGrabber } from './VillageBuildingsPageGrabber';
export class GrabberManager {
private factory: VillageFactory;
@ -28,6 +29,7 @@ export class GrabberManager {
const grabbers: Array<Grabber> = [];
grabbers.push(new VillageResourceGrabber(taskCollection, storage));
grabbers.push(new VillageOverviewPageGrabber(taskCollection, storage));
grabbers.push(new VillageBuildingsPageGrabber(taskCollection, storage));
grabbers.push(new HeroPageGrabber(taskCollection, storage));
grabbers.push(new MarketPageGrabber(taskCollection, storage));
grabbers.push(new BuildingContractGrabber(taskCollection, storage));

View File

@ -0,0 +1,14 @@
import { Grabber } from './Grabber';
import { parseLocation } from '../utils';
import { grabBuildingSlots } from '../Page/SlotBlock';
export class VillageBuildingsPageGrabber extends Grabber {
grab(): void {
const p = parseLocation();
if (p.pathname !== '/dorf2.php') {
return;
}
this.storage.storeBuildingSlots(grabBuildingSlots());
}
}