• Our software update is now concluded. You will need to reset your password to log in. In order to do this, you will have to click "Log in" in the top right corner and then "Forgot your password?".
  • 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?

16
Posts
11
Years
  • Seen Apr 9, 2013
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.
 

UnderMybrella

Wandering Programmer
280
Posts
13
Years
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 :)
 
16
Posts
11
Years
  • Seen Apr 9, 2013
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.
 
99
Posts
14
Years
  • Seen Jan 16, 2023
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