コード例 #1
0
ファイル: Stores.cpp プロジェクト: AFIT-Hodson/OpenEaagles
// Returns the number of weapons available for launch
unsigned int Stores::available() const
{
   unsigned int n = 0;
   for (unsigned int s = 1; s <= ns; s++) {
      if ( isWeaponAvailable(s) ) n++;
   }
   return n;
}
コード例 #2
0
void Player::cycleWeapons()
{
	LevelState level = parent->getParent()->getLevelState();
	int newWeapon = (currentWeapon + 1) % 4;
	while (!isWeaponAvailable(newWeapon))
	{
		newWeapon = (newWeapon + 1) % 4;
	}

	if (currentWeapon != newWeapon)
	{
		parent->getParent()->playSample("Sound2");
		currentWeapon = newWeapon;
		setState (false);
	}
	else
	{
		parent->getParent()->playSample("Sound1");
	}
}