src/tron/gAICharacter.cpp File Reference

#include "gAICharacter.h"
#include "tDirectories.h"
#include "tConfiguration.h"
#include "tRecorder.h"
#include <fstream>
#include <sstream>

Include dependency graph for gAICharacter.cpp:

Go to the source code of this file.

Functions

static bool LoadSingleAI (tString const &line)

Variables

tString aiPlayersConfig ("aiplayers.cfg")
static tSettingItem< tStringaifile ("AI_CHARACTER_FILE", aiPlayersConfig)
static REAL weight [AI_PROPERTIES]


Function Documentation

static bool LoadSingleAI ( tString const &  line  )  [static]

Definition at line 81 of file gAICharacter.cpp.

References c, GrowingArrayBase::Len(), gAICharacter::Load(), gAICharacter::s_Characters, and tArray< T, MALLOC >::SetLen().

Referenced by gAICharacter::LoadAll().

00082 {
00083     // build stream from
00084     std::stringstream str(static_cast< char const * >( line ) );
00085 
00086     // gets new character and lets it load the stream
00087     int i = gAICharacter::s_Characters.Len();
00088     gAICharacter& c = gAICharacter::s_Characters[i];
00089     bool ret = c.Load(str);
00090 
00091     // remove character on failure
00092     if ( !ret )
00093         gAICharacter::s_Characters.SetLen(i);
00094 
00095     return ret;
00096 }

Here is the call graph for this function:

Here is the caller graph for this function:


Variable Documentation

tSettingItem<tString> aifile("AI_CHARACTER_FILE", aiPlayersConfig) [static]

tString aiPlayersConfig("aiplayers.cfg")

Referenced by main().

REAL weight[AI_PROPERTIES] [static]

Initial value:

    {
        10,
        10,
        10,
        10,
        10,
        10,
        10,
        10,
        10,
        10,
        0,
        0,
        0
    }

Definition at line 40 of file gAICharacter.cpp.

Referenced by gAICharacter::Load(), nServerLag::Report(), and se_receiveLagMessage().


Generated on Sat Mar 15 23:14:27 2008 for Armagetron Advanced by  doxygen 1.5.4