nskins / goby

Command-line role-playing game framework
MIT License
122 stars 56 forks source link

Refactor Shop Class #94

Closed nskins closed 7 years ago

nskins commented 7 years ago

Rewrite the main loop of the running a Shop event. Include a suite of tests that cover all those lines and any other functions of the class.

hd719 commented 7 years ago

Hey @nskins can I work on this?

nskins commented 7 years ago

Yes, that's fine. Overall, I'm looking to reduce the "depth" of if-else statements (too many nested-if-else right now), add string literals for the error messages, write functions to encapsulate buying and selling, make the code more Rubyish (wherever possible), and write tests over all the Shop functions. We should write tests first.

When you're ready, you can send pull request(s) to the refactor branch. Let me know if you have questions. Thanks.

nskins commented 7 years ago

Hi @hd719, how's this issue coming along? I'd like it finished up in the next few days, so I'd be willing to take over if you haven't done much yet. Maybe I could assign you to a different issue? This one might be a bit complex, now that I think of it.

hd719 commented 7 years ago

Hey @nskins you can take this over! If you have any beginner level issues please do assign.

-Thank you!

AdManteza commented 7 years ago

@nskins can i take a stab at this? seems interesting :)

AdManteza commented 7 years ago

I reckon I can start with Shop#run ?

nskins commented 7 years ago

@hd719, thanks! I will let you know about something more beginner-level soon. @AdManteza, I'd like to do this one myself. Thank you for your willingness to contribute - I will be putting up more issues in the near future, so please stay tuned!

AdManteza commented 7 years ago

@nskins cool! it was just when i saw Shop#run my refactor senses started tingling 😆