Vegastrike 0.5.1 rc1  1.0
Original sources for Vegastrike Evolved
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
CommunicationMessage Class Reference

#include <communication.h>

Public Member Functions

 CommunicationMessage (Unit *send, Unit *recv, std::vector< class Animation * > *ani, unsigned char sex)
 
 CommunicationMessage (Unit *send, Unit *recv, int curstate, std::vector< class Animation * > *ani, unsigned char sex)
 
 CommunicationMessage (Unit *send, Unit *recv, int prevvstate, int curstate, std::vector< class Animation * > *ani, unsigned char sex)
 
 CommunicationMessage (Unit *send, Unit *recv, const CommunicationMessage &prevsvtate, int curstate, std::vector< class Animation * > *ani, unsigned char sex)
 
void SetCurrentState (int message, std::vector< class Animation * > *ani, unsigned char sex)
 
FSM::NodegetCurrentState () const
 
const vector< FSM::Node > & GetPossibleState () const
 
float getDeltaRelation () const
 

Public Attributes

FSMfsm
 
class Animationani
 
unsigned char sex
 
int prevstate
 
int curstate
 
int edgenum
 
UnitContainer sender
 

Detailed Description

Definition at line 61 of file communication.h.

Constructor & Destructor Documentation

CommunicationMessage::CommunicationMessage ( Unit send,
Unit recv,
std::vector< class Animation * > *  ani,
unsigned char  sex 
)
CommunicationMessage::CommunicationMessage ( Unit send,
Unit recv,
int  curstate,
std::vector< class Animation * > *  ani,
unsigned char  sex 
)
CommunicationMessage::CommunicationMessage ( Unit send,
Unit recv,
int  prevvstate,
int  curstate,
std::vector< class Animation * > *  ani,
unsigned char  sex 
)
CommunicationMessage::CommunicationMessage ( Unit send,
Unit recv,
const CommunicationMessage prevsvtate,
int  curstate,
std::vector< class Animation * > *  ani,
unsigned char  sex 
)

Member Function Documentation

FSM::Node* CommunicationMessage::getCurrentState ( ) const
inline

Definition at line 84 of file communication.h.

References curstate, fprintf, fsm, FSM::getDefaultState(), and FSM::nodes.

Referenced by FireKeyboard::DoSpeechAndAni(), FireKeyboard::Execute(), CommunicatingAI::ProcessCommMessage(), FireKeyboard::ProcessCommMessage(), and CommunicatingAI::selectCommunicationMessage().

85  {
86  if ( curstate < (int) fsm->nodes.size() ) {
87  return &fsm->nodes[curstate];
88  } else {
89  int cs = fsm->getDefaultState( 0 );
90  if ( cs < (int) fsm->nodes.size() )
91  return &fsm->nodes[cs];
92  fprintf( stderr, "Critical error: fsm has less than 3 nodes\n" );
93  return &fsm->nodes[0];
94  }
95  }
float CommunicationMessage::getDeltaRelation ( ) const
inline

Definition at line 97 of file communication.h.

References curstate, fsm, FSM::getDeltaRelation(), and prevstate.

Referenced by Order::Communicate().

98  {
100  }
const vector< FSM::Node >& CommunicationMessage::GetPossibleState ( ) const

Member Data Documentation

class Animation* CommunicationMessage::ani

Definition at line 67 of file communication.h.

Referenced by FireKeyboard::DoSpeechAndAni().

int CommunicationMessage::edgenum

Definition at line 71 of file communication.h.

Referenced by NetClient::communicationRequest().

int CommunicationMessage::prevstate

Definition at line 69 of file communication.h.

Referenced by NetClient::communicationRequest(), and getDeltaRelation().

unsigned char CommunicationMessage::sex

Definition at line 68 of file communication.h.

Referenced by FireKeyboard::ProcessCommMessage().


The documentation for this class was generated from the following files: