Closed andidevi closed 6 years ago
Quite a few changes, will review when I have time thank you!
I know, but it's less than it seems:
Several things:
abstract static
. But no, you need an instance.But… on the other hand I can see it gets rid of the hardcoded names, better supports things like setting a price and so on. I just wish there was a more straightforward way to do this rather than using classes to create instances of other classes.
I'd like to discuss this a bit more but first I'm pushing a automatic code reformat to your branch. Edit: Nevermind I can't.
There are good reason to follow Patterns, as many people have been thinking about, how to implement things most straightforward. Programming feels more abstract if you aren't used to them but if you can identify the patterns, its more like building a wall out of bricks. https://en.wikipedia.org/wiki/Software_design_pattern
One could make the effect an inner class of the factory, thats how it is done usually. But I decided against it, to keep the necessary level of programming skills low to give more people the chance to implement effects.
I don't even feel bad about the boiler plates. This is how java works and it is written by the IDE aka Adroid Studio.
Edit: how to enable it? but I'll throw away my branch if you merge and keep stick to your master.
But I decided against it, to keep the necessary level of programming skills low to give more people the chance to implement effects.
I don't think this is a valid point. When you're creating a new effect you probably copy paste an existing one anyway :P And if your skills are this low you'd have bigger trouble implementing the effect than copy pasting the file. Please change that? And I can merge then. Don't worry about code format, I'll run it on the whole project once merged.
Just to have it clear: you want to have private classes inside the factory?
However it's often done, like you said.
Could you supply an editorconfig with you settings?
Go to "File->Settings->Editor->Code Style". At the bottom of the right pane there is a section for Editor Config options, which now includes an "Export" button.
It's best to put the .editorconfig to the root of the repo. https://stackoverflow.com/questions/44694132/editorconfig-in-android-studio
Then the next try should be formatted accordingly.
Noted, but I can't right now. No access to my laptop.
see pull request #43
Closing as #43 got merged.
This enables