1 #ifndef _UNIVERSE_UTILGENERIC_H__
4 #define _UNIVERSE_UTILGENERIC_H__
5 #include "cmd/collection.h"
7 #include "networking/const.h"
8 #include "cmd/unit_util.h"
17 namespace UniverseUtil
23 PythonUnitIter(
const UnitCollection::UnitIterator &t ) : UnitIterator( t ) {}
28 UnitIterator::advance();
41 UnitIterator::preinsert( unit );
45 return UnitIterator::isDone();
49 return UnitIterator::notDone();
53 UnitIterator::remove();
62 std::string
LookupUnitStat(
const std::string &unitname,
const std::string &
faction,
const std::string &statname );
94 Unit *
getUnitByPtr(
void *ptr, Unit *finder = 0,
bool allowslowness =
true );
106 std::string faction_string,
107 std::string type_string,
108 std::string unittype_string,
109 std::string ai_string,
113 std::string squadlogo,
114 std::string destinations );
115 std::string
vsConfig( std::string category, std::string option, std::string def );
118 Unit *
launch( std::string name_string,
119 std::string type_string,
120 std::string faction_string,
121 std::string unittype,
122 std::string ai_string,
126 std::string sqadlogo );
129 Cargo
getRandCargo(
int quantity, std::string category );
138 std::vector< std::string >
GetJumpPath( std::string from, std::string to );
231 void playSound( std::string soundName, QVector loc, Vector speed );
237 void playAnimation( std::string aniName, QVector loc,
float size );
238 void playAnimationGrow( std::string aniName, QVector loc,
float size,
float growpercent );
241 void TargetEachOther( std::string fgname, std::string
faction, std::string enfgname, std::string enfaction );
270 void AdjustRelation( std::string myfaction, std::string theirfaction,
float factor,
float rank );
271 float GetRelation( std::string myfaction, std::string theirfaction );
281 void setObjective(
int which, std::string newobjective );
303 void IOmessage(
int delay, std::string from, std::string to, std::string message );
324 std::string faction_string,
325 std::string type_string,
326 std::string unittype_string,
327 std::string ai_string,
331 std::string squadlogo,
332 std::string destinations );
335 Unit *
launch( std::string name_string,
336 std::string type_string,
337 std::string faction_string,
338 std::string unittype,
339 std::string ai_string,
343 std::string sqadlogo );
346 Cargo
getRandCargo(
int quantity, std::string category );
370 void playSound( std::string soundName, QVector loc, Vector speed );
373 void playAnimation( std::string aniName, QVector loc,
float size );
374 void playAnimationGrow( std::string aniName, QVector loc,
float size,
float growpercent );
390 void sendCustom(
int cp,
string cmd,
string args,
string id );
392 void receivedCustom(
int cp,
bool trusted,
string cmd,
string args,
string id );
394 std::string
getVariable( std::string section, std::string name, std::string def );
395 std::string
getSubVariable( std::string section, std::string subsection, std::string name, std::string def );
397 double sqrt(
double );
398 double log(
double );
399 double exp(
double );
400 double cos(
double );
401 double sin(
double );
402 double acos(
double );
403 double asin(
double );
404 double atan(
double );
405 double tan(
double );
407 void addParticle( QVector loc, Vector velocity, Vector color,
float size );
413 std::string
getSaveInfo(
const std::string &filename,
bool formatForTextbox );
417 void loadGame(
const std::string &savename );
418 void saveGame(
const std::string &savename );