Head first C # chapter 12th review and foresight page535

Source: Internet
Author: User

 

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.


Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.