Browse Source

Made Trigger friendlier towards inheritance.

Specifically:
 * Made update bits constants protected so that derived classes can
   use them - especially NextFreeMask! IIRC, most classes make these
   constants public, though there's no real reason to.
 * Made potentialEnterObject virtual so that derived classes can
   substitute their own logic.
Daniel Buckmaster 12 years ago
parent
commit
a1740e8a9c
1 changed files with 5 additions and 5 deletions
  1. 5 5
      Engine/source/T3D/trigger.h

+ 5 - 5
Engine/source/T3D/trigger.h

@@ -87,6 +87,10 @@ class Trigger : public GameBase
    String            mLeaveCommand;
    String            mTickCommand;
 
+   static const U32 CMD_SIZE = 1024;
+
+  protected:
+   
    enum TriggerUpdateBits
    {
       TransformMask = Parent::NextFreeMask << 0,
@@ -97,10 +101,6 @@ class Trigger : public GameBase
       NextFreeMask  = Parent::NextFreeMask << 5,
    };
 
-   static const U32 CMD_SIZE = 1024;
-
-  protected:
-
    static bool smRenderTriggers;
    bool testObject(GameBase* enter);
    void processTick(const Move *move);
@@ -142,7 +142,7 @@ class Trigger : public GameBase
    // Trigger
    void setTriggerPolyhedron(const Polyhedron&);
 
-   void      potentialEnterObject(GameBase*);
+   virtual void potentialEnterObject(GameBase*);
    U32       getNumTriggeringObjects() const;
    GameBase* getObject(const U32);   
    const Vector<GameBase*>& getObjects() const { return mObjects; }