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.
This commit is contained in:
Daniel Buckmaster 2012-11-18 21:32:51 +11:00
parent 9c343d1364
commit a1740e8a9c

View file

@ -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; }