tehp / OpenPoGoWeb

Web View for OpenPoGoBot
77 stars 58 forks source link

Refactor main.js into modules #106

Closed wchill closed 8 years ago

wchill commented 8 years ago

Since main.js is so massive, I've tried to refactor it into more files.

It makes use of ES6 classes for holding and manipulating data and Promises (thanks to Bluebird.js) to clean up the code.

Some redundant code was also removed.

@OpenPoGo/maintainers

julienlavergne commented 8 years ago

In Pokedex.js, I had to change entry['id'] = entryData.pokedex_entry_number; to entry['id'] = entryData.pokemon_id;. Not sure though if it is a problem of the bot or the js.

Beside that, IV sort is not working in Pokemon list.

wchill commented 8 years ago

@Anakin5 please link me to the commit of the bot that you are using.

julienlavergne commented 8 years ago

https://github.com/PokemonGoF/PokemonGo-Bot/tree/dev

BobbyWibowo commented 8 years ago

Tested 78be9e80cf636c531e044c97671a0dcc2892e93d. I had to edit a few bits, such as the one @Anakin5 said. I also had to remove WebSockets implementation because I was using PokemonGo-Bot. But other than that, it seems to be working just fine.

EDIT: I seem to have some issues with multi users though. EDIT2: Never mind, fixed in my personal build.

BobbyWibowo commented 8 years ago

Shouldn't getSortedPokemon function be within Pokemon class instead of Player?

wchill commented 8 years ago

@BobbyWibowo maybe. I set it up that way because the Pokemon class is for individual Pokemon only. I can look into making it a static method.

BobbyWibowo commented 8 years ago

@wchill Alrighty, sounds fair enough.

wchill commented 8 years ago

Needs major rebasing. Closing for now.