示例#1
0
    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;
    }
示例#2
0
    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;
    }
示例#3
0
    public void AddState(TourState state)
    {
        if (Contains(state))
        {
            return;
        }

        states.Add(state);
    }
示例#4
0
    public void SetFirstState(TourState state)
    {
        if (states == null)
        {
            return;
        }

        if (Contains(state))
        {
            firstState = state;
        }
    }
示例#5
0
    public void RemoveState(TourState state)
    {
        if (states.Count <= 1)
        {
            return;
        }

        states.Remove(state);

        if (firstState == state)
        {
            firstState = states.First();
        }
    }
示例#6
0
 public bool Contains(TourState state)
 {
     return(states != null && states.Contains(state));
 }