gAICharacter Class Reference

#include <gAICharacter.h>

Collaboration diagram for gAICharacter:

Collaboration graph
[legend]

List of all members.

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< gAICharacters_Characters


Detailed Description

Definition at line 41 of file gAICharacter.h.


Member Function Documentation

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 }

Here is the call graph for this function:

Here is the caller graph for this function:

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 }

Here is the call graph for this function:

Here is the caller graph for this function:


Member Data Documentation

tString gAICharacter::name

Definition at line 43 of file gAICharacter.h.

Referenced by gAITeam::BalanceWithAIs(), Load(), and gAIPlayer::SetNumberOfAIs().

tString gAICharacter::description

Definition at line 43 of file gAICharacter.h.

Referenced by Load().

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().

REAL gAICharacter::iq

Definition at line 47 of file gAICharacter.h.

Referenced by gAITeam::BalanceWithAIs(), BestIQ(), Load(), and gAIPlayer::SetNumberOfAIs().

tArray< gAICharacter > gAICharacter::s_Characters [static]

Definition at line 51 of file gAICharacter.h.

Referenced by BestIQ(), and LoadSingleAI().


The documentation for this class was generated from the following files:
Generated on Sat Mar 15 23:32:40 2008 for Armagetron Advanced by  doxygen 1.5.4