We are building a turn-based system.
TheGo
() Methods should all be called in every round of our simulator, or every collection. Each round can be any period of time
...
For example, a round can be
10
Seconds, or
60
Second, or
10
Minutes.
Each round is represented as a frame in an animation, so each round of the world changes a little bit.
The key is that every round will affect every object in the world. Check whether more bees need to be added in each round of the beehive. Then each bee runs round, moving a little distance to the destination or doing a small action, and getting older. Then each flower runs round, generating a little pollen and getting older. This is exactlyWorld
Done: it determines each time
World
Of
Go
() The method is called, and each object receives a round of action.
An important principle of object-oriented we use in simulators is encapsulation. Let's see if you can find two encapsulation examples in each class based on the observed classes we have already written.