Associates every role to the intended player.
171957
def players_play_role!
        extending_ticker = {}
        roles.keys.each do |rolekey|
          assign_role_to_player!(rolekey, @_players[rolekey], extending_ticker: extending_ticker)
        end
        extending_ticker
      end
1232313
def team_players(self, team):
        """"""
        headers = ['Jersey Number', 'Name', 'Position', 'Nationality',
                   'Date of Birth']
        result = [headers]

        result.extend([player['shirtNumber'],
                       player['name'],
                       player['position'],
                       player['nationality'],
                       player['dateOfBirth']]
                      for player in team)
        self.generate_output(result)
1149968
function addPlayer(userId, callbacks) {
        let player = factory.addPlayer();
        if(!player) return null;

        self._callbacks.set(player, callbacks);

        // If the game didn't have an owner, it does now
        // This should only happen when the game is first created
        // and the initial player is added
        if(!owner)
            owner = player;

        self._users[userId] = { id: userId, player };

        return player;
    }
472526
def init(element, gid)
      self.gid = gid
      self.team_name = element.attributes['name']
      self.id = element.attributes['id']
      self.type = element.attributes['type']
      self.players = []
      self.coaches = []
      self.set_players(element)
      self.set_coaches(element)
    end
712386
def when_all_players_ready(self):
        
        self.group_decisions = {}
        self.subperiod_group_decisions = {}
        for player in self.get_players():
            self.group_decisions[player.participant.code] = player.initial_decision()
            self.subperiod_group_decisions[player.participant.code] = player.initial_decision()
        if self.num_subperiods():
            emitter = DiscreteEventEmitter(
                self.period_length() / self.num_subperiods(), 
                self.period_length(),
                self,
                self._subperiod_tick)
            emitter.start()
        elif self.rate_limit():
            def _tick(current_interval, intervals):
                self.refresh_from_db()
                if self._group_decisions_updated:
                    self.send('group_decisions', self.group_decisions)
                    self._group_decisions_updated = False
                    self.save(update_fields=['_group_decisions_updated'])

            update_period = self.rate_limit()
            emitter = DiscreteEventEmitter(
                update_period, 
                self.period_length(),
                self,
                _tick)
            emitter.start()
        self.save()
975592
function addUsersToTeam (params, cb) {
      let promise = null
      if (typeof cb !== 'function') [promise, cb] = asyncify()

      const { id, users, organizationId } = params
      const tasks = [
        (job, next) => {
          Joi.validate({ id, users, organizationId }, validationRules.addUsersToTeam, (err) => {
            if (err) return next(Boom.badRequest(err))
            next()
          })
        },
        (job, next) => {
          job.teamId = id
          job.organizationId = organizationId
          job.params = params

          next()
        },
        (job, next) => {
          utils.checkUsersOrg(job.client, job.params.users, job.organizationId, next)
        },
        checkTeamExists,
        insertTeamMembers
      ]

      db.withTransaction(tasks, (err, res) => {
        if (err) return cb(err)
        teamOps.readTeam({ id, organizationId }, cb)
      })

      return promise
    }
195160
def player_skill(self, player_handle, game_mode='solo'):
        """"""
        if game_mode not in constants.GAME_MODES:
            raise APIException("game_mode must be one of: solo, duo, squad, all")
        try:
            data = self._get_player_profile(player_handle)
            player_stats = {}
            return_data = []
            for stat in data['Stats']:
                if stat['Match'] == game_mode:
                    for datas in stat['Stats']:
                        if datas['label'] == 'Rating':
                            player_stats[stat['Region']] = datas['value']
            return player_stats
        except BaseException as error:
            print('Unhandled exception: ' + str(error))
            raise
398970
private void appendRoles(final StringBuilder builder, final User user) {
        for (final UserRoleName role : user.getRoles()) {
            append(builder, ",", role.name());
        }
    }
404994
def add_inclusion(self, role, value):
        

        self._add_rule(self.includes, role, value)
1283173
function PlayerServer(options, channel) {
    GameServer.call(this, options, channel);

    // ### PlayerServer.ADMIN_SERVER
    // Flag to distinguish from Admin Server at execution time.
    this.ADMIN_SERVER = false;

    /**
     * ### PlayerServer.acm
     *
     * Action control management
     */
    this.acm = {};

    // #### PlayerServer.acm.notify
    // Configuration object governing message passing between players.
    // By default, players are *not* notified of the activities of other
    // players, such as (connection, disconnection, entering a new stage). By
    // changing the value of the properties of this object it is possible to
    // send out notifications of the following types:
    //
    // - onConnect: sends PCONNECT, and PDISCONNECT
    // - onStageUpdate: sends PLAYER_UPDATE (player enters a new stage / step)
    // - onStageLevelUpdate: sends PLAYER_UPDATE (player update the state within
    //     a stage: from LOADING to DONE)
    this.acm.notify = this.options.notify || {};

    // #### PlayerServer.acm.forwardAll
    // If TRUE all DATA and TXT messages (regardless to the recipient)
    // will be forwarded to the admins. Default: FALSE
    this.acm.forwardAll = this.options.forwardAllMessages || false;

    // #### PlayerServer.acm.getFromAdmins
    // If TRUE players will be able to send GET messages to admins and get
    // back the result. Default: FALSE
    this.acm.getFromAdmins = this.options.getFromAdmins || false;
}
738875
def bot_config(player_config_path: Path, team: Team) -> 'PlayerConfig':
        
        bot_config = PlayerConfig()
        bot_config.bot = True
        bot_config.rlbot_controlled = True
        bot_config.team = team.value
        bot_config.config_path = str(player_config_path.absolute()) # TODO: Refactor to use Path's
        config_bundle = get_bot_config_bundle(bot_config.config_path)
        bot_config.name = config_bundle.name
        bot_config.loadout_config = load_bot_appearance(config_bundle.get_looks_config(), bot_config.team)
        return bot_config
222467
def allow_role(role):
    """"""
    def processor(action, argument):
        db.session.add(
            ActionRoles.allow(action, argument=argument, role_id=role.id)
        )
    return processor
518951
function PlanningAgent(id) {
  // execute super constructor
  eve.Agent.call(this, id);

  // connect to all transports configured by the system
  this.connect(eve.system.transports.getAll());
}
918609
def apply_action action, street
      # puts "pfr: apply_action #{street}, #{action.inspect}"
      result = action[:result]
      player = action[:screen_name]
      if street == :preflop and [:pay, :pay_to, :neutral].member?(result) and @pfr_opportunity[player].nil?
        case result
        when :pay, :neutral
          @pfr_opportunity[player] = true
          @pfr_opportunity_taken[player] = false
        when :pay_to
          @hand_statistics.players.each {|each_player| @pfr_opportunity[each_player] ||= (each_player == player)}
          @pfr_opportunity_taken[player] = true
        end
      end
    end
1125554
def addPlayer(settings):
    """"""
    _validate(settings)
    player = PlayerRecord(settings)
    player.save()
    getKnownPlayers()[player.name] = player
    return player
1053402
def assignValue(cfg, playerValue, otherValue):
    """"""
    player = cfg.whoAmI()
    result = {}
    for p in cfg.players:
        if p.name == player.name:   val = playerValue
        else:                       val = otherValue
        result[p.name] = val
    return result
976689
public function addPlayer(Player $player)
    {
        $this->players[] = $player;
        if ($this->index == -1) {
            $this->index = $player->team;
        }
    }