Variables in a state pattern system
I asked this question on another forum, but they are notorious for taking weeks to get a response (At least for me anyway). So I'll ask here, and update if I get a reply from anywhere.


I have a state based object (an enemy object), with multiple state categories. Here are the top level ones:

-MovStates
-AimStates
-AIStates
-DrawStates


The only thing I am having a problem with is variables. I have two options (that I know of, I am open to more). 

I can have a centralized variable system, which would require a large number of getters and setters being called many times per frame be each state(especial movement, which would be using velocity, x/y, and distance).

The other option would be each state managing its own variables, so the movement states would have all the movement related variables, and so on. This causes problems if different states need the same variable.


What should I do? Efficiency is important as well.
Variables in a state pattern system
===

I asked this question on another forum, but they are notorious for taking weeks to get a response (At least for me anyway). So I'll ask here, and update if I get a reply from anywhere.


I have a state based object (an enemy object), with multiple state categories. Here are the top level ones:

-MovStates
-AimStates
-AIStates
-DrawStates


The only thing I am having a problem with is variables. I have two options (that I know of, I am open to more). 

I can have a centralized variable system, which would require a large number of getters and setters being called many times per frame be each state(especial movement, which would be using velocity, x/y, and distance).

The other option would be each state managing its own variables, so the movement states would have all the movement related variables, and so on. This causes problems if different states need the same variable.


What should I do? Efficiency is important as well.