Player::Player(string _name, Room *starting_room)
{
name = _name;
current_room = starting_room;
}
I have an error when I try to run/compile my "main.cpp", I don't see anything wrong in the constructor below. But I'm still getting this errors:
error: expected primary-expression before '_name'
error: expected primary-expression before '*'
error: cannot call constructor 'Player::Player' directly [-fpermissive]
note: for a function-style cast, remove the redundant '::Player'
error: 'starting_room' was not declared in this scope
Edit 1: Player class inherits from Agent class
//Player.h
#ifndef PLAYER_H
#define PLAYER_H
#include<string>
#include "Room.h"
#include "Agent.h"
using namespace std;
class Player: public Agent
{
public:
Player();
Player(string _name, Room *starting_room);
virtual bool act(string direction);
};
#endif // PLAYER_H
//"Agent.h"
#ifndef AGENT_H
#define AGENT_H
#include <Room.h>
#include<string>
using namespace std;
class Agent
{
protected:
Room *current_room;
string name;
public:
Agent();
virtual bool act(string) ;
string getName();
string getCurrentRoomName();
string toLower(string temp);
Room* getCurrentRoom();
};
#endif // AGENT_H