Example #1
0
        public static void BeginArenaFightSet(int count, List <PawnKindDef> lhs, List <PawnKindDef> rhs, Action <ArenaUtility.ArenaResult> callback, Action report)
        {
            int remaining = count;

            ArenaUtility.ArenaSetState state = new ArenaUtility.ArenaSetState();
            for (int i = 0; i < count; i++)
            {
                Current.Game.GetComponent <GameComponent_DebugTools>().AddPerFrameCallback(() => ArenaUtility.ArenaFightQueue(lhs, rhs, delegate(ArenaUtility.ArenaResult result)
                {
                    callback(result);
                    remaining--;
                    if (remaining % 10 == 0)
                    {
                        report();
                    }
                }, state));
            }
        }
 private static bool ArenaFightQueue(List <PawnKindDef> lhs, List <PawnKindDef> rhs, Action <ArenaUtility.ArenaResult> callback, ArenaUtility.ArenaSetState state)
 {
     if (!ArenaUtility.ValidateArenaCapability())
     {
         return(false);
     }
     if (state.live < 15)
     {
         ArenaUtility.BeginArenaFight(lhs, rhs, delegate(ArenaUtility.ArenaResult result)
         {
             state.live--;
             callback(result);
         });
         state.live++;
         return(true);
     }
     return(false);
 }