the Actor class class was the rendezvous point; the classes from above and the classes from below met here. it's a really big class, with all kinds of crap in it, but hardly unsalvagable.

class Actor : public MovementObject

object creation et al

physics / collision detection / position / movement

input

scene graph "management"

// actor index
  • inline int GetActorIndex() const;
  • inline void SetActorIndex( int32 idxActor ); // Only call once (and only on templated objects) and only if you're level
  • unsigned _idxActor : 11; // 2048 objects max.

display / rendering

  • virtual bool CanRender() const;
  • virtual bool isVisible() const;
// mesh

// handles

actor

  • virtual bool CanUpdate() const; // used to decide which to put it the rooms render & update lists
  • virtual void reset();
  • // actor "program" / "loop"
  • virtual void predictPosition(const Clock& currentTime); // Predict "desired" new position for this frame
  • virtual void update();
  • void UpdateAnimation();
  • void StartFrame(); // this is a catch all, it is guaranteed to run after all actors have run update, but before prepareToRender
  • inline const bool hasRunUpdate() const;
  • inline const bool hasRunPredictPosition() const;

printing / debugging

  • std::ostream& printDetailed( std::ostream& s ) const;
  • virtual std::ostream& Print( std::ostream& ) const;
  • virtual void Validate() const;

ActivationBoxes

music / sound effects

memory

  • virtual Memory& GetMemory() const;
  • // room transitions
  • virtual void BindAssets(Memory& memory); // bind into current room
  • virtual void UnBindAssets(); // unbind, get rid of all transient assets

utility


"variables"

class ActorMailboxes : public MailboxesWithStorage
{
public:
   ActorMailboxes(Actor& actor, long mailboxesBase, long numberOfLocalMailboxes, Mailboxes* parent);
   virtual ~ActorMailboxes();
   virtual Scalar ReadMailbox(long mailbox) const;
   virtual void WriteMailbox(long mailbox, Scalar value);
};

scripting

get rid of this crap

  • // tool stuff
  • inline bool IsNeedleGunTarget() const;
  • void spawnPoof() const; // friend to level class only
  • // hitpoints / health / shield-type stuff
  • static const Scalar INDESTRUCTIBLE_HP;
  • Scalar getHealth() const;
  • void deltaHealth( Scalar nHealth );
  • int32 getPower() const;
  • void _InitShadow();
  • void _InitTools();
  • Shield* _shield; // pointer to shield if this actor has one // will go away
  • Tool* _tool_MAX_TOOLS ;
  • int _nTools; // not strictly necessary, but code can determine if it should bother
  • Scalar _hitPoints;
  • virtual bool IsLight() const;


<hal/hal.h> <math/scalar.hp> <mailbox/mailbox.hp> <physics/colspace.hp> <oas/levelcon.h> <baseobject/msgport.hp> <physics/physicalobject.hp> <movement/movementobject.hp> <movement/movementmanager.hp> <movement/movement.hp> <cpplib/minlist.hp> <anim/path.hp> <physics/physical.hp> <physics/colbox.hp> <oas/objectstartupdata.hp> <oas/movebloc.ht> <oas/toolset.ht> <oas/common.ht> <oas/mesh.ht> <oas/shadowp.ht> "rendacto.hp" "animmang.hp"

friend class AnimationManagerActual; friend class MovementManager; friend class PathHandler; friend class MovementHandler; friend class GroundHandler; friend class AirHandler; friend class ClimbHandler; friend class CameraHandler;

class also contains a RenderActor, PhysicalAttributes, NonStatPlatData (a space optimization only)

see also RoomClass, LevelClass, and GameClass

This topic: WorldFoundry > AnalysisOfActorClass
Topic revision: 02 Jul 2003, WillNorris;
This site is powered by FoswikiCopyright © by the contributing authors. All material on this collaboration platform is the property of the contributing authors.
Ideas, requests, problems regarding Foswiki? Send feedback