breve Documentation: version 1.9 | ||
---|---|---|
<< previous | Chapter 2. "steve" Language Reference | next >> |
The controller object is the foundation of a breve breve simulation. The controller object is a single instance which acts as the "boss" for the simulation. When the simulation starts, it is the controller object which is responsible for creating and setting up the rest of the simulation. The controller object is the only object which is automatically instantiated when the simulation begins.
The first step in writing a breve simulation is to create a controller class which will setup and manage the simulation. The controller class you create must be a subclass of the class Control or one of its subclasses. How to do this is described in the rest of this chapter.
As shown in the previous section (Section 2.2), the controller object is specified at the top of your simulation file using the word controller:
Controller myControllerClass. |
init
method. Details on constructing classes and implementing an init
method
are described in more detail in the rest of this chapter.In addition to setting up the simulation, the controller object is also used as a liaison between simulation objects, the breve engine and the user. While other instances may come and go, the controller object is forever. The controller class contains a great number of methods for controlling the behavior of simulations, the appearance of the graphical display and interactions with the user interface. See the class documentation on Control for more information. As with some of the other topics covered in this section, the significance of these concepts will become clearer in the rest of the documentation.
<< previous | breve Documentation table of contents | next >> |
A Simple Example | up | Building Classes |