Hey guys,
Back with another random API suggestion to make life easier (well, my life at least
).
When a |request|REQUEST arrives as detailed here https://github.com/smogon/pokemon-showdown/blob/master/sim/SIM-PROTOCOL.md we're told the moves available like so
```
"active": [
{
"moves": [
{
"move": "Light Screen",
"id": "lightscreen",
"pp": 48,
"maxpp": 48,
"target": "allySide",
"disabled": false
},
[...]
]
}
],
```
As well as additional stuff like zmoves etc etc.
Pokemon on the side are given as Active or not like:
```
[..]
"ident": "p2: Ledian",
"active": true,
[..]
```
I'd like to identify the pokemon referenced by data blocks in 'active'.
In singles battles this isn't a problem (since only one has active:true) but in double/triple battles things get slightly more .. fun .. to figure out. At the moment I figure this out by checking who is active on the side and what move(s) they have (yes writing this pains my soul). This also raises the question of what happens if a player in doubles uses two pokemon with the same moveset
(I don't know why someone would do this but .. hey).
I'd like to suggest that the structs in 'active' give some kind of reference to a pokemon in 'side' (perhaps the 'ident' field, their index on the team or .. anything really). Or of course we could go the other way and have pokemon in 'side' reference their active position (like p2a, p1b) or something.
Back with another random API suggestion to make life easier (well, my life at least

When a |request|REQUEST arrives as detailed here https://github.com/smogon/pokemon-showdown/blob/master/sim/SIM-PROTOCOL.md we're told the moves available like so
```
"active": [
{
"moves": [
{
"move": "Light Screen",
"id": "lightscreen",
"pp": 48,
"maxpp": 48,
"target": "allySide",
"disabled": false
},
[...]
]
}
],
```
As well as additional stuff like zmoves etc etc.
Pokemon on the side are given as Active or not like:
```
[..]
"ident": "p2: Ledian",
"active": true,
[..]
```
I'd like to identify the pokemon referenced by data blocks in 'active'.
In singles battles this isn't a problem (since only one has active:true) but in double/triple battles things get slightly more .. fun .. to figure out. At the moment I figure this out by checking who is active on the side and what move(s) they have (yes writing this pains my soul). This also raises the question of what happens if a player in doubles uses two pokemon with the same moveset

I'd like to suggest that the structs in 'active' give some kind of reference to a pokemon in 'side' (perhaps the 'ident' field, their index on the team or .. anything really). Or of course we could go the other way and have pokemon in 'side' reference their active position (like p2a, p1b) or something.