mirror of
https://github.com/UberGames/EF2GameSource.git
synced 2025-04-17 20:40:53 +00:00
reformat
This commit is contained in:
parent
d8bb50f96e
commit
a24940bed2
1 changed files with 112 additions and 123 deletions
|
@ -1,123 +1,112 @@
|
|||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Code/DLLs/game/rotateToEntity.h $
|
||||
// $Revision:: 169 $
|
||||
// $Author:: Bschofield $
|
||||
// $Date:: 4/26/02 2:22p $
|
||||
//
|
||||
// Copyright (C) 2002 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source may not be distributed and/or modified without
|
||||
// expressly written permission by Ritual Entertainment, Inc.
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// RotateToEntity Behavior Definition
|
||||
//
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
//==============================
|
||||
// Forward Declarations
|
||||
//==============================
|
||||
class RotateToEntity;
|
||||
|
||||
#ifndef __ROTATE_TO_ENTITY_H__
|
||||
#define __ROTATE_TO_ENTITY_H__
|
||||
|
||||
#include "behavior.h"
|
||||
|
||||
//------------------------- CLASS ------------------------------
|
||||
//
|
||||
// Name: RotateToEntity
|
||||
// Base Class: Behavior
|
||||
//
|
||||
// Description: Rotates the actor to face the passed in entity
|
||||
//
|
||||
// Method of Use: Should be aggregated by other behaviors
|
||||
//--------------------------------------------------------------
|
||||
class RotateToEntity : public Behavior
|
||||
{
|
||||
|
||||
//------------------------------------
|
||||
// Parameters
|
||||
//------------------------------------
|
||||
private:
|
||||
float _turnspeed;
|
||||
EntityPtr _ent;
|
||||
str _anim;
|
||||
str _entityType;
|
||||
|
||||
//-------------------------------------
|
||||
// Public Interface
|
||||
//-------------------------------------
|
||||
public:
|
||||
CLASS_PROTOTYPE( RotateToEntity );
|
||||
|
||||
RotateToEntity();
|
||||
~RotateToEntity();
|
||||
|
||||
|
||||
void SetArgs ( Event *ev );
|
||||
void Begin ( Actor &self );
|
||||
BehaviorReturnCode_t Evaluate ( Actor &self );
|
||||
void End ( Actor &self );
|
||||
virtual void Archive ( Archiver &arc );
|
||||
|
||||
void SetAnim ( const str& animName );
|
||||
void SetTurnSpeed ( float turnSpeed );
|
||||
void SetEntity ( Entity *entity );
|
||||
void SetEntityType( const str &ent );
|
||||
|
||||
//-------------------------------------
|
||||
// Member Variables
|
||||
//-------------------------------------
|
||||
private:
|
||||
float _oldTurnSpeed;
|
||||
|
||||
|
||||
};
|
||||
|
||||
inline void RotateToEntity::SetTurnSpeed( float turnSpeed )
|
||||
{
|
||||
_turnspeed = turnSpeed;
|
||||
}
|
||||
|
||||
|
||||
inline void RotateToEntity::SetEntity( Entity *entity )
|
||||
{
|
||||
if ( entity )
|
||||
_ent = entity;
|
||||
}
|
||||
|
||||
inline void RotateToEntity::SetAnim( const str &animName )
|
||||
{
|
||||
_anim = animName;
|
||||
}
|
||||
|
||||
inline void RotateToEntity::SetEntityType( const str &ent )
|
||||
{
|
||||
if ( ent == "player" || ent == "enemy" )
|
||||
_entityType = ent;
|
||||
}
|
||||
|
||||
inline void RotateToEntity::Archive( Archiver &arc )
|
||||
{
|
||||
Behavior::Archive( arc );
|
||||
|
||||
//-------------------------------------
|
||||
// Archive Parameters
|
||||
//-------------------------------------
|
||||
arc.ArchiveFloat ( &_turnspeed );
|
||||
arc.ArchiveSafePointer ( &_ent );
|
||||
arc.ArchiveString ( &_anim );
|
||||
arc.ArchiveString( &_entityType );
|
||||
|
||||
//-------------------------------------
|
||||
// Archive Member Variables
|
||||
//-------------------------------------
|
||||
arc.ArchiveFloat ( &_oldTurnSpeed );
|
||||
}
|
||||
|
||||
|
||||
#endif /* __ROTATE_TO_ENTITY_H__ */
|
||||
//-----------------------------------------------------------------------------
|
||||
//
|
||||
// $Logfile:: /Code/DLLs/game/rotateToEntity.h $
|
||||
// $Revision:: 169 $
|
||||
// $Author:: Bschofield $
|
||||
// $Date:: 4/26/02 2:22p $
|
||||
//
|
||||
// Copyright (C) 2002 by Ritual Entertainment, Inc.
|
||||
// All rights reserved.
|
||||
//
|
||||
// This source may not be distributed and/or modified without
|
||||
// expressly written permission by Ritual Entertainment, Inc.
|
||||
//
|
||||
//
|
||||
// DESCRIPTION:
|
||||
// RotateToEntity Behavior Definition
|
||||
//
|
||||
//--------------------------------------------------------------------------------
|
||||
|
||||
//==============================
|
||||
// Forward Declarations
|
||||
//==============================
|
||||
class RotateToEntity;
|
||||
|
||||
#ifndef __ROTATE_TO_ENTITY_H__
|
||||
#define __ROTATE_TO_ENTITY_H__
|
||||
|
||||
#include "behavior.h"
|
||||
|
||||
//------------------------- CLASS ------------------------------
|
||||
//
|
||||
// Name: RotateToEntity
|
||||
// Base Class: Behavior
|
||||
//
|
||||
// Description: Rotates the actor to face the passed in entity
|
||||
//
|
||||
// Method of Use: Should be aggregated by other behaviors
|
||||
//--------------------------------------------------------------
|
||||
class RotateToEntity : public Behavior {
|
||||
public:
|
||||
//-------------------------------------
|
||||
// Public Interface
|
||||
//-------------------------------------
|
||||
CLASS_PROTOTYPE(RotateToEntity);
|
||||
|
||||
RotateToEntity();
|
||||
~RotateToEntity();
|
||||
|
||||
void SetArgs(Event* ev);
|
||||
void Begin(Actor& self);
|
||||
BehaviorReturnCode_t Evaluate(Actor& self);
|
||||
void End(Actor& self);
|
||||
virtual void Archive(Archiver& arc);
|
||||
|
||||
void SetAnim(const str& animName);
|
||||
void SetTurnSpeed(float turnSpeed);
|
||||
void SetEntity(Entity* entity);
|
||||
void SetEntityType(const str& ent);
|
||||
|
||||
private:
|
||||
//------------------------------------
|
||||
// Parameters
|
||||
//------------------------------------
|
||||
float _turnspeed;
|
||||
EntityPtr _ent;
|
||||
str _anim;
|
||||
str _entityType;
|
||||
|
||||
//-------------------------------------
|
||||
// Member Variables
|
||||
//-------------------------------------
|
||||
float _oldTurnSpeed;
|
||||
};
|
||||
|
||||
inline void RotateToEntity::SetTurnSpeed(float turnSpeed) {
|
||||
_turnspeed = turnSpeed;
|
||||
}
|
||||
|
||||
|
||||
inline void RotateToEntity::SetEntity(Entity* entity) {
|
||||
if (entity)
|
||||
_ent = entity;
|
||||
}
|
||||
|
||||
inline void RotateToEntity::SetAnim(const str& animName) {
|
||||
_anim = animName;
|
||||
}
|
||||
|
||||
inline void RotateToEntity::SetEntityType(const str& ent) {
|
||||
if (ent == "player" || ent == "enemy")
|
||||
_entityType = ent;
|
||||
}
|
||||
|
||||
inline void RotateToEntity::Archive(Archiver& arc) {
|
||||
Behavior::Archive(arc);
|
||||
|
||||
//-------------------------------------
|
||||
// Archive Parameters
|
||||
//-------------------------------------
|
||||
arc.ArchiveFloat(&_turnspeed);
|
||||
arc.ArchiveSafePointer(&_ent);
|
||||
arc.ArchiveString(&_anim);
|
||||
arc.ArchiveString(&_entityType);
|
||||
|
||||
//-------------------------------------
|
||||
// Archive Member Variables
|
||||
//-------------------------------------
|
||||
arc.ArchiveFloat(&_oldTurnSpeed);
|
||||
}
|
||||
|
||||
|
||||
#endif /* __ROTATE_TO_ENTITY_H__ */
|
||||
|
|
Loading…
Reference in a new issue