public override void Deserialize(BinaryReader reader) { byte version = reader.ReadByte(); int count = reader.ReadInt32(); for (int i = 0; i < count; i++) { // Use Add so we can leverage order of param evaluation rules for reading data in the right order. KeyToAction.Add((Keys)reader.ReadInt32(), reader.ReadInt32()); } count = reader.ReadInt32(); for (int i = 0; i < count; i++) { KeyToState.Add((Keys)reader.ReadInt32(), reader.ReadInt32()); } count = reader.ReadInt32(); for (int i = 0; i < count; i++) { ButtonToAction.Add((Buttons)reader.ReadInt32(), reader.ReadInt32()); } count = reader.ReadInt32(); for (int i = 0; i < count; i++) { ButtonToState.Add((Buttons)reader.ReadInt32(), reader.ReadInt32()); } }
public override void Init() { KeyToAction.Clear(); KeyToState.Clear(); ButtonToAction.Clear(); ButtonToState.Clear(); }