protected override void LoadData(MemoryStream ms) { IFormatter formatter = new BinaryFormatter(); GameState gd = (GameState)formatter.Deserialize(ms); this.tourState = gd.tourState == null ? new TourState() : gd.tourState; this.currencyState = gd.currencyState == null ? new CurrencyState() : gd.currencyState; }
public void AddState(TourState state) { if (Contains(state)) { return; } states.Add(state); }
public void SetFirstState(TourState state) { if (states == null) { return; } if (Contains(state)) { firstState = state; } }
public void RemoveState(TourState state) { if (states.Count <= 1) { return; } states.Remove(state); if (firstState == state) { firstState = states.First(); } }
public bool Contains(TourState state) { return(states != null && states.Contains(state)); }