nskins / goby

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

Deep copy of Tile #70

Closed nskins closed 7 years ago

nskins commented 7 years ago

Override the clone method for Tile so that it creates a deep copy. Write a test or two to ensure the proper behavior.

shyam12860 commented 7 years ago

Would it be a better idea to use Marshal.load(Marshal.dump(object) rather than writing something similar to Monster's clone method? https://github.com/nskins/goby/blob/46df10e8e2745235d5fa819a39e43c8167e28ab9/lib/Entity/Monster/monster.rb#L49

nskins commented 7 years ago

Hey @shyam12860. I'm not sure; I haven't used Marshal before. I will look into it when I can. Feel free to try it out, and I'd be a happy to do a code review.

shyam12860 commented 7 years ago

Hey @nskins, sorry about the first 2 commits! There was an issue with rebasing, but I've fixed and removed them, though it still shows up here. The last one is the right one.