• Just a reminder that providing specifics on, sharing links to, or naming websites where ROMs can be accessed is against the rules. If your post has any of this information it will be removed.
  • Ever thought it'd be cool to have your art, writing, or challenge runs featured on PokéCommunity? Click here for info - we'd love to spotlight your work!
  • Which Pokémon Masters protagonist do you like most? Let us know by casting a vote in our Masters favorite protagonist poll here!
  • Red, Hilda, Paxton, or Kellyn - which Pokémon protagonist is your favorite? Let us know by voting in our poll!
  • Welcome to PokéCommunity! Register now and join one of the best fan communities on the 'net to talk Pokémon and more! We are not affiliated with The Pokémon Company or Nintendo.

[Discussion] Interest in a Java Pokemon API?

It is incredibly easy to fork a project, especially on Github. Essentially:

1. Fork (i.e. get your own copy of) the project
2. Make changes
3. Submit changes to your version (commit)
4. Submit a pull request to the original (there's even a button for this)

It was easy to learn, and I've contributed to projects in the past this way without much effort.
 
I'm actually creating a Mystery Dungeon kit, in a similar format. As for interfaces, I learnt the main use of them when creating another game. This is where Interfaces > Classes.

Say we have an Ability. Ability is a class. Then, we have a Pokemon, with it's updateState method.
Ability has a method. This method is called effect(), and receives a Pokemon. It then does everything it needs to.

Now. Let's say there are 10 abilities. We would like to avoid creating 600+ files for Pokemon, so we have 1 generic class that will do everything for us (Maybe some other helper classes too).

The updateState method looks something like this:
Spoiler:


This is ridiculous. For every ability in the game, we add an extra 2 lines, and, with secondary abilities, that's 4 lines per ability!
However, with Ability as an interface, it's one line!
this.primaryAbility.effect()!
Sure, more classes, but you could narrow them down. You'd find a way :)
 
Thank you for the pull request, Anglican. I will be putting up something more official for this project in the Resources section when I have time.
 
Why hardcoding the abilities and moves? Register all the altering effects you need these skills (we'll call abilities and moves "skills") to know about then create a small program to create skills and register effects to them. Good abstraction will be needed in this scenario and this kind of system is exactly what I am planning for in PokeSharp.
 
Back
Top