Ejemplo n.º 1
0
        public static ReadyChecker RequestCheck(IFight fight, Action success, Action <CharacterFighter[]> fail)
        {
            var checker = new ReadyChecker(fight, fight.GetAllFighters <CharacterFighter>(entry => !entry.HasLeft()).ToList());

            checker.Success += chk => success();
            checker.Timeout += (chk, laggers) => fail(laggers);
            checker.Start();

            return(checker);
        }
Ejemplo n.º 2
0
        public static ReadyChecker RequestCheck(Fight fight, Action success, System.Action <CharacterFighter[]> fail)
        {
            ReadyChecker readyChecker = new ReadyChecker(fight, fight.GetAllFighters <CharacterFighter>((CharacterFighter entry) => !entry.HasLeft() && !entry.IsDisconnected).ToList <CharacterFighter>());

            readyChecker.Success += delegate(ReadyChecker chk)
            {
                success();
            };
            readyChecker.Timeout += delegate(ReadyChecker chk, CharacterFighter[] laggers)
            {
                fail(laggers);
            };
            readyChecker.Start();

            return(readyChecker);
        }