-
Notifications
You must be signed in to change notification settings - Fork 0
/
Pokemon Modal Data Model.txt
executable file
·74 lines (60 loc) · 1.74 KB
/
Pokemon Modal Data Model.txt
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
Pokemon Modal Data Model
Crude ascii mockup:
+================================================
|
| +------------------+ +------------------+
| | No. Name Ht Wt | | Move Pwr Type P/S|
| |------------------| | Desc |
| | === | | |
| | < Sprite > | | Ability |
| | === | | Desc |
| < | | | | Evo |
| | Types:A/B | | 1 > 2 > 3 |
| +------------------+ +------------------+
| +==================+ +==================+
| |Flavor text Flavor| | |
| |Text Flavor Text | ||A| |M| |E| |B| |
| +==================+ +==================+
|
+=======================================================
A = Abilities
M = Moves
E = Evolution Chain
B = Base Stats
moveURLs = [];
tmpMove = "";
currentPokemonMoves = [];
for(let i=0;i<this.details.moves.length;i++)
let tmpMove = await this.fetchMoveDetails(this.details.moves[i].url)
currentPokemonMoves.push(tmpMove);
}
async fetchMoveDetails(url)
let a = await fetch(url)
.then(response => response.json())
.then(response => {
moveDetails =
{
name: response.name,
type: response.type.name,
power: response.power
attr: response.damage_class.name
accuracy: response.accuracy
}
return moveDetails;
})
class Move
{
constructor(moveID)
{
this.moveID = moveID
this.baseURL = 'https://pokeapi.co/api/v2/move/'
this.fetchURL = `{$this.baseURL}${this.moveID}`;
}
async getMoveProperties()
{
let a = await fetch(this.fetchURL)
.then(response => response.json())
.then(response => {
}
}
}