Hello there, fellow programmers!
I'm relatively new to programming and while trying to develop my first simple game i've stumbled upon a problem that i have been unable to solve for days. :*(
So before throwing myself off a cliff in frustration i turn to you to see if your magic can solve my problem.
The game involves creating multiple objects of a class ("Enemy") and storing these objects within a vector.
The problem appears to occure during this storing process.
I get the following error:
error C2582: 'operator =' function is unavailable in 'Enemy' .....(directory details)
This is the .h file of the EventHandler, which is the one handling the storing of this object:
Here is the .cpp file:Code:#ifndef INCLUDED_EVENTHANDLER #define INCLUDED_EVENTHANDLER #include "Enemy.h" #include <vector> class EventHandler { public: EventHandler(); typedef std::vector<Enemy> EnemyVector; EnemyVector enemies; void SpawnEnemy(); }; #endif
If this is not sufficient to be able to solve the problem i'll post more code.Code:#include "EventHandler.h" EventHandler::EventHandler(): enemies(){} void EventHandler::SpawnEnemy(){ enemies.push_back(Enemy()); }
I'm a biiig noob when it comes to programming (started this summer) so help would be infinitely appriciated!!
Thanks in advance!![]()



LinkBack URL
About LinkBacks




