Battling

- singles works (teampreview , attackign and switching and mega evolving)
- doubles works but no targetting yet (TODO, not sure about team preview?)
- Fixed a problem in the request case when we switch

TODO :

- a better UI
- targetting system for doubles
- teampreview for doubles
- canceling support?


Its handled (idx iterates though the forceswitch aray when we find an
active pokemon, hence it shouls be properly mapped
On 29 Dec 2014 15:13, "Nam Thai" <notifications@github.com> wrote:

> In app/src/main/java/com/pokemonshowdown/data/BattleMessage.java
> <https://github.com/NamTThai/PokemonShowdownAndroidClient/pull/60#discussion-diff-22312633>
> :
>
> > +                        battleFragment.setTeamPreview(false);
> > +                    }
> > +
> > +                    if (requestJson.has("wait")) {
> > +                        battleFragment.setWaiting(requestJson.getBoolean("wait"));
> > +                    } else {
> > +                        battleFragment.setWaiting(false);
> > +                    }
> > +
> > +                    if (requestJson.has("forceSwitch")) {
> > +                        JSONArray forceSwitchJsonArray = requestJson.getJSONArray("forceSwitch");
> > +                        int idx = 0;
> > +                        for (PokemonInfo info : battleFragment.getPlayer1Team()) {
> > +                            if (info.isActive()) {
> > +                                info.setForceSwitch(forceSwitchJsonArray.getBoolean(idx));
> > +                                idx++;
>
> Are you sure? What if in double battle only one pkm faint?
>
> —
> Reply to this email directly or view it on GitHub
> <https://github.com/NamTThai/PokemonShowdownAndroidClient/pull/60/files#r22312633>
> .
>