Initial commit.

Classes and interfaces in place. The QueryBuilder generics are still a work in progress
This commit is contained in:
Bradyn Glines
2018-01-18 17:19:41 -07:00
commit 92c2dea62f
25 changed files with 371 additions and 0 deletions

9
src/classes/ability.ts Normal file
View File

@ -0,0 +1,9 @@
import { IAbility } from '../interfaces/ability';
export class Ability implements IAbility {
name: string;
text: string;
type: string;
constructor() {}
}

View File

@ -0,0 +1,8 @@
import { IAncientAbility } from '../interfaces/ancientAbility';
export class AncientAbility implements IAncientAbility {
name: string;
text: string;
constructor() {}
}

11
src/classes/attack.ts Normal file
View File

@ -0,0 +1,11 @@
import { IAttack } from '../interfaces/attack';
export class Attack implements IAttack {
cost: string;
name: string;
text: string;
damage: string;
convertedEnergyCost: string;
constructor() {}
}

52
src/classes/card.ts Normal file
View File

@ -0,0 +1,52 @@
import { ICard } from '../interfaces/card';
import { ISubType } from '../interfaces/subType';
import { ISuperType } from '../interfaces/superType';
import { IAbility } from '../interfaces/ability';
import { ISet } from '../interfaces/set';
import { IType } from '../interfaces/type';
import { IAttack } from '../interfaces/attack';
import { QueryBuilder } from '../queryBuilder';
export class Card implements ICard {
id: number;
name: string;
imageUrl: string;
imageUrlHighRes: string;
subType: ISubType;
superType: ISuperType;
ability: IAbility;
hp: number;
number: number;
artist: string;
rarity: string;
series: string;
set: ISet;
setCode: string;
retreatCost: string;
text: string;
types: IType[];
attacks: IAttack[];
weaknesses: string[];
resistances: string[];
nationalPokedexNumber: number;
ancientTrait: string;
evolvesFrom: string;
constructor() {}
static resource(): string {
return 'cards';
}
find(id: string): Card {
return QueryBuilder.find<Card>(id);
}
all(): ICard[] {
throw new Error("Method not implemented.");
}
where(args: object): ICard {
throw new Error("Method not implemented.");
}
}

32
src/classes/set.ts Normal file
View File

@ -0,0 +1,32 @@
import { ISet } from '../interfaces/set';
export class Set implements ISet {
code: string;
name: string;
series: string;
totalCards: number;
standardLegal: boolean;
expandedLegal: boolean;
releaseDate: string;
symbolUrl: string;
ptcgoCode: string;
constructor() {}
resource(): string {
return "sets";
}
find(id: number): ISet {
throw new Error("Method not implemented.");
}
all(): ISet[] {
throw new Error("Method not implemented.");
}
where(args: object): ISet {
throw new Error("Method not implemented.");
}
}

14
src/classes/subType.ts Normal file
View File

@ -0,0 +1,14 @@
import { ISubType } from '../interfaces/subType';
export class SubType implements ISubType {
constructor() {}
resource(): string {
return 'subtypes';
}
all(): ISubType[] {
throw new Error("Method not implemented.");
}
}

13
src/classes/superType.ts Normal file
View File

@ -0,0 +1,13 @@
import { ISuperType } from '../interfaces/superType';
export class SuperType implements ISuperType {
constructor () {}
resource(): string {
return 'supertypes';
}
all(): ISuperType[] {
throw new Error("Method not implemented.");
}
}

16
src/classes/type.ts Normal file
View File

@ -0,0 +1,16 @@
import { IType } from '../interfaces/type';
export class Type implements IType {
type: string;
value: string;
constructor() {}
resource(): string {
return 'types';
}
all(): IType[] {
throw new Error("Method not implemented.");
}
}