本文整理汇总了C++中Planet::SetSerial方法的典型用法代码示例。如果您正苦于以下问题:C++ Planet::SetSerial方法的具体用法?C++ Planet::SetSerial怎么用?C++ Planet::SetSerial使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Planet
的用法示例。
在下文中一共展示了Planet::SetSerial方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: createPlanet
Planet* UnitFactory::createPlanet( QVector x,
QVector y,
float vely,
const Vector &rotvel,
float pos,
float gravity,
float radius,
const std::string &filename,
const std::string &technique,
const std::string &unitname,
BLENDFUNC sr,
BLENDFUNC ds,
const vector< string > &dest,
const QVector &orbitcent,
Unit *parent,
const GFXMaterial &ourmat,
const std::vector< GFXLightLocal > &ligh,
int faction,
string fullname,
bool inside_out,
ObjSerial netcreate )
{
_Universe->netLock( true );
Planet *p = new Planet( x, y, vely, rotvel, pos, gravity, radius,
filename, technique, unitname, dest, orbitcent, parent, faction,
fullname, inside_out, ligh.size() );
_Universe->netLock( false );
if (netcreate)
p->SetSerial( netcreate );
/*
* // False: Only allow creation through system files? Doesn't make sense to be able to dynamically generate these.
* // Could cause inconsistencies with new clients that just read system files.
* if ( false && !_Universe->netLocked()) {
* NetBuffer netbuf;
* // Send a packet to clients in order to make them create this unit
*
* addPlanetBuffer( netbuf, x, y, vely, rotvel, pos, gravity, radius, filename, sr, ds, dest, orbitcent, parent, ourmat, ligh, faction, fullname, inside_out, netcreate);
* endBuffer( netbuf );
* VSServer->broadcast( netbuf, 0, _Universe->activeStarSystem()->GetZone(), CMD_ENTERCLIENT, true);
* }
* VSServer->invalidateSnapshot();
*/
return p;
}
示例2: createPlanet
Planet* UnitFactory::createPlanet( QVector x,
QVector y,
float vely,
const Vector & rotvel,
float pos,
float gravity,
float radius,
const char * filename,
BLENDFUNC sr, BLENDFUNC ds,
const vector<string> &dest,
const QVector &orbitcent,
Unit * parent,
const GFXMaterial & ourmat,
const std::vector <GFXLightLocal> & ligh,
int faction,
string fullname ,
bool inside_out, ObjSerial netcreate)
{
Planet * p = new GamePlanet( x,
y,
vely,
rotvel,
pos,
gravity,
radius,
filename,
sr,ds,
dest,
orbitcent,
parent,
ourmat,
ligh,
faction,
fullname ,
inside_out);
if( netcreate) {
KillDuplicateUnits( netcreate);
p->SetSerial( netcreate);
}
return p;
}