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

View file

@ -1,125 +1,117 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Logfile:: /Code/DLLs/game/teleportToEntity.h $ // $Logfile:: /Code/DLLs/game/teleportToEntity.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:
// TeleportToEntity Behavior Definition ( Behavior Name Needs To Be Changed ) // TeleportToEntity Behavior Definition ( Behavior Name Needs To Be Changed )
// //
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//============================== //==============================
// Forward Declarations // Forward Declarations
//============================== //==============================
class AnimatedTeleportToPlayer; class AnimatedTeleportToPlayer;
#ifndef __TELEPORT_TO_ENTITY_H__ #ifndef __TELEPORT_TO_ENTITY_H__
#define __TELEPORT_TO_ENTITY_H__ #define __TELEPORT_TO_ENTITY_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: AnimatedTeleportToPlayer // Name: AnimatedTeleportToPlayer
// 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 AnimatedTeleportToPlayer : public Behavior class AnimatedTeleportToPlayer : 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; typedef enum {
TELEPORT_BEHIND,
typedef enum TELEPORT_TOLEFT,
{ TELEPORT_TORIGHT,
TELEPORT_BEHIND, TELEPORT_INFRONT,
TELEPORT_TOLEFT, TELEPORT_NUMBER_OF_POSITIONS
TELEPORT_TORIGHT, } animTeleportPositionModes_t;
TELEPORT_INFRONT,
TELEPORT_NUMBER_OF_POSITIONS //-------------------------------------
} animTeleportPositionModes_t; // Public Interface
//-------------------------------------
//------------------------------------ CLASS_PROTOTYPE(AnimatedTeleportToPlayer);
// Parameters
//------------------------------------ void SetArgs(Event* ev);
private: void Begin(Actor& self);
str _startAnim;
str _endAnim; BehaviorReturnCode_t Evaluate(Actor& self);
void End(Actor& self);
//------------------------------------- virtual void Archive(Archiver& arc);
// Internal Functionality
//------------------------------------- protected:
protected: //-------------------------------------
bool testPosition ( Actor &self, int test_pos, Vector &good_position, Entity* player, bool use_player_dir ); // Internal Functionality
//-------------------------------------
bool testPosition(Actor& self, int test_pos, Vector& good_position, Entity* player, bool use_player_dir);
//-------------------------------------
// Public Interface private:
//------------------------------------- //------------------------------------
public: // Parameters
CLASS_PROTOTYPE( AnimatedTeleportToPlayer ); //------------------------------------
str _startAnim;
void SetArgs ( Event *ev ); str _endAnim;
void Begin ( Actor &self );
//-------------------------------------
BehaviorReturnCode_t Evaluate ( Actor &self ); // Member Variables
void End ( Actor &self ); //-------------------------------------
virtual void Archive ( Archiver &arc ); Vector _teleportPosition;
animTeleportStates_t _state;
//------------------------------------- };
// Member Variables
//------------------------------------- inline void AnimatedTeleportToPlayer::Archive(Archiver& arc) {
private: Behavior::Archive(arc);
Vector _teleportPosition;
animTeleportStates_t _state; //-------------------------------------
}; // Archive Parameters
//-------------------------------------
inline void AnimatedTeleportToPlayer::Archive( Archiver &arc ) arc.ArchiveString(&_startAnim);
{ arc.ArchiveString(&_endAnim);
Behavior::Archive ( arc );
//-------------------------------------
//------------------------------------- // Archive Member Variables
// Archive Parameters //-------------------------------------
//------------------------------------- arc.ArchiveVector(&_teleportPosition);
arc.ArchiveString ( &_startAnim ); ArchiveEnum(_state, animTeleportStates_t);
arc.ArchiveString ( &_endAnim ); }
//------------------------------------- #endif /* __TELEPORT_TO_ENTITY_H__ */
// Archive Member Variables
//-------------------------------------
arc.ArchiveVector ( &_teleportPosition );
ArchiveEnum ( _state, animTeleportStates_t );
}
#endif /* __TELEPORT_TO_ENTITY_H__ */