Update card definition

This commit is contained in:
CptSpaceToaster
2019-07-06 15:31:08 -04:00
parent 9182764395
commit a084077543
15 changed files with 60 additions and 125 deletions

View File

@ -4,6 +4,6 @@ export class Ability implements IAbility {
name: string;
text: string;
type: string;
constructor() {}
}

View File

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

View File

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

View File

@ -1,40 +1,38 @@
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';
import { ICard } from '../interfaces/card';
import { IQuery } from '../interfaces/query';
import { IResistance } from '../interfaces/resistance';
import { IWeakness } from '../interfaces/weakness';
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;
convertedRetreatCost: number;
evolvesFrom: string;
hp: string;
id: string;
imageUrl: string;
imageUrlHiRes: string;
name: string;
nationalPokedexNumber: number;
number: string;
rarity: string;
resistances: IResistance[];
retreatCost: string[];
series: string;
set: string;
setCode: string;
subtype: string;
supertype: string;
text: string[];
types: string[];
weaknesses: IWeakness[];
constructor() {}
resource(): string {
return 'cards';
}

View File

@ -1,20 +0,0 @@
import { ISubType } from '../interfaces/subType';
import { QueryBuilder } from '../queryBuilder';
export class SubType implements ISubType {
type: string;
constructor() {}
resource(): string {
return 'subtypes';
}
static all(): Promise<SubType[]> {
return QueryBuilder.all(this)
.then(response => {
return response;
});
}
}

View File

@ -1,19 +0,0 @@
import { ISuperType } from '../interfaces/superType';
import { QueryBuilder } from '../queryBuilder';
export class SuperType implements ISuperType {
type: string;
constructor () {}
resource(): string {
return 'supertypes';
}
static all(): Promise<SuperType[]> {
return QueryBuilder.all(this)
.then(response => {
return response;
});
}
}

View File

@ -15,5 +15,5 @@ export class Type implements IType {
.then(response => {
return response;
});
}
}
}

View File

@ -1,10 +1,7 @@
import { Card as BaseCard } from './classes/card';
import { Ability as BaseAbility } from './classes/ability';
import { AncientAbility as BaseAncientAbility } from './classes/ancientAbility';
import { Attack as BaseAttack } from './classes/attack';
import { Set as BaseSet } from './classes/set';
import { SubType as BaseSubType } from './classes/subType';
import { SuperType as BaseSuperType } from './classes/superType';
import { Type as BaseType } from './classes/type';
export namespace PokemonTCG {
@ -19,21 +16,12 @@ export namespace PokemonTCG {
export const Ability = BaseAbility;
export type Ability = BaseAbility;
export const AncientAbility = BaseAncientAbility;
export type AncientAbility = BaseAncientAbility;
export const Attack = BaseAttack;
export type Attack = BaseAttack;
export const Set = BaseSet;
export type Set = BaseSet;
export const SubType = BaseSubType;
export type SubType = BaseSubType;
export const SuperType = BaseSuperType;
export type SuperType = BaseSuperType;
export const Type = BaseType;
export type Type = BaseType;
}

View File

@ -1,4 +0,0 @@
export interface IAncientAbility {
name: string;
text: string;
}

View File

@ -1,7 +1,7 @@
export interface IAttack {
cost: string;
convertedEnergyCost: string;
cost: string[];
damage: string;
name: string;
text: string;
damage: string;
convertedEnergyCost: string;
}

View File

@ -1,32 +1,30 @@
import { IAbility } from '../interfaces/ability';
import { IAttack } from '../interfaces/attack';
import { ISet } from '../interfaces/set';
import { ISubType } from '../interfaces/subType';
import { ISuperType } from '../interfaces/superType';
import { IType } from '../interfaces/type';
import { IResistance } from '../interfaces/resistance';
import { IWeakness } from '../interfaces/weakness';
export interface 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;
convertedRetreatCost: number;
evolvesFrom: string;
hp: string;
id: string;
imageUrl: string;
imageUrlHiRes: string;
name: string;
nationalPokedexNumber: number;
number: string;
rarity: string;
resistances: IResistance[];
retreatCost: string[];
series: string;
set: string;
setCode: string;
subtype: string;
supertype: string;
text: string[];
types: string[];
weaknesses: IWeakness[];
}

View File

@ -0,0 +1,4 @@
export interface IResistance {
type: string;
value: string;
}

View File

@ -1,3 +0,0 @@
export interface ISubType {
type: string;
}

View File

@ -1,3 +0,0 @@
export interface ISuperType {
type: string;
}

View File

@ -0,0 +1,4 @@
export interface IWeakness {
type: string;
value: string;
}