本文整理汇总了C++中Weapon::Init方法的典型用法代码示例。如果您正苦于以下问题:C++ Weapon::Init方法的具体用法?C++ Weapon::Init怎么用?C++ Weapon::Init使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Weapon
的用法示例。
在下文中一共展示了Weapon::Init方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C++代码示例。
示例1: Init
void Character::Init( Screen3D& Screen, WorldManager* WM, MeshManager& MM, SoundManager& AM, char* ObjectFile )
{
//load in the animated mesh
char TempBuffer[255];
GetIniValue(ObjectFile, "graphics", "animation_file", TempBuffer);
MeshA.Init( Screen, MM, TempBuffer );
//Store some pointery things
WMPtr = WM;
MMPtr = &MM;
Health = GetIniValue(ObjectFile, "properties", "health");
//Load in the character's primary weapon
GetIniValue(ObjectFile, "weapon", "weapon", TempBuffer);
if( strcmpi(TempBuffer, "nostring") != 0)
{
//Create the weapon
Weapon* DefaultWeapon = new Weapon;
DefaultWeapon->Init( Screen, WM, MM, AM, TempBuffer );
//Add it to the world
WMPtr->Add( DefaultWeapon );
//also add it locally
this->AddEntity(DefaultWeapon );
}
//load in the side arm
GetIniValue(ObjectFile, "weapon", "sidearm", TempBuffer);
if( strcmpi(TempBuffer, "nostring") != 0)
{
Weapon* SideWeapon = new Weapon;
SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );
WMPtr->Add( SideWeapon );
this->AddEntity(SideWeapon );
}
CurrentState = "idle";
//CharacterScript = GetSSLKernel()->TaskMan.BuildScript( "..\\scripts\\enemy.shil", NULL );
/*
Value V;
V.SetNum( ID );
GetSSLKernel()->TaskMan.AddFunctionParameter( CharacterScript, V );
GetSSLKernel()->TaskMan.CallAppFunction( CharacterScript, "SetCharacterHandle", 1 );
GetSSLKernel()->TaskMan.RunActiveScripts( 100);*/
}
示例2: Init
void NetworkAvatar::Init( Screen3D& Screen, WorldManager* WM, MeshManager& MM, SoundManager& AM, char* ObjectFile )
{
//load in the animated mesh
char TempBuffer[255];
GetIniValue(ObjectFile, "graphics", "animation_file", TempBuffer);
MeshA.Init( Screen, MM, TempBuffer );
//Store some pointery things
WMPtr = WM;
MMPtr = &MM;
//Load in the character's primary weapon
GetIniValue(ObjectFile, "weapon", "weapon", TempBuffer);
if( strcmpi(TempBuffer, "nostring") != 0)
{
//Create the weapon
Weapon* DefaultWeapon = new Weapon;
DefaultWeapon->Init( Screen, WM, MM, AM, TempBuffer );
//Add it to the world
WMPtr->Add( DefaultWeapon );
//also add it locally
this->AddEntity(DefaultWeapon );
}
//load in the side arm
GetIniValue(ObjectFile, "weapon", "sidearm", TempBuffer);
if( strcmpi(TempBuffer, "nostring") != 0)
{
Weapon* SideWeapon = new Weapon;
SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );
WMPtr->Add( SideWeapon );
this->AddEntity(SideWeapon );
}
//load in the third weapon
GetIniValue(ObjectFile, "weapon", "third", TempBuffer);
if( strcmpi(TempBuffer, "nostring") != 0)
{
Weapon* SideWeapon = new Weapon;
SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );
WMPtr->Add( SideWeapon );
this->AddEntity(SideWeapon );
}
//load in the fourth weapon
GetIniValue(ObjectFile, "weapon", "fourth", TempBuffer);
if( strcmpi(TempBuffer, "nostring") != 0)
{
Weapon* SideWeapon = new Weapon;
SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );
WMPtr->Add( SideWeapon );
this->AddEntity(SideWeapon );
}
//load in the fifth weapon
GetIniValue(ObjectFile, "weapon", "fifth", TempBuffer);
if( strcmpi(TempBuffer, "nostring") != 0)
{
Weapon* SideWeapon = new Weapon;
SideWeapon->Init( Screen, WM, MM, AM, TempBuffer );
WMPtr->Add( SideWeapon );
this->AddEntity(SideWeapon );
}
}