OpenKeeper icon indicating copy to clipboard operation
OpenKeeper copied to clipboard

Remove deprecated code

Open ArchDemons opened this issue 4 years ago • 9 comments

It is very difficult to match the new code with the old one. It is very difficult to understand which code has already been ported, and which is not yet.

I suggest in deprecated classes to add "see" documentation help to find a new classes. I propose to clear methods whose functionality has been transferred to new classes, while maintaining the health of the code.

So we will know which code we still need, and which we have 100% transferred to the new classes.

ArchDemons avatar Apr 12 '20 13:04 ArchDemons

Basically

  • toniarts.openkeeper.ai.creature.*
  • toniarts.openkeeper.world.*

are deprecated.

Most of the functionality have been ported. It is not exactly 1:1, but pretty close. It was certainly easier to port that way than to come up with totally new structure on top of a totally new architecture. Notable exceptions are:

  • Effects

Some minor things are still left but I would still say that we have more than we used to.

tonihele avatar Apr 12 '20 13:04 tonihele

We must remove methods that are no longer used and do not contain valuable code. For instance,

public void someMethod() {
   // deprecated
}

ArchDemons avatar Apr 12 '20 14:04 ArchDemons

Remember the @Deprecated annotation :)

tonihele avatar Apr 12 '20 14:04 tonihele

But annotation on method. Not only on class. So we will know that the method is completely transferred to a new class.

ArchDemons avatar Apr 12 '20 15:04 ArchDemons

I would even say that you need to chage deprecated classes into dummy classes. There will be methods in the classess, but without logic

ArchDemons avatar Apr 12 '20 16:04 ArchDemons

The old code being still around is indeed confusing.

Trass3r avatar Mar 09 '22 22:03 Trass3r

I think I can remove them soon. There is only the effects I wish to salvage, but other than that I don't think there are any references anymore. Moving MainMenu and the ModelViewer was the last big work

tonihele avatar Mar 11 '22 16:03 tonihele

Yeah this should be done before development comes to a halt since it requires deep knowledge about all the code.

Trass3r avatar Apr 12 '23 04:04 Trass3r