//===========================================================================// // File: entity2.hh // // Project: MUNGA Brick: Entity Manager // // Contents: Interface specification for entity class // //---------------------------------------------------------------------------// // Date Who Modification // // -------- --- ---------------------------------------------------------- // // 11/29/94 JMA Initial coding. // //---------------------------------------------------------------------------// // Copyright (C) 1994, Virtual World Entertainment, Inc. // // All Rights reserved worldwide // // This unpublished sourcecode is PROPRIETARY and CONFIDENTIAL // //===========================================================================// #if !defined(NTTMGR_HPP) #define NTTMGR_HPP #if !defined(NAMELIST_HPP) #include #endif #if !defined(NODE_HPP) #include #endif #if !defined(CHAIN_HPP) #include #endif #if !defined(NETWORK_HPP) #include #endif class Entity; //########################################################################## //######################### EntityGroup ############################## //########################################################################## class EntityGroup: public Node { friend class EntityManager; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Construction and Destruction // protected: EntityGroup(); ~EntityGroup(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Naming functions // public: const char* GetGroupName() {Check(this); return groupName;} protected: const char *groupName; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Grouping functions // public: void Add(Entity *entity) { Check(this); groupMembers.Add(Cast_Object(Node*,entity)); } void Add(EntityGroup *group) {Check(this); Check(group); groupMembers.Add(group);} ChainOf groupMembers; }; //########################################################################## //######################## EntityManager ############################# //########################################################################## class EntityManager: public NetworkClient { friend class Entity; //########################################################################## // Shared Data support // protected: static Derivation ClassDerivations; static SharedData DefaultData; //########################################################################## // Construction and destruction support // public: EntityManager(); ~EntityManager(); void FryDeathRow(); protected: EntityGroup *deathRow; //########################################################################## // Message packet receiving // public: void ReceiveNetworkPacket( NetworkPacket *packet, Receiver::Message *packet_message ); //########################################################################## // Entity grouping // public: EntityGroup* UseGroup(const char *name); EntityGroup* FindGroup(const char *name) { Check_Pointer(name); return (EntityGroup*)groupList.FindObject(name); } void RemoveGroup(EntityGroup* group); Logical TestInstance() const; protected: ObjectNameList groupList; }; #endif