Пример #1
0
bool Weapon::reload(Clip& clip)
{
   if (acceptable_ammo(clip) && !clip.empty())
   {
      loaded_cliptype_ = clip.get_itemtypename();
      ammo_ = clip.get_ammoamount();
      clip.decrease_number(1);
      return true;
   }
   else
      return false;
}
Пример #2
0
bool Weapon::acceptable_ammo(const Clip& c) const
   { return weapontype[getweapontype(itemtypename())]->acceptable_ammo(c.get_itemtypename()); }