#include <gAICharacter.h>
Public Member Functions | |
bool | Load (std::istream &file) |
Static Public Member Functions | |
static void | LoadAll (const tString &filename) |
Public Attributes | |
tString | name |
tString | description |
int | properties [AI_PROPERTIES] |
REAL | iq |
Static Public Attributes | |
static tArray< gAICharacter > | s_Characters |
Definition at line 41 of file gAICharacter.h.
bool gAICharacter::Load | ( | std::istream & | file | ) |
Definition at line 58 of file gAICharacter.cpp.
References AI_PROPERTIES, description, iq, name, properties, tString::ReadLine(), REAL, and weight.
Referenced by LoadSingleAI().
00059 { 00060 file >> name; 00061 00062 iq = 1; 00063 REAL iqt = 1; 00064 00065 for (int i=0; i< AI_PROPERTIES; i++) 00066 { 00067 if (file.eof()) 00068 return false; 00069 00070 file >> properties[i]; 00071 iq += properties[i] * weight[i]; 00072 iqt += weight[i]; 00073 } 00074 iq *= 10/iqt; 00075 00076 description.ReadLine(file); 00077 return true; 00078 }
void gAICharacter::LoadAll | ( | const tString & | filename | ) | [static] |
Definition at line 98 of file gAICharacter.cpp.
References tDirectories::Config(), tTextFileRecorder::EndOfFile(), tTextFileRecorder::GetLine(), and LoadSingleAI().
Referenced by main().
00099 { 00100 std::ifstream f; 00101 00102 tTextFileRecorder stream( tDirectories::Config(), filename ); 00103 while( !stream.EndOfFile() ) 00104 { 00105 tString line( stream.GetLine().c_str() ); 00106 if ( line[0] != '#' ) 00107 LoadSingleAI( line ); 00108 } 00109 }
Definition at line 43 of file gAICharacter.h.
Referenced by gAITeam::BalanceWithAIs(), Load(), and gAIPlayer::SetNumberOfAIs().
int gAICharacter::properties[AI_PROPERTIES] |
Definition at line 45 of file gAICharacter.h.
Referenced by gAIPlayer::CycleBlocksWay(), gAIPlayer::EmergencySurvive(), gAISensor::gAISensor(), Load(), gAIPlayer::NewObject(), gAIPlayer::RightBeforeDeath(), gAIPlayer::SwitchToState(), and gAIPlayer::Timestep().
Definition at line 47 of file gAICharacter.h.
Referenced by gAITeam::BalanceWithAIs(), BestIQ(), Load(), and gAIPlayer::SetNumberOfAIs().
tArray< gAICharacter > gAICharacter::s_Characters [static] |