Update card definition
This commit is contained in:
@ -4,6 +4,6 @@ export class Ability implements IAbility {
|
||||
name: string;
|
||||
text: string;
|
||||
type: string;
|
||||
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
@ -1,8 +0,0 @@
|
||||
import { IAncientAbility } from '../interfaces/ancientAbility';
|
||||
|
||||
export class AncientAbility implements IAncientAbility {
|
||||
name: string;
|
||||
text: string;
|
||||
|
||||
constructor() {}
|
||||
}
|
||||
@ -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() {}
|
||||
}
|
||||
@ -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';
|
||||
}
|
||||
|
||||
@ -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;
|
||||
});
|
||||
}
|
||||
|
||||
}
|
||||
@ -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;
|
||||
});
|
||||
}
|
||||
}
|
||||
@ -15,5 +15,5 @@ export class Type implements IType {
|
||||
.then(response => {
|
||||
return response;
|
||||
});
|
||||
}
|
||||
}
|
||||
}
|
||||
12
src/index.ts
12
src/index.ts
@ -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;
|
||||
}
|
||||
@ -1,4 +0,0 @@
|
||||
export interface IAncientAbility {
|
||||
name: string;
|
||||
text: string;
|
||||
}
|
||||
@ -1,7 +1,7 @@
|
||||
export interface IAttack {
|
||||
cost: string;
|
||||
convertedEnergyCost: string;
|
||||
cost: string[];
|
||||
damage: string;
|
||||
name: string;
|
||||
text: string;
|
||||
damage: string;
|
||||
convertedEnergyCost: string;
|
||||
}
|
||||
@ -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[];
|
||||
}
|
||||
4
src/interfaces/resistance.ts
Normal file
4
src/interfaces/resistance.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export interface IResistance {
|
||||
type: string;
|
||||
value: string;
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
export interface ISubType {
|
||||
type: string;
|
||||
}
|
||||
@ -1,3 +0,0 @@
|
||||
export interface ISuperType {
|
||||
type: string;
|
||||
}
|
||||
4
src/interfaces/weakness.ts
Normal file
4
src/interfaces/weakness.ts
Normal file
@ -0,0 +1,4 @@
|
||||
export interface IWeakness {
|
||||
type: string;
|
||||
value: string;
|
||||
}
|
||||
Reference in New Issue
Block a user