Raed Tabani wrote:Thanks man, it did the trick for me although im wondering why is checking the type of sth is considered bad practise?
That is correct. The problem is not using enter later on. You need to push the enter key more frequently. Then your code would be easier to read.
Raed Tabani wrote: . . . whenever i open a curly brace my hand autmatically smashes enter . . .
No. I have already told you what getClass() does.
Raed Tabani wrote: . . . As for .getClass() does it mean that it returns an object of the calling class . . .
Not sure I understand that, but it doesn't sound good.
Raed Tabani wrote: . . . Would it be a better idea to create objects for comparison reasons only?
And as several people myself included have already told you, that is poor design.
For me, the reason i used .getClass.equal() is that i needed a way to check " which subClass does this refrence index point to" is it a healingmove or a fightingmove as different actions are to be taken.
Yeast devil! Back to the oven that baked you! And take this tiny ad too:
ScroogeXHTML - small and flexible RTF to HTML converter libraryhttps://coderanch.com/t/710903/ScroogeXHTML-RTF-HTML-XHTML-converter