smogon / pokemon-showdown

Pokémon battle simulator.
https://pokemonshowdown.com
MIT License
4.74k stars 2.77k forks source link

Put data into its own module #92

Closed fent closed 11 years ago

fent commented 12 years ago

It would be better if most of the data in the data directory was put into its own module. That way it can easily be required by other pokemon apps that may want to use the data.

Everything will be easier to maintain if it's modularized properly. This repo represents the website pokemon showdown, but it doesn't have to include all of the pokemon data and battle algorithms.

l1bbcsg commented 11 years ago

Actually, it represents the application, does it not? So it should be the opposite.

I agree though, the vital data should be separated from metagame and server-specific data (tiers, ratings, etc...), which, I believe, actually doesn't even belong to this repo. It's hard to follow the development when commit log is flooded with unimportant changes in tiers/bans/ratings...

Zarel commented 11 years ago

The data in the data directory is only loaded by the tools.js module. I presume this is good enough?

fent commented 11 years ago

Yes that works. The desired data can be loaded with something like

var pokedex = require('Pokemon-Showdown/data/pokedex');

Thanks.