// $Revision: 1.12 $ // Copyright (C) 1995 Taligent, Inc. All rights reserved. #if 0 --------------------------------------------------------------------------- > Class: | TExplodingActor > Taxonomy Category: | ConcurrentGraphics | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | TAbstractActor > Inherited By: | TAsteroid | TBullet | TShip > Purpose: | Abstract class for actors that explodes. This class also provides an implementation for movement including a vector velocity and a position. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | TAsteroid, TShip, TBullet. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::Move ; | virtual void Move (const TTime & interval) > Interface Category: | Sample. > Purpose: | MMoving override. Adjusts object's position to reflect the passage of time. > Calling Context: | Called by TMoverThread. > Parameters: = const TTime & interval -Amount of time that has passed. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::Draw ; | virtual void Draw (TGrafPort & port) const > Interface Category: | Sample. > Purpose: | MRefreshable override. Draws object in specified port. The graphic returned by GetGraphics is drawn according to the object's position. > Calling Context: | Called by TRefreshThread. > Parameters: = TGrafPort & port -Port to draw in. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::GetPosition ; | TGPoint GetPosition () const > Interface Category: | Sample. > Purpose: | Returns the position of this object. Position is defined as the center of the object's graphic. > Calling Context: | Called by TBoundingBoxBehavior. > Parameters: = Takes no parameters. > Return Value: | Position of this actor. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::SetPosition ; | virtual void SetPosition (const TGPoint & newPosition) > Interface Category: | Sample. > Purpose: | Sets the position of an actor. The actor is redrawn at the new position. > Calling Context: | Called internally by Move and by TBoundingBoxBehavior. > Parameters: = const TGPoint & newPosition -New position. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::GetVelocity ; | TGPoint GetVelocity () const > Interface Category: | Sample. > Purpose: | Returns the current velocity of this actor. > Calling Context: | Called by TBoundingBoxBehavior. > Parameters: = Takes no parameters. > Return Value: | Velocity of this object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::SetVelocity ; | virtual void SetVelocity (const TGPoint & newVelocity) > Interface Category: | Sample. > Purpose: | Sets new velocity for this actor. > Calling Context: | Called by TBoundingBoxBehavior. > Parameters: = const TGPoint & newVelocity -New velocity. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::GetBounds ; | virtual TGRect GetBounds () const > Interface Category: | Sample. > Purpose: | MRefreshable override. Returns the bounds of actor when rendered. > Calling Context: | Called by TRefreshThread, TBoundingBoxBehavior, and TCollisionBehavior. > Parameters: = Takes no parameters. > Return Value: | Bounds in which actor will render when Draw is called. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::GetGraphic ; | virtual const MGraphic & GetGraphic () const > Interface Category: | Sample. > Purpose: | Returns the graphic used when this actor is drawn. > Calling Context: | Called by Draw and GetBounds. > Parameters: = Takes no parameters. > Return Value: | Graphic to be rendered when object is drawn. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::Explode ; | virtual void Explode () > Interface Category: | Sample. > Purpose: | BOOM! The actor explodes. > Calling Context: | Called by TExplosion behavior when two actors collide. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::operator =; | TExplodingActor & operator =(const TExplodingActor & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TExplodingActor & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::~ TExplodingActor ; | virtual ~ TExplodingActor () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::TExplodingActor ; | 1. TExplodingActor () | 2. TExplodingActor (const TGPoint & initialPosition, const TGPoint & velocity =TGPoint :: kOrigin) | 3. TExplodingActor (const TExplodingActor & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. Initial position is at the origin and initial velocity is zero. | 2. Creates actor at specified position moving at specified velocity. | 3. Copy constructor. Copies the position and velocity of source actor. > Calling Context: | 1. Called by the stream-in operators and clients. | 2. Called by derived classes and clients. | 3. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TGPoint & initialPosition -Position of objects center. = 2. const TGPoint & velocity =TGPoint :: kOrigin -Velocity at which object is traveling through space. = 3. const TExplodingActor & source -Actor to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplodingActor::IsA ; | virtual bool IsA (const TType & type) const > Interface Category: | Sample. > Purpose: | Tests if a derived class of MColliding inherits from another class. > Calling Context: | Called by clients, usually TCollisionBehavior. > Parameters: = const TType & type -TType representing the class whose inheritance you wish to test for. > Return Value: | Returns true if derived class inherits from specified class. By default true is only returned for a value of TType(static_type_info(MColliding)); > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Derived classes should _always_ override this member function. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TAsteroid > Taxonomy Category: | ConcurrentGraphics | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | TExplodingActor > Inherited By: | TLargeAsteroid | TMediumAsteroid | TSmallAsteroid > Purpose: | Abstract class that provides a base class for asteroids. This class is used by TExplosionBehavior to group asteroids for identification. All descendants will return true from IsA(TToken("TAsteroids")). > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | TSmallAsteroids, TMediumAsteroid, TLargeAsteroid. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAsteroid::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAsteroid::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAsteroid::operator =; | TAsteroid & operator =(const TAsteroid & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TAsteroid & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAsteroid::~ TAsteroid ; | virtual ~ TAsteroid () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAsteroid::TAsteroid ; | 1. TAsteroid (const TGPoint & initialPosition, const GCoordinate & speed) | 2. TAsteroid (const TAsteroid & source) | 3. TAsteroid () > Interface Category: | Sample. > Purpose: | 1. Constructs an asteroid at specified position moving at specified speed. | 2. Copy constructor. | 3. Default constructor. > Calling Context: | 1. Called by TSimulationLevel and TLargeAsteroids. | 2. Called to copy an object. | 3. Called by the stream-in operators. > Parameters: = 1. const TGPoint & initialPosition -Initial location of asteroid. = 1. const GCoordinate & speed -Initial speed of asteroid. = 2. const TAsteroid & source -Object to copy. = 3. Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TAsteroid::IsA ; | virtual bool IsA (const TType & type) const > Interface Category: | Sample. > Purpose: | Tests if a derived class of MColliding inherits from another class. > Calling Context: | Called by clients, usually TCollisionBehavior. > Parameters: = const TType & type -TType representing the class whose inheritance you wish to test for. > Return Value: | Returns true if derived class inherits from specified class. By default true is only returned for a value of TType(static_type_info(MColliding)); > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Derived classes should _always_ override this member function. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TSmallAsteroid > Taxonomy Category: | ConcurrentGraphics | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | TAsteroid > Inherited By: | None. > Purpose: | This class implements small asteroids. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | TSmallAsteroids, TMediumAsteroid, TLargeAsteroid. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSmallAsteroid::Explode ; | virtual void Explode () > Interface Category: | Sample. > Purpose: | Causes asteroid to explode and be removed from play. > Calling Context: | Called by TExplosionBehavior. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSmallAsteroid::GetGraphic ; | virtual const MGraphic & GetGraphic () const > Interface Category: | Sample. > Purpose: | TExplodingActor override. Returns small asteroid graphic. > Calling Context: | Called be TExplodingActor::Draw. > Parameters: = Takes no parameters. > Return Value: | Small asteroid graphic. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSmallAsteroid::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSmallAsteroid::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSmallAsteroid::operator =; | TSmallAsteroid & operator =(const TSmallAsteroid & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TSmallAsteroid & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSmallAsteroid::~ TSmallAsteroid ; | virtual ~ TSmallAsteroid () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSmallAsteroid::TSmallAsteroid ; | 1. TSmallAsteroid (const TGPoint & initialPosition, const GCoordinate & speed =kDefaultSpeed) | 2. TSmallAsteroid (const TSmallAsteroid & source) | 3. TSmallAsteroid () > Interface Category: | Sample. > Purpose: | 1. Constructs an asteroid at specified position moving at specified speed. | 2. Copy constructor. | 3. Default constructor. > Calling Context: | 1. Called by TSimulationLevel create asteroids. Called by TMediumAsteroids when they explode. | 2. Called to copy an object. | 3. Called by the stream-in operators. > Parameters: = 1. const TGPoint & initialPosition -Initial location of asteroid. = 1. const GCoordinate & speed -Initial speed of asteroid. = 2. const TSmallAsteroid & source -Object to copy. = 3. Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSmallAsteroid::IsA ; | virtual bool IsA (const TType & type) const > Interface Category: | Sample. > Purpose: | Tests if a derived class of MColliding inherits from another class. > Calling Context: | Called by clients, usually TCollisionBehavior. > Parameters: = const TType & type -TType representing the class whose inheritance you wish to test for. > Return Value: | Returns true if derived class inherits from specified class. By default true is only returned for a value of TType(static_type_info(MColliding)); > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Derived classes should _always_ override this member function. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TMediumAsteroid > Taxonomy Category: | ConcurrentGraphics. | Simulation Subsystem. > Interface Category: | Sample. > Inherits From: | TAsteroid > Inherited By: | None. > Purpose: | This class implements medium-sized asteroids. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::Explode ; | virtual void Explode () > Interface Category: | Sample. > Purpose: | Causes asteroid to explode into TSmallAsteroid objects. > Calling Context: | Called by TExplosionBehavior. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::GetGraphic ; | virtual const MGraphic & GetGraphic () const > Interface Category: | Sample. > Purpose: | Returns graphic used when asteroid is drawn. > Calling Context: | Called by TExplodingActor::Draw. > Parameters: = Takes no parameters. > Return Value: | Graphic used when asteroid is drawn. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::GetDefaultDivision ; | virtual long GetDefaultDivision () const > Interface Category: | Sample. > Purpose: | Returns the number of pieces the asteroid breaks into when it explodes. > Calling Context: | Called by Explode. > Parameters: = Takes no parameters. > Return Value: | The number of pieces the asteroid breaks into when it explodes. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::operator =; | TMediumAsteroid & operator =(const TMediumAsteroid & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TMediumAsteroid & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::~ TMediumAsteroid ; | virtual ~ TMediumAsteroid () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::TMediumAsteroid ; | 1. TMediumAsteroid (const TGPoint & initialPosition, const GCoordinate & speed =kDefaultSpeed) | 2. TMediumAsteroid (const TMediumAsteroid & source) | 3. TMediumAsteroid () > Interface Category: | Sample. > Purpose: | 1. Constructor. | 2. Copy constructor. | 3. Default constructor. > Calling Context: | 1. Called by TSimulationLevel to create new asteroids. | 2. Called to copy an object. | 3. Called by the stream-in operators. > Parameters: = 1. const TGPoint & initialPosition -Initial position. = 1. const GCoordinate & speed =kDefaultSpeed -Initial speed. = 2. const TMediumAsteroid & source -Object to copy. = 3. Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TMediumAsteroid::IsA ; | virtual bool IsA (const TType & type) const > Interface Category: | Sample. > Purpose: | Tests if a derived class of MColliding inherits from another class. > Calling Context: | Called by clients, usually TCollisionBehavior. > Parameters: = const TType & type -TType representing the class whose inheritance you wish to test for. > Return Value: | Returns true if derived class inherits from specified class. By default true is only returned for a value of TType(static_type_info(MColliding)); > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Derived classes should _always_ override this member function. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TLargeAsteroid > Taxonomy Category: | ConcurrentGraphics | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | TAsteroid > Inherited By: | None. > Purpose: | This class implements large-sized asteroids. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::Explode ; | virtual void Explode () > Interface Category: | Sample. > Purpose: | Makes large asteroid explode and removes it from play. > Calling Context: | Called by Explode. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::GetGraphic ; | virtual const MGraphic & GetGraphic () const > Interface Category: | Sample. > Purpose: | Returns graphic used when drawing large asteroids. > Calling Context: | Called by Draw. > Parameters: = Takes no parameters. > Return Value: | Graphic used when drawing large asteroids,. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::GetDefaultDivision ; | virtual long GetDefaultDivision () const > Interface Category: | Sample. > Purpose: | Returns the number of pieces a large asteroid breaks into when it explodes. > Calling Context: | Called by Explode. > Parameters: = Takes no parameters. > Return Value: | The number of pieces a large asteroid breaks into when it explodes > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::operator =; | TLargeAsteroid & operator =(const TLargeAsteroid & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TLargeAsteroid & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::~ TLargeAsteroid ; | virtual ~ TLargeAsteroid () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::TLargeAsteroid ; | 1. TLargeAsteroid (const TGPoint & initialPosition, const GCoordinate & speed =kDefaultSpeed) | 2. TLargeAsteroid (const TLargeAsteroid & source) | 3. TLargeAsteroid () > Interface Category: | Sample. > Purpose: | 1. Constructor | 2. Copy constructor. | 3. Default constructor. > Calling Context: = 1. const TGPoint & initialPosition -Initial location. = 1. const GCoordinate & speed =kDefaultSpeed -Speed of asteroid. | 2. Called to copy an object. | 3. Called by the stream-in operators. > Parameters: = 1. const TGPoint & initialPosition -Initial location. = 1. const GCoordinate & speed =kDefaultSpeed -Speed of asteroid. = 2. const TLargeAsteroid & source -Object to copy. = 3. Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TLargeAsteroid::IsA ; | virtual bool IsA (const TType & type) const > Interface Category: | Sample. > Purpose: | Tests if a derived class of MColliding inherits from another class. > Calling Context: | Called by clients, usually TCollisionBehavior. > Parameters: = const TType & type -TType representing the class whose inheritance you wish to test for. > Return Value: | Returns true if derived class inherits from specified class. By default true is only returned for a value of TType(static_type_info(MColliding)); > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Derived classes should _always_ override this member function. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TBullet > Taxonomy Category: | ConcurrentGraphics | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | TExplodingActor > Inherited By: | None. > Purpose: | The bullet class. Bullets live for a fixed period of time and then remove themselves from play if they haven't exploded. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::Move ; | virtual void Move (const TTime & interval) > Interface Category: | Sample. > Purpose: | Moves bullet. > Calling Context: | Called by TMoverThread. > Parameters: = const TTime & interval -Amount of time that has passed since last move. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::Explode ; | virtual void Explode () > Interface Category: | Sample. > Purpose: | Makes bullet explode and removes it from play. > Calling Context: | Called by TExplosionBehavior. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::GetGraphic ; | virtual const MGraphic & GetGraphic () const > Interface Category: | Sample. > Purpose: | Returns graphic rendered when bullet is drawn. > Calling Context: | Called by Draw. > Parameters: = Takes no parameters. > Return Value: | Graphic rendered when bullet is drawn. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::operator =; | TBullet & operator =(const TBullet & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TBullet & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::~ TBullet ; | virtual ~ TBullet () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::TBullet ; | 1. TBullet () | 2. TBullet (const TGPoint & initialPosition, const TGPoint & velocity, const TTime & lifeSpan =kDefaultLifeSpan) | 3. TBullet (const TBullet & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Creates moving bullets in a specified location. | 3. Copy constructor. > Calling Context: | 1. Called by the stream-in operators. | 2. Called by TShip when its gun is fired. | 3. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TGPoint & initialPosition -Bullet's initial position. = 2. const TGPoint & velocity -Velocity of bullet. = 2. const TTime & lifeSpan =kDefaultLifeSpan -The length of time before the bullet expires. = 3. const TBullet & source -Object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBullet::IsA ; | virtual bool IsA (const TType & type) const > Interface Category: | Sample. > Purpose: | Tests if a derived class of MColliding inherits from another class. > Calling Context: | Called by clients, usually TCollisionBehavior. > Parameters: = const TType & type -TType representing the class whose inheritance you wish to test for. > Return Value: | Returns true if derived class inherits from specified class. By default true is only returned for a value of TType(static_type_info(MColliding)); > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Derived classes should _always_ override this member function. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TShip > Taxonomy Category: | ConcurrentGrahpics | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | TExplodingActor > Inherited By: | None. > Purpose: | This class provides the space ship. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | Multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::Draw ; | virtual void Draw (TGrafPort & port) const > Interface Category: | Sample. > Purpose: | Draws the ship. > Calling Context: | Called by TRefreshThread. > Parameters: = TGrafPort & port -Amount of time that has passed since last refresh occurred. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::PreMove ; | virtual void PreMove (const TTime & interval) > Interface Category: | Sample. > Purpose: | Adjusts the ship's position and rotation if the ship is thrusting or rotating. > Calling Context: | Called by TMoverThread. > Parameters: = const TTime & interval -Elapsed time since last move. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::GetBounds ; | virtual TGRect GetBounds () const > Interface Category: | Sample. > Purpose: | MRefreshable override. Returns bounds of actor when rendered. > Calling Context: | Called by TRefreshThread, TBoundingBoxBehavior, and TCollisionBehavior. > Parameters: = Takes no parameters. > Return Value: | Bounds in which actor will render when Draw is called. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::Explode ; | virtual void Explode () > Interface Category: | Sample. > Purpose: | Causes the ship to explode and remove itself from the Simulation. > Calling Context: | Called by TExplosionBehavior. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::GetThrustChar ; | virtual UniChar GetThrustChar () const > Interface Category: | Sample. > Purpose: | Returns the key that causes the ship to thrust. > Calling Context: | Called by TSimulationLevel. > Parameters: = Takes no parameters. > Return Value: | The key that causes the ship to thrust. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::GetFireChar ; | virtual UniChar GetFireChar () const > Interface Category: | Sample. > Purpose: | Returns the key that causes the ship to fire. > Calling Context: | Called by TSimulationLevel. > Parameters: = Takes no parameters. > Return Value: | The key that causes the ship to fire. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::GetLeftChar ; | virtual UniChar GetLeftChar () const > Interface Category: | Sample. > Purpose: | Returns the key that causes the ship to turn left. > Calling Context: | Called by TSimulationLevel. > Parameters: = Takes no parameters. > Return Value: | The key that causes the ship to turn left. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::GetRightChar ; | virtual UniChar GetRightChar () const > Interface Category: | Sample. > Purpose: | Returns the key that causes the ship to turn right. > Calling Context: | Called by TSimulationLevel. > Parameters: = Takes no parameters. > Return Value: | The key that causes the ship to turn right. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::Fire ; | virtual void Fire () > Interface Category: | Sample. > Purpose: | Causes the ship to fire one bullet. If no bullets remain loaded, this routing does nothing. > Calling Context: | Called by TSimulationLevel in response to user input. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::ThrustBegin ; | virtual void ThrustBegin () > Interface Category: | Sample. > Purpose: | Causes the ship to begin thrusting. > Calling Context: | Called by TSimulationLevel in response to user input. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::ThrustEnd ; | virtual void ThrustEnd () > Interface Category: | Sample. > Purpose: | Causes the ship to end thrusting. > Calling Context: | Called by TSimulationLevel in response to user input. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::RotateEnd ; | virtual void RotateEnd () > Interface Category: | Sample. > Purpose: | Causes ship to stop rotating. > Calling Context: | Called by TSimulationLevel in response to user input. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::GetGraphic ; | virtual const MGraphic & GetGraphic () const > Interface Category: | Sample. > Purpose: | Returns the graphics used when ship is drawn. > Calling Context: | Called by Draw. > Parameters: = Takes no parameters. > Return Value: | Graphics used when ship is drawn > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::HandleBulletDied ; | virtual void HandleBulletDied (const TNotification & note) > Interface Category: | Sample. > Purpose: | Loads a new bullet into the ship's gun. > Calling Context: | Called by Notification framework when a bullet destructs. > Parameters: = const TNotification & note -A TUniverseActorNote specifying the bullet that was destroyed. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::RotateBegin ; | virtual void RotateBegin (TShip :: ERotation direction) > Interface Category: | Sample. > Purpose: | Causes the ship to begin rotating in the specified direction. > Calling Context: | Called by TSimulationLevel in response to user input. > Parameters: = TShip :: ERotation direction -Direction to rotate > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Enumeration: | TShip :: ERotation > Taxonomy Category: | ConcurrentGrahpics | Simulation Subsystem > Interface Category: | Sample. > Purpose: | Signifies a direction of rotation. > Tags: = kCounterClockWise -Signifies counter clockwise rotation. = kNoRotation -Signifies no rotation. = kClockWise -Signifies clockwise rotation. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::operator =; | TShip & operator =(const TShip & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TShip & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::~ TShip ; | virtual ~ TShip () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::TShip ; | 1. TShip (const TGPoint & initialPosition, UniChar thrust, UniChar fire, UniChar left, UniChar right) | 2. TShip (const TShip & source) | 3. TShip () > Interface Category: | Sample. > Purpose: | 1. Standard constructor. Creates a stationary ship at the specified location that responds to the specified keys. | 2. Copy constructor. | 3. Default constructor. > Calling Context: | 1. Called by TSimulationLevel when it creates a ship. | 2. Called to copy an object. | 3. Called by the stream-in operators. > Parameters: = 1. const TGPoint & initialPosition -Initial location of ship. = 1. UniChar thrust -Key to trigger thrust. = 1. UniChar fire -Key to fire bullets. = 1. UniChar left -Key to turn left. = 1. UniChar right -Key to turn right. = 2. const TShip & source -Object to copy. = 3. Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | Multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TShip::IsA ; | virtual bool IsA (const TType & type) const > Interface Category: | Sample. > Purpose: | Tests if a derived class of MColliding inherits from another class. > Calling Context: | Called by clients, usually TCollisionBehavior. > Parameters: = const TToken & type -Token of class name whose inheritance you wish to test for. > Return Value: | Returns true if derived class inherits from specified class. By default true is only returned for a value of TToken("MColliding"); > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Derived classes should _always_ override this member function. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TBoundingBoxBehavior > Taxonomy Category: | ConcurrentGraphics | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | TCollisionBehavior > Inherited By: | None. > Purpose: | This class constrains TExplodingActor objects so that their bounds lie entirely within a specified bounding area. Objects outside the constrained area are reflected back into the constraint area. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::GetBounds ; | virtual TGRect GetBounds () const > Interface Category: | Sample. > Purpose: | Returns constraint bounds. > Calling Context: | Called by clients. > Parameters: = Takes no parameters. > Return Value: | Bounds of constraint area. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::SetBounds ; | virtual void SetBounds (const TGRect & bounds) > Interface Category: | Sample. > Purpose: | Sets new constraint bounds. > Calling Context: | Called by clients. > Parameters: = const TGRect & bounds -New constraint bounds. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Actors are not constrained to new bounds until a collision notification is received. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::ConnectTo ; | virtual void ConnectTo (MColliding * colliding) > Interface Category: | Sample. > Purpose: | TCollisionBehavior override. Connects behavior to TExplodingActor objects so it receives collision notification. > Calling Context: | Called by TUniverse. > Parameters: = MColliding * colliding -Object to connect to. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | If the MColliding object does not inherit from TExplodingActor it is not constrained. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::DisconnectFrom ; | virtual void DisconnectFrom (MColliding & colliding) > Interface Category: | Sample. > Purpose: | TCollisionBehavior override. Disconnects behavior from actor so it no longer constrains the actor's position. > Calling Context: | Called by TUniverse. > Parameters: = MColliding & colliding -Object to disconnect from. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::operator =; | TBoundingBoxBehavior & operator =(const TBoundingBoxBehavior & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TBoundingBoxBehavior & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::~ TBoundingBoxBehavior ; | virtual ~ TBoundingBoxBehavior () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TBoundingBoxBehavior::TBoundingBoxBehavior ; | 1. TBoundingBoxBehavior () | 2. TBoundingBoxBehavior (const TGRect & bounds) | 3. TBoundingBoxBehavior (const TBoundingBoxBehavior & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Constructor for behavior constraining actors to specified area. | 3. Copy constructor. > Calling Context: | 1. Called by the stream-in operators. | 2. Called by TSimulationLevel to create a bounding box for display. | 3. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TGRect & bounds -Bounds of constraint area. = 3. const TBoundingBoxBehavior & source -Object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TExplosionBehavior > Taxonomy Category: | ConcurrentGraphics. | Simulation Subsystem. > Interface Category: | Sample. > Inherits From: | TCollisionBehavior > Inherited By: | None. > Purpose: | This behavior causes two actors to explode when their bounds overlap. The class of the actors is specified at construction time. Actors _must_ inherit from TExplodingActor. The actor's Explode function is called when a collision occurs. The two classes of actors are referred to as _us_ and _them._ > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::ConnectTo ; | virtual void ConnectTo (MColliding * colliding) > Interface Category: | Sample. > Purpose: | TCollisionBehavior override. Connects behavior to objects of _us_ or _them_ type. Behavior connects for collision notification through MColliding::CreateCollisionInterest. > Calling Context: | Called by TUniverse. > Parameters: = MColliding * colliding -Object to connect to. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::DisconnectFrom ; | virtual void DisconnectFrom (MColliding & colliding) > Interface Category: | Sample. > Purpose: | Disconnects behavior from object. > Calling Context: | Called by TUniverse. > Parameters: = MColliding & colliding -Object to disconnect from. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::HandleUsCollisionPossible ; | virtual void HandleUsCollisionPossible (const TNotification & note) > Interface Category: | Sample. > Purpose: | Handles collision notifications from actors of _us_ type. > Calling Context: | Called by notification framework when a collision notification is sent. > Parameters: = const TNotification & note -TCollisionNotification. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::DoPossibleCollision ; | virtual void DoPossibleCollision (TExplodingActor * cause, TDequeOf < TExplodingActor > & affected) > Interface Category: | Sample. > Purpose: | Performs detailed collision analysis. If the bounds of the cause actor overlaps any of the affected actors, the Explode function of both actors is called. > Calling Context: | Called by HandleUsCollisionPossible and HandleThemCollisionPossible. > Parameters: = TExplodingActor * cause -Actor that might have caused collision. = TDequeOf < TExplodingActor > & affected -Actors that cause actor might collide with. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::operator =; | TExplosionBehavior & operator =(const TExplosionBehavior & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TExplosionBehavior & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::~ TExplosionBehavior ; | virtual ~ TExplosionBehavior () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TExplosionBehavior::TExplosionBehavior ; | 1. TExplosionBehavior () | 2. TExplosionBehavior (const TType & us, const TType & them) | 3. TExplosionBehavior (const TExplosionBehavior & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Construct a behavior that causes explosions when actors of the two specified typed have overlapping bounds. | 3. Copy constructor. > Calling Context: | 1. Called by the stream-in operators. | 2. Called by TSimulationLevel. | 3. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TType & us -Class of exploding object causing explosion. = 2. const TType & them -Class of exploding object that will explode. = 3. const TExplosionBehavior & source -Object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TSimulationRefreshNotification > Taxonomy Category: | Sample Application. | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | TNotification > Inherited By: | None. > Purpose: | Notifies client that a particular area of a particular buffer has been updated. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe. > Resource Use: | TSimulationRefreshNotification objects don't own the buffer they refer to, so they can't be safely streamed. FlattenPointer and Resurrect may produce copies of the buffer that won't be disposed of. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationRefreshNotification::Hash ; | virtual long Hash () const > Interface Category: | Sample. > Purpose: | Returns a representative hash value. > Calling Context: | Typically called by collection comparators. > Parameters: = Takes no parameters. > Return Value: | A representative hash value. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationRefreshNotification::GetImage ; | virtual const TImage * GetImage () const > Interface Category: | Sample. > Purpose: | Returns a pointer to the updated buffer. > Calling Context: | Called by TSimulationView. > Parameters: = Takes no parameters. > Return Value: | A pointer to the updated buffer. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | The buffer should not be modified. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationRefreshNotification::GetRefreshArea ; | virtual TGRect GetRefreshArea () const > Interface Category: | Sample. > Purpose: | Returns bounds of the area that was modified. > Calling Context: | Called by clients. > Parameters: = Takes no parameters. > Return Value: | Bounds of area that was modified. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | Only the area contained in the bounds specified is guaranteed to be valid. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationRefreshNotification::operator =; | TSimulationRefreshNotification & operator =(const TSimulationRefreshNotification & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TSimulationRefreshNotification & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationRefreshNotification::~ TSimulationRefreshNotification ; | virtual ~ TSimulationRefreshNotification () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationRefreshNotification::TSimulationRefreshNotification ; | 1. TSimulationRefreshNotification (const TInterest & interest, const TGRect & area, const TImage * image) | 2. TSimulationRefreshNotification (TInterest * interestToAdopt, const TGRect & area, const TImage * image) | 3. TSimulationRefreshNotification (const TSimulationRefreshNotification & source) > Interface Category: | Sample. > Purpose: | 1. Constructs notification and copies interest. | 2. Constructs notification and adopts interest. | 3. Copy constructor. > Calling Context: | 1. Called by clients. | 2. Called by TSimulationLevel. | 3. Called to copy an object. > Parameters: = 1. const TInterest & interest -Interest to copy. = 1. const TGRect & area -Area of buffer that is valid. = 1. const TImage * image -Buffer. = 2. TInterest * interestToAdopt -Interest to adopt. = 2. const TGRect & area -Area of buffer that is valid. = 2. const TImage * image -Buffer. = 3. const TSimulationRefreshNotification & source -Object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationRefreshNotification::IsEqual ; | virtual bool IsEqual (const MCollectible * other) const > Interface Category: | Sample. > Purpose: | Compares notification to another object for semantic equality. Two TSimulationRefreshNotification objects are equal if they have the same interest, the same refresh area, and refer to the same buffer. > Calling Context: | Typically called by collection comparators. > Parameters: = const MCollectible * other -Object to compare to. > Return Value: | Returns true if other notification is a TSimulationRefreshNotification with equal interest, equal refresh area, and the same buffer. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | This interface is obsolete. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TSimulationLevel > Taxonomy Category: | Sample Application | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | None. > Inherited By: | None. > Purpose: | A TSimulationLevel holds the persistent state of a Simulation in progress. TSimulationLevel maintains a buffered image of the Simulation and sends TSimulationRefreshNotification objects when the buffer has been updated. TSimulationLevel also provides an interface for user interaction. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe to external clients. Only one external thread should call the Simulation level at a time. TSimulationLevel has several internal threads which it handles in a multithread safe manner. > Resource Use: | No special requirements. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::GetBounds ; | virtual TGRect GetBounds () const > Interface Category: | Sample. > Purpose: | Returns the bounds of the Simulation buffer. If the Simulation has not been started, the result are undefined. > Calling Context: | Called by clients. > Parameters: = Takes no parameters. > Return Value: | The bounds of the Simulation buffer. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::Restart ; | virtual void Restart () > Interface Category: | Sample. > Purpose: | Restarts a stopped Simulation. > Calling Context: | Called by TSimulationPresentation when the presentation is activated. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::Start ; | virtual void Start (const TGRect & bounds, unsigned long smallAsteroids, unsigned long mediumAsteroids, unsigned long largeAsteroids, unsigned long ships) > Interface Category: | Sample. > Purpose: | Starts a new Simulation. > Calling Context: | Called by TSimulationPresentation when a new presentation is created and when a Simulation ends. > Parameters: = const TGRect & bounds -Bounds for Simulation buffer. = unsigned long smallAsteroids -Initial number of small asteroids. = unsigned long mediumAsteroids -Initial number of medium asteroids. = unsigned long largeAsteroids -Initial number of large asteroids. = unsigned long ships -Initial number of ships. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::Stop ; | virtual void Stop () > Interface Category: | Sample. > Purpose: | Stops a Simulation that is in progress. > Calling Context: | Called by TSimulationPresentation when the presentation is deactivated. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::CreateRefreshInterest ; | virtual TInterest * CreateRefreshInterest () > Interface Category: | Sample. > Purpose: | Creates an interest for refresh notification. TSimulationRefreshNotification objects are sent. > Calling Context: | Called by TSimulationPresentation. > Parameters: = Takes no parameters. > Return Value: | An interest for refresh notification. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | Callers are responsible for disposing of the interest. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::CreateLevelEndedInterest ; | virtual TInterest * CreateLevelEndedInterest () > Interface Category: | Sample. > Purpose: | Creates an interest for notification of when the Simulation ends. A TNotification is sent (not a derived class). > Calling Context: | Called by TSimulationPresentation. > Parameters: = Takes no parameters. > Return Value: | An interest for notification of when the Simulation ends. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | Callers are responsible for disposing of the notification. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::PlacedAtRandomLocation ; | virtual TExplodingActor * PlacedAtRandomLocation (const TGRect & safeArea, TExplodingActor * actor) const > Interface Category: | Sample. > Purpose: | Places an actor at a random location. A safe area can be specified and the actor will be placed outside the specified area, but within the bounds. > Calling Context: | Called internally by Start. > Parameters: = const TGRect & safeArea -Area off-limits to new actor. = TExplodingActor * actor -Actor to place. > Return Value: | The actor that was placed. Same as the actor parameter. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::AddBehaviors ; | virtual void AddBehaviors (TDequeOf < TCollisionBehavior > &) const > Interface Category: | Sample. > Purpose: | Creates all behaviors for the Simulation. > Calling Context: | Called by Start. > Parameters: = TDequeOf < TCollisionBehavior > & -Deque to fill with TCollisionBehavior objects. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::CreateShip ; | virtual TShip * CreateShip (unsigned long ndx, unsigned long count, TGRect & safeArea) const > Interface Category: | Sample. > Purpose: | Creates a space ship and places it in the center of the Simulation bounds. If several ships are present in this level, each is staggered from the center and given its own set of key controls. > Calling Context: | Called by Start. > Parameters: = unsigned long ndx -The index of the ship to create. For example, if four ships are being created for this Simulation, they have indexes 0 through 3. = unsigned long count -The number of ships to create for this Simulation. = TGRect & safeArea -The bounds of the area occupied by ships. > Return Value: | The new ship. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::CreateSmallAsteroid ; | virtual TAbstractActor * CreateSmallAsteroid (const TGRect & safeArea) const > Interface Category: | Sample. > Purpose: | Creates a small asteroid and places it within the Simulation bounds but outside the safe area. > Calling Context: | Called by Start. > Parameters: = const TGRect & safeArea -The safe area. > Return Value: | The new asteroid. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::CreateMediumAsteroid ; | virtual TAbstractActor * CreateMediumAsteroid (const TGRect & safeArea) const > Interface Category: | Sample. > Purpose: | Creates a medium asteroid and places it within the Simulation bounds but outside the safe area. > Calling Context: | Called by Start. > Parameters: = const TGRect & safeArea -The safe area. > Return Value: | The new asteroid. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::CreateLargeAsteroid ; | virtual TAbstractActor * CreateLargeAsteroid (const TGRect & safeArea) const > Interface Category: | Sample. > Purpose: | Creates a large asteroid and places it within the Simulation bounds but outside the safe area. > Calling Context: | Called by Start. > Parameters: = const TGRect & safeArea -The safe area. > Return Value: | The new asteroid. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::HandleRefresh ; | virtual void HandleRefresh (const TNotification & note) > Interface Category: | Sample. > Purpose: | Handle refresh notification sent by the universe. The refresh area is copied and a TSimulationRefreshNotification is sent to all clients that connected through CreateRefreshInterest. > Calling Context: | Called by notification framework in response to refresh notification from the universe. > Parameters: = const TNotification & note -A TRefreshNotification. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::HandleDeath ; | virtual void HandleDeath (const TNotification & note) > Interface Category: | Sample. > Purpose: | Handle notification sent through connection with interest created by TUniverse::CreateOrphanInterest. If all asteroids or all space ships are destroyed, a notification is sent to all clients connected though CreateLevelEndedInterest. > Calling Context: | Called by Notification framework in response to notification from the universe. > Parameters: = const TNotification & note -A TUniverseActorNote specifying which actor was destroyed. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::HandleLife ; | virtual void HandleLife (const TNotification & note) > Interface Category: | Sample. > Purpose: | Handle notification sent through connection with interest created by TUniverse::CreateAdoptInterest. This allows the Simulation to keep track of the number of live asteroids and ships. > Calling Context: | Called by Notification framework in response to notification from the universe. > Parameters: = const TNotification & note -A TUniverseActorNote specifying which actor was created. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::CreateBackground ; | virtual TSimulationBackground * CreateBackground () const > Interface Category: | Sample. > Purpose: | Creates a background image for the Simulation. > Calling Context: | Called by Start. > Parameters: = Takes no parameters. > Return Value: | The background image. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::DoneWithImage ; | virtual void DoneWithImage () const > Interface Category: | Sample. > Purpose: | Releases the image buffer so the simulation can continue. > Calling Context: | Called by clients when done using the image buffer. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | Must be proceeded by a call to UseImage. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::UseImage ; | virtual const TModifiableImage * UseImage () const > Interface Category: | Sample. > Purpose: | Stops the simulation momentarily so the image buffer can be inspected by clients. > Calling Context: | Called by TSimulationModel::UseImage. > Parameters: = Takes no parameters. > Return Value: | The image buffer. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::operator =; | TSimulationLevel & operator =(const TSimulationLevel & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TSimulationLevel & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::~ TSimulationLevel ; | virtual ~ TSimulationLevel () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::TSimulationLevel ; | 1. TSimulationLevel () | 2. TSimulationLevel (const TSimulationLevel & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Copy constructor. > Calling Context: | 1. Called by the stream-in operators. | 2. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TSimulationLevel & source -Object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::KeyUp ; | virtual bool KeyUp (TKeyUpEvent & event) > Interface Category: | Sample. > Purpose: | Informs the Simulation that the user is no longer pressing a key. The Simulation reacts accordingly. > Calling Context: | Called by TSimulationPresentation when the user presses a key. > Parameters: = TKeyUpEvent & event -The key-up event. > Return Value: | Returns true if the Simulation reacted to the key press. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | The Simulation does not react if it is stopped. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::KeyDown ; | virtual bool KeyDown (TKeyDownEvent & event) > Interface Category: | Sample. > Purpose: | Informs Simulation that the user has pressed a key. They Simulation reacts accordingly. > Calling Context: | Called by TSimulationPresentation. > Parameters: = TKeyDownEvent & event -The key-down event. > Return Value: | Returns true if the Simulation reacted to the key-press. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | The TSimulationLevel does not react to key-presses when it is stopped. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationLevel::IsRunning ; | virtual bool IsRunning () const > Interface Category: | Sample. > Purpose: | Returns the status of the simulation. > Calling Context: | Called by clients to query simulation state. > Parameters: = Takes no parameters. > Return Value: | Returns true if a simulation is in progress. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe to external clients. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Class: | TSimulationBackground > Taxonomy Category: | ConcurrentGraphics | Simulation Subsystem > Interface Category: | Sample. > Inherits From: | MRefreshable > Inherited By: | None. > Purpose: | This class provides an MRefreshable object that draws a solid black background over infinite space. > Instantiation: | Allocate on the heap or the stack. > Deriving Classes: | None. > Concurrency: | _Not_ multithread safe. > Resource Use: | No special requirements. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationBackground::TSimulationBackground ; | 1. TSimulationBackground () | 2. TSimulationBackground (const TSimulationBackground & source) > Interface Category: | Sample. > Purpose: | 1. Default constructor. | 2. Copy constructor. > Calling Context: | 1. Called by the stream-in operators. | 2. Called to copy an object. > Parameters: = 1. Takes no parameters. = 2. const TSimulationBackground & source -Object to copy. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationBackground::~ TSimulationBackground ; | virtual ~ TSimulationBackground () > Interface Category: | Sample. > Purpose: | Destructor. > Calling Context: | Called to destroy an object. > Parameters: = Takes no parameters. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationBackground::operator =; | TSimulationBackground & operator =(const TSimulationBackground & source) > Interface Category: | Sample. > Purpose: | Assignment operator. > Calling Context: | Called when an object is assigned to another compatible object. > Parameters: = const TSimulationBackground & source -Object to copy. > Return Value: | A non-const reference to the left-hand side object. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationBackground::operator >>=; | virtual TStream & operator >>=(TStream & toStream) const > Interface Category: | Sample. > Purpose: | Stream-out operator. > Calling Context: | Called to stream out data. > Parameters: = TStream & toStream -Stream to write to. > Return Value: | Returns a reference to the stream the object streams itself out to. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationBackground::operator <<= ; | virtual TStream & operator <<= (TStream & fromStream) > Interface Category: | Sample. > Purpose: | Stream-in operator. > Calling Context: | Called to stream in data. > Parameters: = TStream & fromStream -Stream to read from. > Return Value: | Returns a reference to the stream the object streams itself in from. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationBackground::Draw ; | virtual void Draw (TGrafPort & port) const > Interface Category: | Sample. > Purpose: | MRefreshable override. Draws the background in the specified port. > Calling Context: | Called by TRefreshThread. > Parameters: = TGrafPort & port -Port to draw background in. > Return Value: | None. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationBackground::GetBounds ; | virtual TGRect GetBounds () const > Interface Category: | Sample. > Purpose: | MRefreshable override. Returns bounds of background. > Calling Context: | Called by TRefreshThread. > Parameters: = Takes no parameters. > Return Value: | Returns bounds of background. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif #if 0 --------------------------------------------------------------------------- > Member Function: TSimulationBackground::GetGraphic ; | virtual const MGraphic & GetGraphic () const > Interface Category: | Sample. > Purpose: | Returns graphics that is rendered when this is drawn. > Calling Context: | Called internally by Draw. > Parameters: = Takes no parameters. > Return Value: | Background graphic. > Exceptions: | Throws no exceptions, passes all exceptions through. > Concurrency: | _Not_ multithread safe. > Other Considerations: | None. --------------------------------------------------------------------------- #endif