private async void DoRandomEncounter()
        {
            overlay.Visibility = Visibility.Visible;
            Animate("overlayAppear", overlay);

            await MiscMethods.TaskDelay(1000);

            GameBase.CurrentGame.CurrentBattleField = new BattleField();

            Navigate(GameBase.CurrentGame.CurrentBattleField.BattleInterface);
        }
Пример #2
0
        ///// <summary>
        ///// Uses StaticMap to clone a single ObjectOfAlbertrizal.
        ///// </summary>
        ///// <typeparam name="T"></typeparam>
        ///// <param name="objectOfAlbertrizal">An object from static map.</param>
        ///// <returns></returns>
        //public static T StaticMapClone<T>(this T objectOfAlbertrizal) where T : ObjectOfAlbertrizal
        //{
        //    if (!GameBase.Initialized())
        //        throw new Exception("Both static and current maps must be initialized");

        //    //Break link
        //    GameBase.StaticGame = FileHandler.LoadMap(GameBase.StaticMapLocation);
        //    objectOfAlbertrizal.GetNewInstanceID();

        //    return objectOfAlbertrizal;
        //}

        ///// <summary>
        ///// Uses StaticMap to clone an entire list.
        ///// </summary>
        ///// <typeparam name="T"></typeparam>
        ///// <param name="list"></param>
        ///// <returns></returns>
        //public static List<T> StaticMapClone<T>(this List<T> listOfObjects) where T : ObjectOfAlbertrizal
        //{
        //    if (!GameBase.Initialized())
        //        throw new Exception("Both static and current maps must be initialized");

        //    GameBase.StaticGame = FileHandler.LoadMap(GameBase.StaticMapLocation);

        //    return listOfObjects;
        //}

        /// <summary>
        /// Clones an ObjectOfAlbertrizal and gives it a new InstanceID.
        /// </summary>
        /// <typeparam name="T"></typeparam>
        /// <param name="thing">Any Xml serializable object</param>
        /// <returns></returns>
        public static T RoAMemoryClone <T>(this T thing) where T : ObjectOfAlbertrizal
        {
            thing = MiscMethods.MemoryClone(thing);
            thing.GetNewInstanceID();
            return(thing);
        }