Class design Input - Player classes

I'm trying to figure out a good way to handle input in a game. I thought about just have it as part of the player class even though it wouldn't be a good practice but then comes the issue of the player not always existing (such as before logging into a game). Assuming I have a Input class what would be the best or even normal(if there is one) way to detect input in my player class.

1
2
3
4
5
6
7
8
9
10
11
class Input
{
    handleMouse();
    handleKeyboard();
    keyState;
    mousestate;

public:
    getKeyState();
    getMouseState();
};  


I thought of using something like this and just use input.getKeyState() within my player class but then it would be dependant on the input class anyway.

Pretty much any object in the world that can be interacted with will be derived from a Entity class and each one will be scripted to do different things using a static update function.
Last edited on
Topic archived. No new replies allowed.