lua-users home
lua-l archive

[Date Prev][Date Next][Thread Prev][Thread Next] [Date Index] [Thread Index]


Hello.

I would like to know your oppinion on what's the
fastest way to load configuration files.

For example, if I have the structure in C++:

typedef struct{
  string name;
  int health;
  ... other fields...
}CMonster;

vector<CMonster> monsters;

Then in Lua I have the following table:

Monsters1 = {
{ name = "gollen", health = 100 };
{ name = "orc", health = 40 };
... and so on...
}

this table could be created like this:

Monsters2 = {}

Monsters2.gollen = {
 health = 100;
 ... other fields...
}

Monsters2.orc = {
 health = 40;
 ... other fields...
}

What's the fastest way of feed the C++ 'monster'
vector with the contents of the tables Monsters1 or
Monsters2?

The 'monster' record can have nested tables.




______________________________________________________________________

Yahoo! Mail - agora com 100MB de espaço, anti-spam e antivírus grátis!
http://br.info.mail.yahoo.com/