Permalink
Browse files

build($Everything): Stuff

No

BREAKING CHANGE: No
  • Loading branch information...
Ronin11 committed May 30, 2017
1 parent 8df9c90 commit 0bc561a489df2b1d48fdef52e4ab8e6d2e36e5e4
View
BIN .DS_Store
Binary file not shown.
View
@@ -0,0 +1,2 @@
.DS_Store
node_modules
View
@@ -0,0 +1,21 @@
export abstract class Base {
protected count: number;
constructor(readonly name: string){
this.count = 0;
}
getName(){
return this.name;
}
getCount(){
return this.count;
}
setCount(newCount: number){
this.count = newCount;
}
incrementCount(amount = 1){
this.count += amount;
}
decrementCount(amount = 1){
this.count -= amount;
}
}
View
@@ -0,0 +1,4 @@
import { Harvester } from "./Harvester";
import { Resource } from "./Resource";
import { Upgrade } from "./Upgrade";
View
@@ -0,0 +1,21 @@
import { Base } from "./Base";
export class Harvester extends Base{
private multiplier: number;
constructor(name: string, public cost: Function, public update: Function){
super(name);
this.multiplier = 1;
}
getMultiplier(){
return this.multiplier;
}
setMultiplier(newMultiplier: number){
this.multiplier = newMultiplier;
}
incrementMultiplier(amount = 1){
this.multiplier += amount;
}
decrementMultiplier(amount = 1){
this.multiplier -= amount;
}
}
View
@@ -1,6 +1,15 @@
export class Resource {
constructor(private name: string){}
getName(){
return `Name: ${this.name}`
import { Base } from "./Base";
export class Resource extends Base {
constructor(name: string){
super(name);
}
decrementCount(num: number){
if(num > this.count){
throw("Not enough " + this.name);
}else{
this.count -= num;
}
}
}
View
@@ -0,0 +1,22 @@
import { Base } from "./Base";
export class Upgrade extends Base{
private maxCount: number;
constructor( name: string, theCount: number, theMax: number, public cost: Function, public effect: Function){
super(name);
this.maxCount = 0;
}
getMaxCount(){
return this.maxCount;
}
setMaxCount(newMax: number){
this.maxCount = newMax;
}
incrementMaxCount(amount = 1){
this.maxCount += amount;
}
decrementMaxCount(amount = 1){
this.maxCount -= amount;
}
}
No changes.
No changes.

0 comments on commit 0bc561a

Please sign in to comment.