I have some code that looks like this:
public static class Control
{
public static Dictionary<PlayerIndex, GamePadState> gamePadState = new Dictionary<PlayerIndex,GamePadState>();
public static Dictionary<PlayerIndex, GamePadState> oldGamePadState = new Dictionary<PlayerIndex, GamePadState>();
public static void UpdateControlls()
{
gamePadState.Clear();
foreach (PlayerIndex pIndex in pIndexArray)
{ gamePadState.Add(pIndex,GamePad.GetState(pIndex)); }
}
}
As I looked through the code in Debug, when I called gamePadState.Add(...);, It also added to oldGamePadState, even though I never called oldGamePadState.Add(...);