ef2gamesource/dlls/game/actor_posturecontroller.hpp

91 lines
2.5 KiB
C++
Raw Normal View History

2012-12-30 16:37:54 +00:00
//-----------------------------------------------------------------------------
//
// $Logfile:: /Code/DLLs/game/actor_posturecontroller.h $
// $Revision:: 15 $
// $Author:: Sketcher $
// $Date:: 5/20/02 3:55p $
//
// Copyright (C) 2001 by Ritual Entertainment, Inc.
// All rights reserved.
//
// This source may not be distributed and/or modified without
// expressly written permission by Ritual Entertainment, Inc.
//
//-----------------------------------------------------------------------------
class PostureController;
#ifndef __ACTOR_POSTURECONTROLLER_HPP__
#define __ACTOR_POSTURECONTROLLER_HPP__
extern Event EV_Posture_Anim_Done;
extern Event EV_PostureChanged_Completed;
//------------------------- CLASS ------------------------------
//
// Name: PostureController
// Base Class: None
//
// Description: This class will control the posture of the Actor. It will maintain
// an enum of the current posture and will have methods for changing
// posture via Animations... Eventually, these will need to be modified
// to call functions on some type of animation manager
//
// Method of Use: Instantiated by the Actor
//
//--------------------------------------------------------------
class PostureController
{
2015-04-29 20:34:44 +00:00
public:
PostureController();
explicit PostureController(Actor *actor);
virtual ~PostureController();
virtual void Archive(Archiver &arc);
void DoArchive(Archiver &arc, Actor *actor);
void evaluate();
bool requestPosture(const str &postureState, Listener *requestor);
2012-12-30 16:37:54 +00:00
2015-04-29 20:34:44 +00:00
const str& getRequestedPostureName();
const str& getCurrentPostureName();
2012-12-30 16:37:54 +00:00
2015-04-29 20:34:44 +00:00
void setPostureStateMap(const str &stateMap, bool loading);
void setPostureState(const str &postureState);
void setPostureState(const str &postureState, const str &requestedState);
2012-12-30 16:37:54 +00:00
2015-04-29 20:34:44 +00:00
protected:
void init();
2012-12-30 16:37:54 +00:00
2015-04-29 20:34:44 +00:00
private:
StateMap *_postureStateMap;
str _postureStateMap_Name;
2012-12-30 16:37:54 +00:00
2015-04-29 20:34:44 +00:00
State *_currentPostureState;
str _currentPostureState_Name;
2012-12-30 16:37:54 +00:00
2015-04-29 20:34:44 +00:00
State *_requestedPostureState;
str _requestedPostureState_Name;
2012-12-30 16:37:54 +00:00
2015-04-29 20:34:44 +00:00
SafePtr<Listener> _requestor;
Container<Conditional*> _postureConditionals;
2012-12-30 16:37:54 +00:00
2015-04-29 20:34:44 +00:00
Actor *act;
2012-12-30 16:37:54 +00:00
};
inline const str& PostureController::getRequestedPostureName()
{
2015-04-29 20:34:44 +00:00
return _requestedPostureState_Name;
2012-12-30 16:37:54 +00:00
}
inline const str& PostureController::getCurrentPostureName()
{
2015-04-29 20:34:44 +00:00
return _currentPostureState_Name;
2012-12-30 16:37:54 +00:00
}
#endif /* __ACTOR_POSTURECONTROLLER_HPP__ */