private bool CheckUpdateable(Racer r) { return(CheckInRace(r) && initialized); }
// CHECKING private bool CheckInRace(Racer r) { return(r.GetData(Addr.Static.InRace) > 0); }
private bool CheckRacePaused(Racer r) { return(r.GetData(Addr.Static.PauseState) > 0); }
public Id DeepState(Racer r) { // in-race if (data.GetValue(r, Addr.Static.InRace) == 1) { if (data.GetValue(r, Addr.Static.PauseState) > 0) { return(Id.RacePaused); } if ((data.GetValue(r, Addr.Pod.Flags) & (1 << 0)) == 0 && (data.GetValue(r, Addr.Pod.Flags) & (1 << 1)) == 0) { return(Id.RaceStarting); } if ((data.GetValue(r, Addr.Pod.Flags) & (1 << 0)) != 0 && (data.GetValue(r, Addr.Pod.Flags) & (1 << 1)) != 0) { return(Id.RaceEnded); } return(Id.InRace); } // vehicle selection if (data.GetValue(r, Addr.Static.SceneId) == 60) { if (data.GetValue(r, Path.Static, text_base + text_len * 2, Core.DataType.String, text_len).Substring(5, 18) != "Vehicle Statistics") { return(Id.VehicleSelectAnim); } return(Id.VehicleSelect); } // track selection if (data.GetValue(r, Addr.Static.SceneId) == 260) { if (data.GetValue(r, Path.Static, text_base + text_len * 2, Core.DataType.String, text_len).Substring(5, 6) == "Mirror") { return(Id.TrackSettings); } if (data.GetValue(r, Path.Static, text_base + text_len * 3, Core.DataType.String, text_len).Substring(5, 10) == "Start Race") { return(Id.TrackReady); } return(Id.TrackSelect); } if (data.GetValue(r, Path.Static, text_base + text_len * 2, Core.DataType.String, text_len).Substring(5, 6) == "Mirror") { return(Id.TrackSettings); } if (data.GetValue(r, Path.Static, text_base + text_len * 3, Core.DataType.String, text_len).Substring(5, 10) == "Start Race") { return(Id.TrackReady); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(4, 7) == "Results") { return(Id.TrackResults); } // main menu if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 24) == "Single Player Tournament") { return(Id.Title); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(3, 14) == "Current Player") { return(Id.FileSelect); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 14) == "VIDEO SETTINGS" && data.GetValue(r, (Addr.Static)(text_base + text_len)).Substring(5, 14) == "AUDIO SETTINGS") { return(Id.Settings); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 14) == "VIDEO SETTINGS") { return(Id.SettingsVideo); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 14) == "AUDIO SETTINGS") { return(Id.SettingsAudio); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 17) == "JOYSTICK SETTINGS") { return(Id.SettingsJoystick); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 14) == "MOUSE SETTINGS") { return(Id.SettingsMouse); } if (data.GetValue(r, Path.Static, text_base + text_len, Core.DataType.String, text_len).Substring(5, 17) == "KEYBOARD SETTINGS" && data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 22) == "Show Reserved Settings") { return(Id.SettingsKeyboard); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 13) == "RESERVED KEYS") { return(Id.SettingsKeyboardReservedKeys); } if (data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 23) == "FORCE FEEDBACK SETTINGS") { return(Id.SettingsForceFeedback); } if (data.GetValue(r, Path.Static, text_base + text_len, Core.DataType.String, text_len).Substring(5, 18) == "LOAD/SAVE SETTINGS" && data.GetValue(r, Path.Static, text_base, Core.DataType.String, text_len).Substring(5, 6) == "Cancel") { return(Id.SettingsLoadSave); } // default return(Id.Unknown); }
public void Reset(Racer r) { data.Clear(); initialized = false; Init(r); }
public void Update(Racer r) { data_prev = (DataCollection)data.Clone(); data.Update(r); }
public dynamic GetValue(Racer racer, Addr.Static datapoint) { return(GetValue(racer, DataBlock.Path.Static, (uint)datapoint, Addr.GetType(datapoint), Addr.GetLength(datapoint))); }
public Savestate(Racer r) { data = new List <DataBlock>(); Init(r); }
private bool CheckSaveable(Racer r) { return(CheckInRace(r)); }
private bool CheckLoadable(Racer r) { return(CheckInRace(r) && CheckRaceDataMatch(r)); }