Class inaccessible pointer
<p>Hello need your help to solve this problem or just explain me why my pointer is inaccessible .</p>

<p>PlayerSprite.h</p>

<pre><code>#pragma once
#include "LoadPlayerRes.h"
#include "Keyboard.h"
#include "PlayerState.h"

class PlayerSprite :public LoadPlayerRes{
public:
    PlayerSprite(float x, float y,float speed)
        :
        x(x),
        y(y),
        speed(speed)
    {
        pCurrentState = new StateStand(&amp;Stand);
    }
    void Controls(Keyboard&amp; kbd) {
        speed = 0;
        if (speed == 0) {
            delete pCurrentState;
            pCurrentState = new StateStand(&amp;Stand);
        }
    }
    void Draw(Graphics&amp; gfx) {
        pCurrentState-&gt;pSprite-&gt;Draw(x, y, gfx);// pSprite inaccessible 
    }
private:
    float x, y,speed;
    PlayerState* pCurrentState;
};
</code></pre>

<p>PlayerState.h</p>

<pre><code>#pragma once
#include "SurfaceAnimation.h"
class PlayerState {
public:
    PlayerState(SurfaceAnimation* pSprite)
        :
        pSprite(pSprite)
    {}
protected:
    SurfaceAnimation* pSprite;
};

class StateStand :public PlayerState {
public:
    StateStand(SurfaceAnimation* pSprite)
        :
        PlayerState(pSprite)
    {}
};
</code></pre>

<p>so i am trying to make a player state machine ,PlayerState class job is to point to right SurfaceAnimation object and based on pointer i will draw a player inside PlayerSprite class , but for some reason pSprite is inaccessible.</p>