Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce modular approach via AtlantisModule class #5

Open
Ravaelles opened this issue Apr 12, 2016 · 3 comments
Open

Introduce modular approach via AtlantisModule class #5

Ravaelles opened this issue Apr 12, 2016 · 3 comments

Comments

@Ravaelles
Copy link
Owner

Discussion and suggestions are greatly welcomed in Enhancement threads!

Suggested by Michal Certicky:
Implement a class/interface that would allow defining modules.

My example solution: We introduce AtlantisModule class that overrides with empty body all important methods like onFrame , onUnitCreate etc. Then basically all of the core Atlantis functionality can extend AtlantisModule and this way we can achieve full (?) modularity and easily add/remove modules. Also add modules from different repositories.

Advantage of class over interface is that new module is not forced to override all possible methods, actually it can just override one method (e.g. onFrame) and still work.

@certicky
Copy link
Collaborator

That's pretty much exactly what I meant :) So AtlantisModule will be an abstract class and all the other "module" classes like AtlantisWorkerCommander or AtlantisScoutManager will extend it, right?

@Ravaelles
Copy link
Owner Author

Yes, that is the plan. There may be some problems like e.g. normally I'm always using static methods, because they're super clear to use and it's impossible (I think) to be using inheritance with static methods so I may need to run non-static method calls, which could lead to decreased code readibility. E.g. it would look something like:
module.update()
instead of:
AtlantisPainter.update();

But we will gain modularity. I will aim at approach that will be very clear, that's for sure.

@certicky
Copy link
Collaborator

Oh, I see.
I actually expected that each module would be instantiated when the bot is started and would be able to hold its own properties/variables. So when I'm making my own module, I can hold some specific variables inside it.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants