This commit is contained in:
Walter Julius Hennecke 2014-03-09 23:01:41 +01:00
parent fc2c939d0d
commit bc0aecbafd

View file

@ -1,114 +1,107 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Logfile:: /Code/DLLs/game/teleportToPosition.h $ // $Logfile:: /Code/DLLs/game/teleportToPosition.h $
// $Revision:: 169 $ // $Revision:: 169 $
// $Author:: Bschofield $ // $Author:: Bschofield $
// $Date:: 4/26/02 2:22p $ // $Date:: 4/26/02 2:22p $
// //
// Copyright (C) 2002 by Ritual Entertainment, Inc. // Copyright (C) 2002 by Ritual Entertainment, Inc.
// All rights reserved. // All rights reserved.
// //
// This source may not be distributed and/or modified without // This source may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc. // expressly written permission by Ritual Entertainment, Inc.
// //
// //
// DESCRIPTION: // DESCRIPTION:
// TeleportToPosition Behavior Definition ( Behavior Name Needs To Be Changed ) // TeleportToPosition Behavior Definition ( Behavior Name Needs To Be Changed )
// //
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//============================== //==============================
// Forward Declarations // Forward Declarations
//============================== //==============================
class AnimatedTeleportToPosition; class AnimatedTeleportToPosition;
#ifndef __TELEPORT_TO_POSITION_H__ #ifndef __TELEPORT_TO_POSITION_H__
#define __TELEPORT_TO_POSITION_H__ #define __TELEPORT_TO_POSITION_H__
#include "behavior.h" #include "behavior.h"
//-------------------------------------------------- //--------------------------------------------------
// We need to change the name of this behavior to more appropriately // We need to change the name of this behavior to more appropriately
// reflect the file name AND we need to set it up properly so that it // reflect the file name AND we need to set it up properly so that it
// doesn't HAVE to be animated... Basically we need to generalize this // doesn't HAVE to be animated... Basically we need to generalize this
// behavior as soon as possible // behavior as soon as possible
//---------------------------------------------------- //----------------------------------------------------
//------------------------- CLASS ------------------------------ //------------------------- CLASS ------------------------------
// //
// Name: AnimatedTeleportToPosition // Name: AnimatedTeleportToPosition
// Base Class: Behavior // Base Class: Behavior
// //
// Description: Teleports Actor to the player ( See .cpp for details ) // Description: Teleports Actor to the player ( See .cpp for details )
// //
// Method of Use: State Machine or another behavior // Method of Use: State Machine or another behavior
//-------------------------------------------------------------- //--------------------------------------------------------------
class AnimatedTeleportToPosition : public Behavior class AnimatedTeleportToPosition : public Behavior {
{ public:
//------------------------------------ //------------------------------------
// States // States
//------------------------------------ //------------------------------------
public: typedef enum {
typedef enum ANIM_TELEPORT_BEGIN,
{ ANIM_TELEPORT_START_ANIM,
ANIM_TELEPORT_BEGIN, ANIM_TELEPORT_START_ANIMATING,
ANIM_TELEPORT_START_ANIM, ANIM_TELEPORT_TELEPORT,
ANIM_TELEPORT_START_ANIMATING, ANIM_TELEPORT_END_ANIM,
ANIM_TELEPORT_TELEPORT, ANIM_TELEPORT_END_ANIMATING,
ANIM_TELEPORT_END_ANIM, } animTeleportStates_t;
ANIM_TELEPORT_END_ANIMATING,
} animTeleportStates_t; //-------------------------------------
// Public Interface
//------------------------------------ //-------------------------------------
// Parameters CLASS_PROTOTYPE(AnimatedTeleportToPosition);
//------------------------------------
private: void SetArgs(Event* ev);
str _teleportPositionName; void Begin(Actor& self);
int _numberOfTeleportPositions; BehaviorReturnCode_t Evaluate(Actor& self);
str _startAnim; void End(Actor& self);
str _endAnim; virtual void Archive(Archiver& arc);
private:
//------------------------------------- //------------------------------------
// Public Interface // Parameters
//------------------------------------- //------------------------------------
public: str _teleportPositionName;
CLASS_PROTOTYPE( AnimatedTeleportToPosition ); int _numberOfTeleportPositions;
str _startAnim;
void SetArgs( Event *ev ); str _endAnim;
void Begin( Actor &self );
BehaviorReturnCode_t Evaluate( Actor &self ); //-------------------------------------
void End( Actor &self ); // Member Variables
virtual void Archive( Archiver &arc ); //-------------------------------------
animTeleportStates_t _state;
//------------------------------------- PathNodePtr _goal;
// Member Variables };
//-------------------------------------
private: inline void AnimatedTeleportToPosition::Archive(Archiver& arc) {
animTeleportStates_t _state; Behavior::Archive(arc);
PathNodePtr _goal;
//-------------------------------------
}; // Archive Parameters
//-------------------------------------
inline void AnimatedTeleportToPosition::Archive( Archiver &arc ) arc.ArchiveString(&_teleportPositionName);
{ arc.ArchiveInteger(&_numberOfTeleportPositions);
Behavior::Archive( arc ); arc.ArchiveString(&_startAnim);
arc.ArchiveString(&_endAnim);
//-------------------------------------
// Archive Parameters //-------------------------------------
//------------------------------------- // Archive Member Variables
arc.ArchiveString ( &_teleportPositionName ); //-------------------------------------
arc.ArchiveInteger ( &_numberOfTeleportPositions ); ArchiveEnum(_state, animTeleportStates_t);
arc.ArchiveString ( &_startAnim ); arc.ArchiveSafePointer(&_goal);
arc.ArchiveString ( &_endAnim ); }
//-------------------------------------
// Archive Member Variables
//------------------------------------- #endif /*__TELEPORT_TO_POSITION_H__ */
ArchiveEnum ( _state, animTeleportStates_t );
arc.ArchiveSafePointer ( &_goal );
}
#endif /*__TELEPORT_TO_POSITION_H__ */