当前位置: 首页>>代码示例>>C#>>正文


C# PlayerSquad.getSquadId方法代码示例

本文整理汇总了C#中PlayerSquad.getSquadId方法的典型用法代码示例。如果您正苦于以下问题:C# PlayerSquad.getSquadId方法的具体用法?C# PlayerSquad.getSquadId怎么用?C# PlayerSquad.getSquadId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在PlayerSquad的用法示例。


在下文中一共展示了PlayerSquad.getSquadId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: listSquad

        private void listSquad(PlayerSquad sq) {
            List<PlayerProfile> members = sq.getMembers();

            DebugWrite("Team(^b" + TN(sq.getTeamId()) + "^n).Squad(^b" + SQN(sq.getSquadId()) + "^n): " + sq.getCount() + " players", 3);
            int count = 1;
            foreach (PlayerProfile pp in members)
                DebugWrite("    " + count++ + ".  ^b" + pp + "^n", 3);
        }
开发者ID:ratdart,项目名称:Procon-1,代码行数:8,代码来源:InsaneBalancer.cs

示例2: mergeSquadWithPool

        private int mergeSquadWithPool(PlayerSquad squad, List<PlayerSquad> squads) {

            int players_moved = 0;
            if (squad == null)
                return 0;

            int squad_max_sz = 4;

            List<PlayerProfile> squad_players = squad.getMembers();


            /* sort the squads in increasing order of player count */

            squads.Sort(new Comparison<PlayerSquad>(squad_count_asc_cmp));

            for (int i = 0; i < squads.Count; i++) {
                PlayerSquad sorted_squad = squads[i];
                if (squad.getTeamId() == sorted_squad.getTeamId() &&
                    squad.getSquadId() == sorted_squad.getSquadId())
                    continue;

                while (sorted_squad.getFreeSlots() > 0 && squad_players.Count > 0) {
                    PlayerProfile squad_player = squad_players[0];
                    squad_players.RemoveAt(0);
                    if (movePlayer(squad_player, sorted_squad.getTeamId(), sorted_squad.getSquadId())) {
                        DebugWrite(squad_player + " moved to Team(" + TN(squad_player.getTeamId()) + ").Squad(" + SQN(squad_player.getSquadId()) + ")", 3);
                        sorted_squad.addPlayer(squad_player);
                        players_moved++;
                    }
                }
            }

            return players_moved;
        }
开发者ID:ratdart,项目名称:Procon-1,代码行数:34,代码来源:InsaneBalancer.cs


注:本文中的PlayerSquad.getSquadId方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。