I'm creating a few classes and I decided to create a basic class that other classes will just inherit that basic class
So here is my basic class header
#pragma once
#include "ImageService.h"
class State
{
public:
State( ImageService& is );
~State();
void Update();
};
don't worry about the methods, they aren't the problem. So now I go ahead and create a IntroState like so (header file)
#pragma once
#include "State.h"
class IntroState : public State
{
public:
IntroState(ImageService& imageService);
~IntroState();
GameState objectState;
};
and here is the cpp file
#include "IntroState.h"
IntroState::IntroState(ImageService& imageService)
{
//error here
}
IntroState::~IntroState()
{
}
at the constructor it is stating "no default constructor for class "State"", now what I think is going on is, the default constructor for State needs a imageService reference passed to it. So how would I pass the imageservice in this constructor to the state constructor?