Beispiel #1
0
    private void on_arena_button_click(Arena arena)
    {
        selected_arena = arena;

        //Activate teamsize buttons accordingly
        {
            var values = (TeamSize[])Enum.GetValues(typeof(TeamSize));
            Debug.Assert(values.Length == TeamSizeButtons.Length, "TeamSize buttons has to match arena buttons.");
            for (var i = 0; i < TeamSizeButtons.Length; ++i)
            {
                var btn  = TeamSizeButtons[i];
                var size = values[i];
                btn.gameObject.SetActive(ArenaOps.IsMatchSizeSupported(arena, size));
            }
        }
    }
Beispiel #2
0
 internal static void Prepare(Func <Arena, IArenaFactory> factory_factory, Func <Arena, int, IMatchFinder> match_finder_factory, ref List <IMatchFinder> match_finders_sink, ref List <IArenaFactory> arena_sink) //LOL, don't care.
 {
     for (var i = 0; i < ArenaTypesCount; ++i)
     {
         var arena = arena_enum_values[i + 1];
         for (var j = 0; j < MaxTeamSizeValue; ++j)
         {
             var           team_size    = team_size_enum_values[j];
             IArenaFactory factory      = null;
             IMatchFinder  match_finder = null;
             if (ArenaOps.IsMatchSizeSupported(arena, team_size))
             {
                 factory      = factory_factory(arena);
                 match_finder = match_finder_factory(arena, j + 1);
             }
             match_finders_sink.Add(match_finder);
             arena_sink.Add(factory); //The team size as human number
         }
     }
 }