public Input(int index) { this.gamepadIndex = index; using (StreamReader reader = new StreamReader("input.json")) { string json = reader.ReadToEnd(); mapping = new JavaScriptSerializer().Deserialize <List <InputMapping> >(json).Single(m => m.index == index); } }
public Input(InputMapping mapping) { gamepadIndex = mapping.index; }