#pragma once #include "network.h" #include "lattice.h" class Entity; class InterestOrigin: public Node { friend class InterestManager; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Destructor, and Testing // public: ~InterestOrigin(); Logical TestInstance() const; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Update // public: // //----------------------------------------------------------------------- // Update // // Updates the interest origins internal data structures for the // interest zone ID. This method is most likely called by the // renderer manager. //----------------------------------------------------------------------- // virtual void Update(InterestZoneID interest_zone_ID); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Accessors // private: InterestZoneID GetInterestZoneID(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Constructor // protected: InterestOrigin( InterestZoneID interest_zone_ID, InterestType interest_type, InterestDepth depth_calibration ); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Interest Manager support // private: virtual void AddInterestingEntity(Entity *interesting_entity); virtual void RemoveUninterestingEntity(Entity *uninteresting_entity); virtual void RemoveUninterestingEntities(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Private data // private: InterestZoneID interestZoneID; InterestType interestType; InterestDepth depthCalibration; SlotOf interestArenaSocket; }; //~~~~~~~~~~~~~~~~~~~~~~~ InterestOrigin inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~~ inline InterestZoneID InterestOrigin::GetInterestZoneID() { Check(this); return interestZoneID; } #if 0 //########################################################################## //####################### InterestOrigin ############################# //########################################################################## class InterestOrigin: public Node { friend class InterestManager; friend class InterestOrigin__InterestingEntityIterator; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Public types // public: typedef InterestOrigin__InterestingEntityIterator InterestingEntityIterator; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Constructor, Destructor, and Testing // public: InterestOrigin( const EntityID &entity_ID, InterestType interest_type, InterestDepth depth_calibration ); ~InterestOrigin(); Logical TestInstance() const; //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Renderer support // public: // //-------------------------------------------------------------------- // UpdateInterestOrigin // // Updates the interest managers internal data structures for the // interest origin entity. This method is most likely called by the // renderer manager. It prepares the data that will be accessed by // InterestingEntityIterator. //-------------------------------------------------------------------- // virtual void Update(); InterestArena* GetInterestArena(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Interest Manager support // protected: virtual void AddInterestingEntity(Entity *interesting_entity); virtual void RemoveUninterestingEntity(Entity *uninteresting_entity); virtual void RemoveUninterestingEntities(); //~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ // Private data // private: EntityID entityID; InterestType interestType; InterestDepth depthCalibration; SlotOf interestArenaSocket; SChainOf interestingEntitySocket; }; //~~~~~~~~~~~~~~~~~~~~~~~~ InterestOrigin inlines ~~~~~~~~~~~~~~~~~~~~~~~~~~ inline InterestArena* InterestOrigin::GetInterestArena() { Check(this); return interestArenaSocket.GetCurrent(); } #endif