There's something not quite right about our current
OrreryDrawable interface. For instance, you could change the motion of the Earth without ever changing the Moon. That's ridiculous! The Moon would never stay still while the Earth orbited the Sun.
There is also a potential bug in the code such as: if you update the Earth's position after updating the Moon's position, the Moon will not update itself. We clearly need a better way of accessing our position setters.
Let's change our
OrreryDrawable so that you can only set the Earth's rotation and the Moon's rotation at the same time. This is shown in the following steps:
OrreryDrawableto have the features that we want. Open up