/***************************************************************** * Template for adding an object to the simulation environment. * * HANK Project, Copyright 1997-2001 * The University of Iowa Computer Science Department * hank@cs.uiowa.edu * * Author: * * Last Modification Info: $Id$ *****************************************************************/ // Replace the class name "Object_Template" and any references to it // with the name of your class. #ifndef __OBJECT_TEMPLATE_H__ #define __OBJECT_TEMPLATE_H__ // Includes the classes needed for dealing with abstract parameter // types in Hank. #include "Hank/DataParameter.H" // Includes the reference to the derived class PerceivableObject. If // you do not wish for your new object to be seen, derive it from // HankObject instead. PerceivableObjects can be "perceived" by other // dynamic entities in the simulation. #include "Hank/db/PerceivableObject.H" // This is the main class definition. Be sure to look at the Vehicle, // or other classes for more detailed examples of how more intricate // objects are currently created in Hank. class Object_Template : public HankDB::PerceivableObject { public: // Default Constructor for this entity. Object_Template( const long id=-1 ); // Parameterized Constructor - uses the initial property value pairs // provided in the parameter list to initialize the object // structure. Each object is responsible for interpreting their // initialization parameters. Object_Template( const long id, std::list< const Hank::ParameterBase* >& ); // Destructor -- REMEMBER, this must be virtual if it's ever going // to be used as a base class for something else. ~Object_Template(); // A function that is used to initialize the object once it has been // instanced in the simulation. This is generally where parameters // are interpreted. void initialize( void ); // A simple function that returns a one or two word // description/classification/name for this object. std::string description( void ) const { return "Object_Template"; } void ogl_init( void ); // initializes a simple OpenGL representation void ogl_draw( void ); // the actual draw routines in OpenGL // CLASS wide function used in the creation process. This function // is static because it is called from the ObjectFactory without an // actual pointer to the object. This function prepares the object // for creation between major frames of the simulation. static void create( const long ref_id, std::list< const Hank::ParameterBase* > param_list ); private: }; #endif // __OBJECT_TEMPLATE_H__