protected virtual void MetadataSelected(MenuSceneInfo sceneInfo, EncounterBasicStatus status, KeyValuePair <SaveType, EncounterMetadata> metadata)
        {
            if (status == null)
            {
                status = new EncounterBasicStatus();
            }

            ImageHolder.BeginHoldingData();
            ImageHolder.HoldImage(metadata.Value.Sprite);
            var encounter          = EncounterReader.GetUserEncounter(sceneInfo.User, metadata.Value, status, metadata.Key);
            var encounterSceneInfo = new LoadingReaderSceneInfo(sceneInfo.User, sceneInfo.LoadingScreen, encounter);

            SceneStarter.StartScene(encounterSceneInfo);
        }
        public Sprite Deserialize(XmlDeserializer deserializer)
        {
            int    width     = GetWidth(deserializer);
            int    height    = GetHeight(deserializer);
            string imageData = GetImageData(deserializer);//.Replace(' ', '+');

            if (imageData == null)
            {
                throw new Exception("No image data included.");
            }

            var imageRect = new Rect(0, 0, width, height);
            var sprite    = GetSprite(imageRect, imageData);

            ImageHolder.HoldImage(sprite);
            return(sprite);
        }
        protected virtual void SetUserEncounter(WaitableTask <UserEncounter> result, User user, TaskResult <IMenuEncountersInfo> encounters, int recordNumber)
        {
            if (encounters.IsError())
            {
                result.SetError(encounters.Exception);
                return;
            }

            foreach (var encounter in encounters.Value.GetEncounters())
            {
                var typedMetadata = encounter.GetLatestTypedMetada();
                if (typedMetadata.Value.RecordNumber != recordNumber)
                {
                    continue;
                }

                ImageHolder.HoldImage(typedMetadata.Value.Sprite);
                var userEncounter = EncounterReader.GetUserEncounter(user, typedMetadata.Value, encounter.Status, typedMetadata.Key);
                userEncounter.CopyValueWhenCompleted(result);
                return;
            }

            result.SetError(new Exception("Could not find an encounter with the given record number."));
        }