// $Revision: 1.9 $ //------------------------------------------------------------------------------ // // Copyright (C) 1994 Taligent, Inc. All rights reserved. // // Project: ConcurrentActors // File: CollisionSubsystem.h // Build/Version: 1.0.0 // // Description: The Collision subsystem manages interactions between actors // and between actors and the simulation space. // //------------------------------------------------------------------------------ #ifndef TaligentSamples_COLLISIONSUBSYSTEM #define TaligentSamples_COLLISIONSUBSYSTEM class TCollisionNotification; class MColliding; class TCollisionBehavior; #ifndef Taligent_COREPRIMITIVECLASSES #include #endif #ifndef Taligent_NOTIFICATION #include #endif //============================================================================== // TCollisionNotification class TCollisionNotification : public TNotification { public: MCollectibleDeclarationsMacro(TCollisionNotification); public: TCollisionNotification(const TInterest& interest, MColliding* object); TCollisionNotification(TInterest* interestToAdopt, MColliding* object); TCollisionNotification(const TCollisionNotification& source); virtual ~TCollisionNotification(); TCollisionNotification& operator=(const TCollisionNotification& source); virtual bool IsEqual(const MCollectible* other) const; virtual long Hash() const; virtual MColliding* GetObject() const; private: enum {kOriginalVersion}; TCollisionNotification(); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); MColliding* fObject; }; //============================================================================== // MColliding class MColliding { public: TaligentTypeExtensionDeclarationsMacro_Abstract(TCollisionBehavior) public: MColliding(); virtual ~MColliding(); virtual bool IsA(const TType& type) const; virtual TInterest* CreateCollisionInterest(); protected: virtual void NotifyCollisionPossible(); virtual TNotifier& GetNotifier() const = 0; }; //============================================================================== // TCollisionBehavior class TCollisionBehavior { public: TaligentTypeExtensionDeclarationsMacro_Abstract(TCollisionBehavior) public: TCollisionBehavior(); TCollisionBehavior( const TCollisionBehavior& source); virtual ~TCollisionBehavior(); TCollisionBehavior& operator=(const TCollisionBehavior& source); virtual TStream& operator>>=(TStream& toStream) const; virtual TStream& operator<<=(TStream& fromStream); virtual void ConnectTo(MColliding* colliding) = 0; virtual void DisconnectFrom(MColliding& colliding) = 0; private: enum {kOriginalVersion}; }; #endif