1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34
|
#include <iostream>
#include <string>
#include "weapon.h"
#include "weaponList.h"
using namespace std;
int main()
{
WeaponList weaponList;
cout << "First, we're going to add an axe to the list with the 'Add Weapon Function' and then display it in a table. Press enter when you are done with looking at it." << endl;
weaponList.addWeapon("Axe", 10, "Neutral", 0);
weaponList.showWeapons();
cout << "----------------------------------------------------------------------------------------------" << endl;
cin.ignore();
cout << "Now I will add in a sword and a katana with the same function, and show you the new table. Press enter when you are done." << endl;
weaponList.addWeapon("Katana", 20, "Ice", 1);
weaponList.addWeapon("Sword", 50, "Fire", 1);
weaponList.showWeapons();
cout << "----------------------------------------------------------------------------------------------" << endl;
cin.ignore();
cout << "In the next part, I will insert a weapon based on its name, using the 'Insert Weapon Function'. Press enter when you are finished." << endl;
weaponList.insertWeapon("Pistol", 5, "Neutral", 0);
weaponList.showWeapons();
cout << "----------------------------------------------------------------------------------------------" << endl;
cin.ignore();
cout << "Lastly, I will remove the katana from the list using the 'Remove Weapon Function'." << endl;
weaponList.removeWeapon("Katana");
weaponList.showWeapons();
return 0;
}
| |