Reorder modules
This commit is contained in:
parent
60b1243214
commit
d830a135f3
@ -2,10 +2,10 @@ import { ActionController, registerAction } from './ActionController';
|
|||||||
import { ActionError, taskError, TryLaterError } from '../Errors';
|
import { ActionError, taskError, TryLaterError } from '../Errors';
|
||||||
import { grabResourceSlots } from '../Page/SlotBlock';
|
import { grabResourceSlots } from '../Page/SlotBlock';
|
||||||
import { UpgradeBuildingTask } from '../Task/UpgradeBuildingTask';
|
import { UpgradeBuildingTask } from '../Task/UpgradeBuildingTask';
|
||||||
import { ResourceSlot } from '../Game';
|
|
||||||
import { aroundMinutes, getNumber } from '../utils';
|
import { aroundMinutes, getNumber } from '../utils';
|
||||||
import { Args } from '../Queue/Args';
|
import { Args } from '../Queue/Args';
|
||||||
import { Task } from '../Queue/TaskProvider';
|
import { Task } from '../Queue/TaskProvider';
|
||||||
|
import { ResourceSlot } from '../Core/Slot';
|
||||||
|
|
||||||
@registerAction
|
@registerAction
|
||||||
export class UpgradeResourceToLevel extends ActionController {
|
export class UpgradeResourceToLevel extends ActionController {
|
||||||
|
@ -14,7 +14,7 @@ import Vuex from 'vuex';
|
|||||||
import DashboardApp from './DashboardView/Dashboard.vue';
|
import DashboardApp from './DashboardView/Dashboard.vue';
|
||||||
import { ConsoleLogger, Logger } from './Logger';
|
import { ConsoleLogger, Logger } from './Logger';
|
||||||
import { DataStorage } from './DataStorage';
|
import { DataStorage } from './DataStorage';
|
||||||
import { getBuildingPageAttributes, isBuildingPage } from './Page/PageDetectors';
|
import { getBuildingPageAttributes, isBuildingPage } from './Page/PageDetector';
|
||||||
import { ExecutionStorage } from './Storage/ExecutionStorage';
|
import { ExecutionStorage } from './Storage/ExecutionStorage';
|
||||||
import { VillageState } from './VillageState';
|
import { VillageState } from './VillageState';
|
||||||
import { Task } from './Queue/TaskProvider';
|
import { Task } from './Queue/TaskProvider';
|
||||||
|
35
src/Core/Slot.ts
Normal file
35
src/Core/Slot.ts
Normal file
@ -0,0 +1,35 @@
|
|||||||
|
import { ResourceType } from './ResourceType';
|
||||||
|
|
||||||
|
export interface Slot {
|
||||||
|
readonly buildId: number;
|
||||||
|
readonly level: number;
|
||||||
|
readonly isReady: boolean;
|
||||||
|
readonly isUnderConstruction: boolean;
|
||||||
|
readonly isMaxLevel: boolean;
|
||||||
|
}
|
||||||
|
|
||||||
|
export interface ResourceSlot extends Slot {
|
||||||
|
readonly type: ResourceType;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const ResourceSlotDefaults: ResourceSlot = {
|
||||||
|
type: ResourceType.Lumber,
|
||||||
|
buildId: 0,
|
||||||
|
level: 0,
|
||||||
|
isReady: false,
|
||||||
|
isUnderConstruction: false,
|
||||||
|
isMaxLevel: false,
|
||||||
|
};
|
||||||
|
|
||||||
|
export interface BuildingSlot extends Slot {
|
||||||
|
readonly buildTypeId: number;
|
||||||
|
}
|
||||||
|
|
||||||
|
export const BuildingSlotDefaults: BuildingSlot = {
|
||||||
|
buildTypeId: 0,
|
||||||
|
buildId: 0,
|
||||||
|
level: 0,
|
||||||
|
isReady: false,
|
||||||
|
isUnderConstruction: false,
|
||||||
|
isMaxLevel: false,
|
||||||
|
};
|
36
src/Game.ts
36
src/Game.ts
@ -1,42 +1,6 @@
|
|||||||
import { ResourceType } from './Core/ResourceType';
|
|
||||||
|
|
||||||
export class BuildingQueueInfo {
|
export class BuildingQueueInfo {
|
||||||
readonly seconds: number;
|
readonly seconds: number;
|
||||||
constructor(seconds: number) {
|
constructor(seconds: number) {
|
||||||
this.seconds = seconds;
|
this.seconds = seconds;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
export interface Slot {
|
|
||||||
readonly buildId: number;
|
|
||||||
readonly level: number;
|
|
||||||
readonly isReady: boolean;
|
|
||||||
readonly isUnderConstruction: boolean;
|
|
||||||
readonly isMaxLevel: boolean;
|
|
||||||
}
|
|
||||||
|
|
||||||
export interface ResourceSlot extends Slot {
|
|
||||||
readonly type: ResourceType;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const ResourceSlotDefaults: ResourceSlot = {
|
|
||||||
type: ResourceType.Lumber,
|
|
||||||
buildId: 0,
|
|
||||||
level: 0,
|
|
||||||
isReady: false,
|
|
||||||
isUnderConstruction: false,
|
|
||||||
isMaxLevel: false,
|
|
||||||
};
|
|
||||||
|
|
||||||
export interface BuildingSlot extends Slot {
|
|
||||||
readonly buildTypeId: number;
|
|
||||||
}
|
|
||||||
|
|
||||||
export const BuildingSlotDefaults: BuildingSlot = {
|
|
||||||
buildTypeId: 0,
|
|
||||||
buildId: 0,
|
|
||||||
level: 0,
|
|
||||||
isReady: false,
|
|
||||||
isUnderConstruction: false,
|
|
||||||
isMaxLevel: false,
|
|
||||||
};
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Grabber } from './Grabber';
|
import { Grabber } from './Grabber';
|
||||||
import { getBuildingPageAttributes, isBuildingPage } from '../Page/PageDetectors';
|
import { getBuildingPageAttributes, isBuildingPage } from '../Page/PageDetector';
|
||||||
import { grabContractResources, hasContractResources } from '../Page/BuildingPage/BuildingPage';
|
import { grabContractResources, hasContractResources } from '../Page/BuildingPage/BuildingPage';
|
||||||
import { ContractType } from '../Core/Contract';
|
import { ContractType } from '../Core/Contract';
|
||||||
|
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Grabber } from './Grabber';
|
import { Grabber } from './Grabber';
|
||||||
import { getBuildingPageAttributes, isForgePage } from '../Page/PageDetectors';
|
import { getBuildingPageAttributes, isForgePage } from '../Page/PageDetector';
|
||||||
import { ContractType } from '../Core/Contract';
|
import { ContractType } from '../Core/Contract';
|
||||||
import { grabImprovementContracts, grabRemainingSeconds } from '../Page/BuildingPage/ForgePage';
|
import { grabImprovementContracts, grabRemainingSeconds } from '../Page/BuildingPage/ForgePage';
|
||||||
import { ProductionQueue } from '../Core/ProductionQueue';
|
import { ProductionQueue } from '../Core/ProductionQueue';
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Grabber } from './Grabber';
|
import { Grabber } from './Grabber';
|
||||||
import { isGuildHallPage } from '../Page/PageDetectors';
|
import { isGuildHallPage } from '../Page/PageDetector';
|
||||||
import { grabRemainingSeconds } from '../Page/BuildingPage/GuildHallPage';
|
import { grabRemainingSeconds } from '../Page/BuildingPage/GuildHallPage';
|
||||||
import { ProductionQueue } from '../Core/ProductionQueue';
|
import { ProductionQueue } from '../Core/ProductionQueue';
|
||||||
import { timestamp } from '../utils';
|
import { timestamp } from '../utils';
|
||||||
|
@ -2,7 +2,7 @@ import { Grabber } from './Grabber';
|
|||||||
import { grabVillageList } from '../Page/VillageBlock';
|
import { grabVillageList } from '../Page/VillageBlock';
|
||||||
import { HeroStorage } from '../Storage/HeroStorage';
|
import { HeroStorage } from '../Storage/HeroStorage';
|
||||||
import { grabHeroAttributes, grabHeroVillage } from '../Page/HeroPage';
|
import { grabHeroAttributes, grabHeroVillage } from '../Page/HeroPage';
|
||||||
import { isHeroPage } from '../Page/PageDetectors';
|
import { isHeroPage } from '../Page/PageDetector';
|
||||||
|
|
||||||
export class HeroPageGrabber extends Grabber {
|
export class HeroPageGrabber extends Grabber {
|
||||||
grab(): void {
|
grab(): void {
|
||||||
|
@ -1,5 +1,5 @@
|
|||||||
import { Grabber } from './Grabber';
|
import { Grabber } from './Grabber';
|
||||||
import { isMarketSendResourcesPage } from '../Page/PageDetectors';
|
import { isMarketSendResourcesPage } from '../Page/PageDetector';
|
||||||
import { grabIncomingMerchants, grabMerchantsInfo } from '../Page/BuildingPage/MarketPage';
|
import { grabIncomingMerchants, grabMerchantsInfo } from '../Page/BuildingPage/MarketPage';
|
||||||
|
|
||||||
export class MarketPageGrabber extends Grabber {
|
export class MarketPageGrabber extends Grabber {
|
||||||
|
@ -15,7 +15,7 @@ import {
|
|||||||
isForgePage,
|
isForgePage,
|
||||||
isGuildHallPage,
|
isGuildHallPage,
|
||||||
isMarketSendResourcesPage,
|
isMarketSendResourcesPage,
|
||||||
} from './PageDetectors';
|
} from './PageDetector';
|
||||||
import { createTrainTroopButtons } from './BuildingPage/TrooperPage';
|
import { createTrainTroopButtons } from './BuildingPage/TrooperPage';
|
||||||
import { createSendResourcesButton } from './BuildingPage/MarketPage';
|
import { createSendResourcesButton } from './BuildingPage/MarketPage';
|
||||||
import { createResearchButtons } from './BuildingPage/ForgePage';
|
import { createResearchButtons } from './BuildingPage/ForgePage';
|
||||||
|
@ -1,6 +1,6 @@
|
|||||||
import { elClassId, getNumber } from '../utils';
|
import { elClassId, getNumber } from '../utils';
|
||||||
import { BuildingSlot, ResourceSlot } from '../Game';
|
|
||||||
import { numberToResourceType } from '../Core/ResourceType';
|
import { numberToResourceType } from '../Core/ResourceType';
|
||||||
|
import { BuildingSlot, ResourceSlot } from '../Core/Slot';
|
||||||
|
|
||||||
interface SlotElement {
|
interface SlotElement {
|
||||||
el: HTMLElement;
|
el: HTMLElement;
|
||||||
|
@ -6,7 +6,12 @@ import { VillageSettings, VillageSettingsDefaults } from '../Core/Village';
|
|||||||
import { ProductionQueue } from '../Core/ProductionQueue';
|
import { ProductionQueue } from '../Core/ProductionQueue';
|
||||||
import { getNumber } from '../utils';
|
import { getNumber } from '../utils';
|
||||||
import { Task, uniqTaskId } from '../Queue/TaskProvider';
|
import { Task, uniqTaskId } from '../Queue/TaskProvider';
|
||||||
import { BuildingSlot, BuildingSlotDefaults, ResourceSlot, ResourceSlotDefaults } from '../Game';
|
import {
|
||||||
|
BuildingSlot,
|
||||||
|
BuildingSlotDefaults,
|
||||||
|
ResourceSlot,
|
||||||
|
ResourceSlotDefaults,
|
||||||
|
} from '../Core/Slot';
|
||||||
|
|
||||||
const RESOURCES_KEY = 'resources';
|
const RESOURCES_KEY = 'resources';
|
||||||
const CAPACITY_KEY = 'capacity';
|
const CAPACITY_KEY = 'capacity';
|
||||||
|
Loading…
Reference in New Issue
Block a user