Skip to content

Commit

Permalink
Get rid of resource rate altogether - this is now done by the tasks o…
Browse files Browse the repository at this point in the history
…f assignables. Fixes #44.
  • Loading branch information
rehmsen committed Jan 3, 2015
1 parent 32b898b commit 4ffdc88
Show file tree
Hide file tree
Showing 3 changed files with 0 additions and 26 deletions.
13 changes: 0 additions & 13 deletions src/client/assets/rules/aoc.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -35,37 +35,26 @@ startResources:
resourceSources:
- id: sheep
resource: food
rate: 0.33
- id: boar
resource: food
rate: 0.36
- id: deer
resource: food
rate: 0.59
- id: berries
resource: food
rate: 0.30
- id: farm
resource: food
rate: 0.29
- id: coastal_fish
resource: food
rate: 0.426 # TODO(rehmsen): For ship only 0.28
- id: deep_sea_fish
resource: food
rate: 0.487
- id: fish_trap
resource: food
rate: 0.206
- id: wood
resource: lumber
rate: 0.299
- id: straggler
resource: lumber
rate: 0.299
- id: goldmine
resource: gold
rate: 0.4
- id: land_trade
resource: gold
- id: sea_trade
Expand All @@ -74,8 +63,6 @@ resourceSources:
resource: gold
- id: stonemine
resource: stone
rate: 0.38


buildings:
- id: archery_range
Expand Down
1 change: 0 additions & 1 deletion src/client/components/aoe2/model/build.ts
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,6 @@ export class ConstructionTask implements core.ITask {
verb = core.TaskVerb.construct;
object: string;
id: string;
resourceRate: core.IResourceRate = {rate: 0};
initial: boolean = false;

constructor(public building: Building) {
Expand Down
12 changes: 0 additions & 12 deletions src/client/components/aoe2/model/core.ts
Original file line number Diff line number Diff line change
Expand Up @@ -93,29 +93,20 @@ export enum TaskVerb {
construct
}

export interface IResourceRate {
rate: number;
resource?: Resource;
}

export interface ITask {
verb: TaskVerb;
object?: string;
id: string;
cssClass: string;
initial: boolean;

resourceRate: IResourceRate;

computeDuration(count: number): number;
onAssign(state: IState): void;
}

export class IdleTask implements ITask {
verb = TaskVerb.idle;
id = TaskVerb[this.verb];
resourceRate: IResourceRate = {rate: 0};


constructor(public initial: boolean = false) {
}
Expand All @@ -135,9 +126,6 @@ export class HarvestTask implements ITask {
id: string;
initial: boolean = false;

get resourceRate() {
return {rate: this.source.rate, resource: this.source.resource };
}
get cssClass(): string { return 'icon-' + this.object; }

constructor(public source: IResourceSource) {
Expand Down

0 comments on commit 4ffdc88

Please sign in to comment.