From a084077543c4b1176d3910afc749949647083756 Mon Sep 17 00:00:00 2001 From: CptSpaceToaster Date: Sat, 6 Jul 2019 15:31:08 -0400 Subject: [PATCH] Update card definition --- src/classes/ability.ts | 2 +- src/classes/ancientAbility.ts | 8 ----- src/classes/attack.ts | 4 +-- src/classes/card.ts | 50 +++++++++++++++----------------- src/classes/subType.ts | 20 ------------- src/classes/superType.ts | 19 ------------ src/classes/type.ts | 2 +- src/index.ts | 12 -------- src/interfaces/ancientAbility.ts | 4 --- src/interfaces/attack.ts | 6 ++-- src/interfaces/card.ts | 44 ++++++++++++++-------------- src/interfaces/resistance.ts | 4 +++ src/interfaces/subType.ts | 3 -- src/interfaces/superType.ts | 3 -- src/interfaces/weakness.ts | 4 +++ 15 files changed, 60 insertions(+), 125 deletions(-) delete mode 100644 src/classes/ancientAbility.ts delete mode 100644 src/classes/subType.ts delete mode 100644 src/classes/superType.ts delete mode 100644 src/interfaces/ancientAbility.ts create mode 100644 src/interfaces/resistance.ts delete mode 100644 src/interfaces/subType.ts delete mode 100644 src/interfaces/superType.ts create mode 100644 src/interfaces/weakness.ts diff --git a/src/classes/ability.ts b/src/classes/ability.ts index 19fecac..7a40035 100644 --- a/src/classes/ability.ts +++ b/src/classes/ability.ts @@ -4,6 +4,6 @@ export class Ability implements IAbility { name: string; text: string; type: string; - + constructor() {} } \ No newline at end of file diff --git a/src/classes/ancientAbility.ts b/src/classes/ancientAbility.ts deleted file mode 100644 index 4017e3d..0000000 --- a/src/classes/ancientAbility.ts +++ /dev/null @@ -1,8 +0,0 @@ -import { IAncientAbility } from '../interfaces/ancientAbility'; - -export class AncientAbility implements IAncientAbility { - name: string; - text: string; - - constructor() {} -} \ No newline at end of file diff --git a/src/classes/attack.ts b/src/classes/attack.ts index c37acd5..e3f4723 100644 --- a/src/classes/attack.ts +++ b/src/classes/attack.ts @@ -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() {} } \ No newline at end of file diff --git a/src/classes/card.ts b/src/classes/card.ts index f4ea3e6..48504ab 100644 --- a/src/classes/card.ts +++ b/src/classes/card.ts @@ -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'; } diff --git a/src/classes/subType.ts b/src/classes/subType.ts deleted file mode 100644 index 68406c9..0000000 --- a/src/classes/subType.ts +++ /dev/null @@ -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 { - return QueryBuilder.all(this) - .then(response => { - return response; - }); - } - -} \ No newline at end of file diff --git a/src/classes/superType.ts b/src/classes/superType.ts deleted file mode 100644 index ba8af4b..0000000 --- a/src/classes/superType.ts +++ /dev/null @@ -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 { - return QueryBuilder.all(this) - .then(response => { - return response; - }); - } -} \ No newline at end of file diff --git a/src/classes/type.ts b/src/classes/type.ts index 7c2d1f0..4238371 100644 --- a/src/classes/type.ts +++ b/src/classes/type.ts @@ -15,5 +15,5 @@ export class Type implements IType { .then(response => { return response; }); - } + } } \ No newline at end of file diff --git a/src/index.ts b/src/index.ts index 7ed86cc..e5409a8 100644 --- a/src/index.ts +++ b/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; } \ No newline at end of file diff --git a/src/interfaces/ancientAbility.ts b/src/interfaces/ancientAbility.ts deleted file mode 100644 index 9e98422..0000000 --- a/src/interfaces/ancientAbility.ts +++ /dev/null @@ -1,4 +0,0 @@ -export interface IAncientAbility { - name: string; - text: string; -} \ No newline at end of file diff --git a/src/interfaces/attack.ts b/src/interfaces/attack.ts index 3312c6f..0d303ad 100644 --- a/src/interfaces/attack.ts +++ b/src/interfaces/attack.ts @@ -1,7 +1,7 @@ export interface IAttack { - cost: string; + convertedEnergyCost: string; + cost: string[]; + damage: string; name: string; text: string; - damage: string; - convertedEnergyCost: string; } \ No newline at end of file diff --git a/src/interfaces/card.ts b/src/interfaces/card.ts index 37a8e45..53cc45d 100644 --- a/src/interfaces/card.ts +++ b/src/interfaces/card.ts @@ -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[]; } \ No newline at end of file diff --git a/src/interfaces/resistance.ts b/src/interfaces/resistance.ts new file mode 100644 index 0000000..22c86fd --- /dev/null +++ b/src/interfaces/resistance.ts @@ -0,0 +1,4 @@ +export interface IResistance { + type: string; + value: string; +} \ No newline at end of file diff --git a/src/interfaces/subType.ts b/src/interfaces/subType.ts deleted file mode 100644 index 658a891..0000000 --- a/src/interfaces/subType.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISubType { - type: string; -} \ No newline at end of file diff --git a/src/interfaces/superType.ts b/src/interfaces/superType.ts deleted file mode 100644 index 92ba927..0000000 --- a/src/interfaces/superType.ts +++ /dev/null @@ -1,3 +0,0 @@ -export interface ISuperType { - type: string; -} \ No newline at end of file diff --git a/src/interfaces/weakness.ts b/src/interfaces/weakness.ts new file mode 100644 index 0000000..fd25195 --- /dev/null +++ b/src/interfaces/weakness.ts @@ -0,0 +1,4 @@ +export interface IWeakness { + type: string; + value: string; +} \ No newline at end of file