Initial commit.
Classes and interfaces in place. The QueryBuilder generics are still a work in progress
This commit is contained in:
9
src/classes/ability.ts
Normal file
9
src/classes/ability.ts
Normal file
@ -0,0 +1,9 @@
|
||||
import { IAbility } from '../interfaces/ability';
|
||||
|
||||
export class Ability implements IAbility {
|
||||
name: string;
|
||||
text: string;
|
||||
type: string;
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
8
src/classes/ancientAbility.ts
Normal file
8
src/classes/ancientAbility.ts
Normal 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
11
src/classes/attack.ts
Normal 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
52
src/classes/card.ts
Normal 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
32
src/classes/set.ts
Normal 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
14
src/classes/subType.ts
Normal 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
13
src/classes/superType.ts
Normal 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
16
src/classes/type.ts
Normal 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.");
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user