public StatusObject GenerateScriptsInsertScriptsAllCharacters(string TargetString, string MinWordLength, string MaxWordLength)
        {
            StatusObject SO = new StatusObject();

            try
            {
                int Min = Convert.ToInt32(MinWordLength);
                int Max = Convert.ToInt32(MaxWordLength);
                for (int i = Min; i <= Max; i++)
                {
                    foreach (char FirstCharacter in TargetString)
                    {
                        StatusObject SO_GenerateScripts = GenerateInsertScripts(FirstCharacter.ToString(), i.ToString());
                        if (SO_GenerateScripts.Status == StatusCode.FAILURE)
                        {
                            Console.WriteLine("-----------------------------------------------------------");
                            Console.WriteLine("Error Encountered");
                            Console.WriteLine(SO_GenerateScripts.ErrorStackTrace);
                            Console.WriteLine("-----------------------------------------------------------");
                            Console.ReadKey();
                        }
                    }
                }
            }
            catch (Exception e)
            {
                SO = new StatusObject(e, "");
            }
            return(SO);
        }
Beispiel #2
0
        public void StopPvp()
        {
            if (!IsActive)
            {
                return;
            }
            IsActive = false;
            if (Losser == null)
            {
                Losser = FirstCharacter;
            }
            FirstCharacter.EnemyCharacters.Remove(SecondCharacter);
            SecondCharacter.EnemyCharacters.Remove(FirstCharacter);
            FirstCharacter.CheckEnemysCount();
            SecondCharacter.CheckEnemysCount();
            Asda2PvpHandler.SendDuelEndedResponse(Winner, Losser);

            Asda2TitleChecker.OnWinDuel(Winner);

            FirstCharacter.Asda2Duel            = null;
            SecondCharacter.Asda2Duel           = null;
            FirstCharacter.Asda2DuelingOponent  = null;
            SecondCharacter.Asda2DuelingOponent = null;
            FirstCharacter  = null;
            SecondCharacter = null;
        }
    /// <summary>
    /// Create an instance of this class function
    /// </summary>
    private FirstCharacter()
    {
        if (_instance != null)
        {
            return;
        }

        _instance = this;
    }
        public void Dispose()
        {
            TextInput?.Dispose();
            FirstCharacter?.Dispose();
            StringLength?.Dispose();
            StringLengthLabel?.Dispose();
            FirstCharacterLabel?.Dispose();

            TimeOnPage?.Dispose();
            TimeOnPageLabel?.Dispose();
        }
Beispiel #5
0
        public Fight Transform()
        {
            Fight fight = new Fight();

            fight.FirstCharacter  = FirstCharacter.Transform();
            fight.SecondCharacter = SecondCharacter.Transform();
            fight.ID_Winner       = ID_Winner;
            fight.ID_Territory    = ID_Territory;
            fight.ID_War          = ID_War;

            return(fight);
        }
        public ReactiveSampleViewModel()
        {
            TextInput           = new ReactiveProperty <string>("");
            FirstCharacter      = TextInput.Select(x => x.ToCharArray()).Select(x => x.Any() ? (char?)x.First() : null).ToReadOnlyReactiveProperty();
            FirstCharacterLabel = FirstCharacter.Select(x => x != null ? $"The first character is {x.ToString()}" : "There is no first character!").ToReadOnlyReactiveProperty();
            StringLength        = TextInput.Select(x => x.Length).ToReadOnlyReactiveProperty();
            StringLengthLabel   = StringLength.Select(x => $"The string is {x} character{(x != 1 ? "s" : "")} long.").ToReadOnlyReactiveProperty();

            var timePageLoaded = DateTime.Now;

            TimeOnPage      = Observable.Interval(TimeSpan.FromSeconds(1)).Select(x => DateTime.Now.Subtract(timePageLoaded)).ToReadOnlyReactiveProperty();
            TimeOnPageLabel = TimeOnPage.Select(x => (int)x.TotalSeconds).Select(x => $"You've been on this page for {x} second{(x != 1 ? "s" : "")}.").ToReadOnlyReactiveProperty();
        }