Clear core dependents
This commit is contained in:
parent
3a5329d278
commit
ec131d4c80
@ -1,5 +1,3 @@
|
||||
import { getProductionQueue } from '../Task/TaskMap';
|
||||
|
||||
export enum ProductionQueue {
|
||||
Building = 'building',
|
||||
TrainUnit = 'train_unit',
|
||||
@ -33,14 +31,3 @@ export function translateProductionQueue(queue: ProductionQueue): string {
|
||||
export interface TaskNamePredicate {
|
||||
(name: string): boolean;
|
||||
}
|
||||
|
||||
/**
|
||||
* List on non intersected task queue predicates.
|
||||
*/
|
||||
const TASK_TYPE_PREDICATES: Array<TaskNamePredicate> = OrderedProductionQueues.map(queue => {
|
||||
return (taskName: string) => getProductionQueue(taskName) === queue;
|
||||
});
|
||||
|
||||
export function isProductionTask(taskName: string): boolean {
|
||||
return TASK_TYPE_PREDICATES.reduce((memo, predicate) => memo || predicate(taskName), false);
|
||||
}
|
||||
|
@ -9,9 +9,9 @@ import { SendResourcesTask } from './Task/SendResourcesTask';
|
||||
import { Args } from './Queue/Args';
|
||||
import { ImmutableTaskList, Task, TaskId, uniqTaskId, withTime } from './Queue/TaskProvider';
|
||||
import { VillageRepositoryInterface } from './VillageRepository';
|
||||
import { isProductionTask } from './Core/ProductionQueue';
|
||||
import { VillageFactory } from './VillageFactory';
|
||||
import { RunVillageProductionTask } from './Task/RunVillageProductionTask';
|
||||
import { isProductionTask } from './Task/TaskMap';
|
||||
|
||||
export interface NextExecution {
|
||||
task?: Task;
|
||||
|
@ -1,6 +1,10 @@
|
||||
import { Scheduler } from '../Scheduler';
|
||||
import { TaskController } from './TaskController';
|
||||
import { ProductionQueue } from '../Core/ProductionQueue';
|
||||
import {
|
||||
OrderedProductionQueues,
|
||||
ProductionQueue,
|
||||
TaskNamePredicate,
|
||||
} from '../Core/ProductionQueue';
|
||||
import { VillageFactory } from '../VillageFactory';
|
||||
|
||||
interface TaskOptions {
|
||||
@ -47,3 +51,14 @@ export function createTaskHandler(
|
||||
const constructor = (taskDescription.ctor as unknown) as typeof TaskController;
|
||||
return new constructor(scheduler, factory);
|
||||
}
|
||||
|
||||
/**
|
||||
* List on non intersected task queue predicates.
|
||||
*/
|
||||
const TASK_TYPE_PREDICATES: Array<TaskNamePredicate> = OrderedProductionQueues.map(queue => {
|
||||
return (taskName: string) => getProductionQueue(taskName) === queue;
|
||||
});
|
||||
|
||||
export function isProductionTask(taskName: string): boolean {
|
||||
return TASK_TYPE_PREDICATES.reduce((memo, predicate) => memo || predicate(taskName), false);
|
||||
}
|
||||
|
@ -1,12 +1,12 @@
|
||||
import { VillageStorage } from './Storage/VillageStorage';
|
||||
import { Task, TaskId, uniqTaskId, withResources, withTime } from './Queue/TaskProvider';
|
||||
import { Args } from './Queue/Args';
|
||||
import { isProductionTask } from './Core/ProductionQueue';
|
||||
import { timestamp } from './utils';
|
||||
import { Resources } from './Core/Resources';
|
||||
import { ContractAttributes, ContractType } from './Core/Contract';
|
||||
import { UpgradeBuildingTask } from './Task/UpgradeBuildingTask';
|
||||
import { ForgeImprovementTask } from './Task/ForgeImprovementTask';
|
||||
import { isProductionTask } from './Task/TaskMap';
|
||||
|
||||
export class VillageTaskCollection {
|
||||
private readonly storage: VillageStorage;
|
||||
|
Loading…
Reference in New Issue
Block a user