I want to make a vector where the type is my overloading constructor or to be precise I want to make a vector of monsters but I cant seem to pass it and I have no idea why. What did I do wrong?
// Monster.cpp
#include <iostream>
#include <string>
#include "Monster.h"
#include "Player.h"
#include "Random.h"
#include "Weapon.h"
using namespace std;
Monster::Monster(const std::string& name, int hp, int acc,
int xpReward, int armor, const std::string& weaponName,
int lowDamage, int highDamage, int monstergold)
{
mName = name;
mHitPoints = hp;
mAccuracy = acc;
mExpReward = xpReward;
mArmor = armor;
mWeapon.mName = weaponName;
mWeapon.mDamageRange.mLow = lowDamage;
mWeapon.mDamageRange.mHigh = highDamage;
mGold = monstergold;
}
this is the map , if the roll was higher than 20, it should encounter a group of monsters
else if (roll > 20)
{
vector <Monster(const std::string& name, int hp, int acc,int xpReward, int armor, const std::string& weaponName, int lowDamage, int highDamage, int monstergold)> MonsterArray;
MonsterArray.push_back("Orc Lord", 25, 15, 2000, 5,"Two Handed Sword", 5, 20, 100);
cout << "You encountered an multiple monsters!!!" << endl;
cout << "Prepare for battle!" << endl;
cout << endl;
}
the error was, it says that no overloaded function. I know this is wrong but I just really have no idea how to do it. any advice?