reformatting

This commit is contained in:
Walter Julius Hennecke 2014-03-09 19:13:47 +01:00
parent 85075efa95
commit b855763ada

View file

@ -1,158 +1,148 @@
//----------------------------------------------------------------------------- //-----------------------------------------------------------------------------
// //
// $Logfile:: /Code/DLLs/game/coverCombatWithRangedWeapon.hpp $ // $Logfile:: /Code/DLLs/game/coverCombatWithRangedWeapon.hpp $
// $Revision:: 169 $ // $Revision:: 169 $
// $Author:: sketcher $ // $Author:: sketcher $
// $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:
// CoverCombatWithRangedWeapon Behavior Definition // CoverCombatWithRangedWeapon Behavior Definition
// //
//-------------------------------------------------------------------------------- //--------------------------------------------------------------------------------
//============================== //==============================
// Forward Declarations // Forward Declarations
//============================== //==============================
class GotoHelperNode; class GotoHelperNode;
#ifndef __GOTO_HELPER_NODE___ #ifndef __GOTO_HELPER_NODE___
#define __GOTO_HELPER_NODE___ #define __GOTO_HELPER_NODE___
#include "behavior.h" #include "behavior.h"
#include "behaviors_general.h" #include "behaviors_general.h"
//------------------------- CLASS ------------------------------ //------------------------- CLASS ------------------------------
// //
// Name: CoverCombatWithRangedWeapon // Name: CoverCombatWithRangedWeapon
// Base Class: Behavior // Base Class: Behavior
// //
// Description: // Description:
// //
// Method of Use: Called From State Machine // Method of Use: Called From State Machine
//-------------------------------------------------------------- //--------------------------------------------------------------
class GotoHelperNode : public Behavior class GotoHelperNode : public Behavior {
{ public:
//------------------------------------ //------------------------------------
// States // States
//------------------------------------ //------------------------------------
public: typedef enum {
typedef enum GOTO_HNODE_FIND_NODE,
{ GOTO_HNODE_MOVE_TO_NODE,
GOTO_HNODE_FIND_NODE, GOTO_HNODE_SUCCESS,
GOTO_HNODE_MOVE_TO_NODE, GOTO_HNODE_FAILED
GOTO_HNODE_SUCCESS, } GotoHelperNodeStates_t;
GOTO_HNODE_FAILED
} GotoHelperNodeStates_t; //-------------------------------------
// Public Interface
//------------------------------------ //-------------------------------------
// Parameters CLASS_PROTOTYPE(GotoHelperNode);
//------------------------------------
private: GotoHelperNode();
str _nodeType; ~GotoHelperNode();
str _movementAnim;
HelperNodePtr _node; void SetArgs(Event* ev);
float _maxDistance; void AnimDone(Event* ev);
//------------------------------------- void Begin(Actor& self);
// Internal Functionality BehaviorReturnCode_t Evaluate(Actor& self);
//------------------------------------- void End(Actor& self);
protected:
void transitionToState ( GotoHelperNodeStates_t state ); // Accessors
void setInternalState ( GotoHelperNodeStates_t state , const str &stateName ); void SetNode(HelperNode* node);
void init ( Actor &self ); void SetMovementAnim(const str& anim);
void think ();
virtual void Archive(Archiver& arc);
void setupStateMoveToNode (); //-------------------------------------
BehaviorReturnCode_t evaluateStateMoveToNode (); // Internal Functionality
void failureStateFindNode ( const str& failureReason ); //-------------------------------------
protected:
void setupStateFindNode (); void transitionToState(GotoHelperNodeStates_t state);
BehaviorReturnCode_t evaluateStateFindNode (); void setInternalState(GotoHelperNodeStates_t state, const str& stateName);
void failureStateMoveToNode ( const str& failureReason ); void init(Actor& self);
void think();
//-------------------------------------
// Public Interface
//------------------------------------- void setupStateMoveToNode();
public: BehaviorReturnCode_t evaluateStateMoveToNode();
CLASS_PROTOTYPE( GotoHelperNode ); void failureStateFindNode(const str& failureReason);
GotoHelperNode(); void setupStateFindNode();
~GotoHelperNode(); BehaviorReturnCode_t evaluateStateFindNode();
void failureStateMoveToNode(const str& failureReason);
void SetArgs ( Event *ev );
void AnimDone ( Event *ev ); private:
//------------------------------------
void Begin ( Actor &self ); // Parameters
BehaviorReturnCode_t Evaluate ( Actor &self ); //------------------------------------
void End ( Actor &self ); str _nodeType;
str _movementAnim;
// Accessors HelperNodePtr _node;
void SetNode ( HelperNode *node ); float _maxDistance;
void SetMovementAnim ( const str &anim );
//-------------------------------------
// Components
virtual void Archive ( Archiver &arc ); //-------------------------------------
GotoPoint _gotoPoint;
//-------------------------------------
// Components
//------------------------------------- //-------------------------------------
private: // Member Variables
GotoPoint _gotoPoint; //-------------------------------------
GotoHelperNodeStates_t _state;
Actor* _self;
//-------------------------------------
// Member Variables static const float NODE_RADIUS;
//------------------------------------- };
private:
GotoHelperNodeStates_t _state; inline void GotoHelperNode::SetNode(HelperNode* node) {
Actor *_self; assert(node);
_node = node;
static const float NODE_RADIUS; }
}; inline void GotoHelperNode::SetMovementAnim(const str& anim) {
_movementAnim = anim;
inline void GotoHelperNode::SetNode ( HelperNode *node ) }
{
assert ( node );
_node = node; inline void GotoHelperNode::Archive(Archiver& arc) {
} Behavior::Archive(arc);
inline void GotoHelperNode::SetMovementAnim ( const str &anim ) //
{ // Archive Parameters
_movementAnim = anim; //
} arc.ArchiveString(&_nodeType);
arc.ArchiveString(&_movementAnim);
arc.ArchiveSafePointer(&_node);
inline void GotoHelperNode::Archive( Archiver &arc ) arc.ArchiveFloat(&_maxDistance);
{
Behavior::Archive ( arc ); //
// Archive Components
// //
// Archive Parameters arc.ArchiveObject(&_gotoPoint);
//
arc.ArchiveString( &_nodeType ); //
arc.ArchiveString ( &_movementAnim ); // Archive Member Variables
arc.ArchiveSafePointer ( &_node ); //
arc.ArchiveFloat( &_maxDistance ); ArchiveEnum(_state, GotoHelperNodeStates_t);
arc.ArchiveObjectPointer((Class **)&_self);
// }
// Archive Components
// #endif /* __GOTO_HELPER_NODE___ */
arc.ArchiveObject ( &_gotoPoint );
//
// Archive Member Variables
//
ArchiveEnum ( _state, GotoHelperNodeStates_t );
arc.ArchiveObjectPointer( ( Class ** )&_self );
}
#endif /* __GOTO_HELPER_NODE___ */