示例#1
0
        public object CaptureState()
        {
            var dto = new TravelManagerDto();

            dto.BiomeQueue               = _biomeQueue;
            dto.CurrentBiome             = CurrentBiome;
            dto.CurrentDayOfTravel       = CurrentDayOfTravel;
            dto.DaysTilNextBiome         = _daysTilNextBiome;
            dto.TravelDaysTilDestination = TravelDaysToDestination;
            dto.Party     = Party.CaptureState();
            dto.Inventory = (Inventory.InventorySlotRecord[])Inventory.GetPartyInventory().CaptureState();

            return(dto);
        }
示例#2
0
        public void RestoreState(object state)
        {
            if (state == null)
            {
                return;
            }

            TravelManagerDto dto = (TravelManagerDto)state;

            _biomeQueue             = dto.BiomeQueue;
            CurrentBiome            = dto.CurrentBiome;
            CurrentDayOfTravel      = dto.CurrentDayOfTravel;
            _daysTilNextBiome       = dto.DaysTilNextBiome;
            TravelDaysToDestination = dto.TravelDaysTilDestination;
            Inventory.GetPartyInventory().RestoreState(dto.Inventory);

            Party = new Party();

            Party.RestoreState(dto.Party);
        }