Refine Plan for Move Method
I have the feeling this is maybe a good higher-level separation in here. First, I want to make sure that it’s not already in the location that I’m trying to move it to. Then if it isn’t in that location, but it’s in a different location, I want to exit that location. At that point, I’m ready to update
self._location for the
Animal instance and make sure that it points to the new location.
I think this kind of like high-level separation is going to make it a little easier to write the code and for me at least to conceptualize what I’m supposed to do in here and also when I’m supposed to do the different steps, because it seems like they have some sort of logical order to it that I first want to do a couple of checks, then update
self._location and then do a bit more processing where I’m going to make sure that in both of the objects, the relevant attributes are updated accordingly.
Become a Member to join the conversation.