Auto build warehouse, granary and crop fields
This commit is contained in:
@ -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));
|
||||
|
14
src/Grabber/VillageBuildingsPageGrabber.ts
Normal file
14
src/Grabber/VillageBuildingsPageGrabber.ts
Normal 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());
|
||||
}
|
||||
}
|
Reference in New Issue
Block a user