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

Refactor Robot #38

Open
mrhead opened this issue Jan 3, 2014 · 3 comments
Open

Refactor Robot #38

mrhead opened this issue Jan 3, 2014 · 3 comments

Comments

@mrhead
Copy link
Owner

mrhead commented Jan 3, 2014

Robot class is really growing. And I do not like it.

https://github.com/mrhead/ruby_arena/blob/master/lib/robot.rb # right now, it is 198 LOC

Probably we should extract some logic from it and also somehow refactor initialize method.

From beginning there was also Tank class and Robot was composed from Ai, Tank and Command parser. But as soon as I started to adding functionality Tank and Robot became really entangled with a lot of duplication... I did not like it so I've merged Tank into the Robot.

But right now Robot is really big so it needs to be refactored somehow.

Any ideas?

@mrhead
Copy link
Owner Author

mrhead commented Jan 3, 2014

See codeclimate for Robot and RobotRenderer: https://codeclimate.com/github/mrhead/ruby_arena/code?q=rating%3AD

I am crying right now :(. :D

@orendon
Copy link
Contributor

orendon commented Jan 3, 2014

First thing that comes to my mind is splitting "robot devices" into separate classes (e.g Radar, Gun)

Xmas was a hard time for me to look at the codebase, unless you're already working on it, I would love to take care of this as a chance to get in touch with the code while refactoring it

@mrhead
Copy link
Owner Author

mrhead commented Jan 3, 2014

I am not working at this right now, feel free to work on this. Thanks!

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

No branches or pull requests

2 participants