ihhub / fheroes2

fheroes2 is a recreation of Heroes of Might and Magic II game engine.
https://ihhub.github.io/fheroes2/
GNU General Public License v2.0
2.73k stars 376 forks source link

AI code refactoring #8986

Closed oleg-derevenetz closed 3 months ago

oleg-derevenetz commented 3 months ago

This PR contains no functional changes, just AI code simplification and refactoring.

In the master branch, for historical reasons, the AI code is organized in such a way that there is a rudimentary support for different AI implementations. I believe it looks redundant at the moment. All we have for now is a single AI implementation called "normal" and it does absolutely everything, therefore, in my opinion, there is no need for an extra layer, which just contains a bunch of methods that do literally nothing.

With this PR:

If in the future we suddenly still need to support various AI engines, it will be possible to make corresponding changes. But for now, the current AI code architecture looks like a bit of overengineering, hence this PR.

oleg-derevenetz commented 3 months ago

looks like it's never going to happen

Never say never :) However, I think that if such a need arises, some general AI interface will be created once again according to real needs at that moment.

ihhub commented 3 months ago

@oleg-derevenetz , thank you so much for these changes!