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


PHP Team::getPlayers方法代码示例

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


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

示例1: Team

 function __construct($team_id, $jm)
 {
     $this->team_id = $team_id;
     $this->jm = $jm;
     $team = new Team($_GET["teamid"]);
     $this->games = $team->mv_won + $team->mv_lost + $team->mv_draw;
     $this->players = $team->getPlayers();
     $this->name = $team->name;
     $this->race = $team->f_rname;
     $this->race_id = $team->f_race_id;
     $this->coach_name = $team->f_cname;
     $this->rerolls = $team->rerolls;
     $this->fan_factor = $team->rg_ff;
     $this->ass_coaches = $team->ass_coaches;
     $this->cheerleaders = $team->cheerleaders;
     $this->apothecary = $team->apothecary;
     $this->apothecary = $this->apothecary == "1" ? "true" : "false";
     $this->treasury = $team->treasury;
     $this->tv = $team->value;
     #for cyanide roster only
     if (!$this->checkJourneymen()) {
         return false;
     }
     $this->name = $team->name;
     $this->coach_name = $team->f_cname;
     $this->createRoster();
 }
开发者ID:nicholasmr,项目名称:obblm,代码行数:27,代码来源:class_xml_botocs.php

示例2: array

            $_POST["ir2_d2_{$pid}"] = 0;
            $_POST["ir3_d1_{$pid}"] = 0;
            $_POST["ir3_d2_{$pid}"] = 0;
            $_POST["inj_{$pid}"] = NONE;
            $_POST["agn1_{$pid}"] = NONE;
            $_POST["agn2_{$pid}"] = NONE;
        }
        $match->entry($player->player_id, array('mvp' => $_POST["mvp_{$pid}"], 'cp' => $_POST["cp_{$pid}"], 'td' => $_POST["td_{$pid}"], 'intcpt' => $_POST["intcpt_{$pid}"], 'bh' => $_POST["bh_{$pid}"], 'si' => $_POST["si_{$pid}"], 'ki' => $_POST["ki_{$pid}"], 'ir1_d1' => $_POST["ir1_d1_{$pid}"], 'ir1_d2' => $_POST["ir1_d2_{$pid}"], 'ir2_d1' => $_POST["ir2_d1_{$pid}"], 'ir2_d2' => $_POST["ir2_d2_{$pid}"], 'ir3_d1' => $_POST["ir3_d1_{$pid}"], 'ir3_d2' => $_POST["ir3_d2_{$pid}"], 'inj' => $_POST["inj_{$pid}"], 'agn1' => $_POST["agn1_{$pid}"], 'agn2' => $_POST["agn2_{$pid}"]));
    }
    $match->finalizeMatchSubmit();
} else {
    if ($action == "getplayerentries") {
        $match = new Match($_REQUEST["match_id"]);
        $team = new Team($_REQUEST["team_id"]);
        $playerEntries = array();
        foreach ($team->getPlayers() as $player) {
            $playerId = $player->player_id;
            $playerEntry = $match->getPlayerEntry($playerId);
            if (!$playerEntry) {
                $playerEntry['mvp'] = 0;
                $playerEntry['cp'] = 0;
                $playerEntry['td'] = 0;
                $playerEntry['intcpt'] = 0;
                $playerEntry['bh'] = 0;
                $playerEntry['si'] = 0;
                $playerEntry['ki'] = 0;
                $playerEntry['ir1_d1'] = 0;
                $playerEntry['ir1_d2'] = 0;
                $playerEntry['ir2_d1'] = 0;
                $playerEntry['ir2_d2'] = 0;
                $playerEntry['ir3_d1'] = 0;
开发者ID:rythos42,项目名称:naflm,代码行数:31,代码来源:match_webservice.php

示例3: matchEntry

 function matchEntry($team_id, $teamPlayers)
 {
     $addZombie = false;
     $match = new Match($this->match_id);
     $team = new Team($team_id);
     $players = $team->getPlayers();
     $merc_nr = 1;
     foreach ($teamPlayers as $player) {
         $f_player_id = '';
         if ($player['nr'] == 100) {
             $addZombie = true;
         } else {
             $addZombie = false;
         }
         if ($player['star'] == "true") {
             global $stars;
             $stname = strval($player['name']);
             if (strpos($stname, "Morg ") === 0) {
                 $stname = "Morg 'n' Thorg";
             }
             if (strpos($stname, "Brick Far") === 0) {
                 $stname = "Brick Far'th (+ Grotty)";
             }
             if ($stname == "Grotty") {
                 $stname = "Grotty (included in Brick Far'th)";
             }
             $f_player_id = $stars[$stname]['id'];
             $player['inj'] = '';
         }
         if ($player['merc'] == "true") {
             $f_player_id = ID_MERCS;
         }
         foreach ($players as $p) {
             if ($p->nr == $player['nr'] && Match::player_validation($p, $match) && !$f_player_id) {
                 $f_player_id = $p->player_id;
                 break;
             }
         }
         // Make $player[$f] into $$f.
         foreach (array('mvp', 'cp', 'td', 'intcpt', 'bh', 'ki', 'si') as $f) {
             if (array_key_exists($f, $player)) {
                 ${$f} = $player[$f];
                 # NOTE: These fields are validated and typecasted correctly already in parse_results(), no further processing needed.
                 if (empty(${$f})) {
                     ${$f} = 0;
                 }
             } else {
                 ${$f} = 0;
             }
         }
         $inj = $this->switchInjury($player['inj']);
         $agn1 = $this->switchInjury($player['agn1']);
         if ($agn1 > $inj) {
             list($inj, $agn1) = array($agn1, $inj);
         }
         if ($agn1 == 8 || $agn1 == 2) {
             $agn1 = 1;
         }
         if ($f_player_id == ID_MERCS) {
             $match->entry($f_player_id, $input = array('f_team_id' => $team_id, "mvp" => $mvp, "cp" => $cp, "td" => $td, "intcpt" => $intcpt, "bh" => $bh, "si" => $si, "ki" => $ki, "ir1_d1" => $player['ir1_d1'], "ir1_d2" => $player['ir1_d2'], "ir2_d1" => $player['ir2_d1'], "ir2_d2" => $player['ir2_d2'], "ir3_d1" => $player['ir3_d1'], "ir3_d2" => $player['ir3_d2'], "inj" => $inj, "agn1" => NONE, "agn2" => $agn1, "skills" => 0, "nr" => $merc_nr), $player['EPS']);
             $merc_nr++;
             continue;
         }
         if (!$addZombie && (Match::player_validation($p, $match) || $player['star'] == "true")) {
             $match->entry($f_player_id, $input = array('f_team_id' => $team_id, "mvp" => $mvp, "cp" => $cp, "td" => $td, "intcpt" => $intcpt, "bh" => $bh, "si" => $si, "ki" => $ki, "ir1_d1" => $player['ir1_d1'], "ir1_d2" => $player['ir1_d2'], "ir2_d1" => $player['ir2_d1'], "ir2_d2" => $player['ir2_d2'], "ir3_d1" => $player['ir3_d1'], "ir3_d2" => $player['ir3_d2'], "inj" => $inj, "agn1" => $agn1, "agn2" => NONE), $player['EPS']);
         } else {
             global $DEA;
             $pos_id = $DEA[$team->f_rname]['players']['Zombie']['pos_id'];
             list($exitStatus, $pid) = Player::create($input = array('nr' => $player['nr'], 'f_pos_id' => $pos_id, 'team_id' => $team_id, 'name' => $player['name']), $opts = array('free' => true, 'force' => true));
             if ($exitStatus == Player::T_CREATE_SUCCESS) {
                 $match->entry($pid, $input = array('f_team_id' => $team_id, "mvp" => $mvp, "cp" => $cp, "td" => $td, "intcpt" => $intcpt, "bh" => $bh, "si" => $si, "ki" => $ki, "ir1_d1" => $player['ir1_d1'], "ir1_d2" => $player['ir1_d2'], "ir2_d1" => $player['ir2_d1'], "ir2_d2" => $player['ir2_d2'], "ir3_d1" => $player['ir3_d1'], "ir3_d2" => $player['ir3_d2'], "inj" => $inj, "agn1" => $agn1, "agn2" => NONE), $player['EPS']);
             }
         }
     }
     ##ADD EMPTY RESULTS FOR PLAYERS WITHOUT RESULTS MAINLY FOR MNG
     foreach ($players as $p) {
         if (Match::player_validation($p, $match)) {
             $player = new Player($p->player_id);
             $p_matchdata = $match->getPlayerEntry($player->player_id);
             if (empty($p_matchdata)) {
                 $match->entry($p->player_id, $input = array('f_team_id' => $team_id, "mvp" => 0, "cp" => 0, "td" => 0, "intcpt" => 0, "bh" => 0, "si" => 0, "ki" => 0, "ir1_d1" => 0, "ir1_d2" => 0, "ir2_d1" => 0, "ir2_d2" => 0, "ir3_d1" => 0, "ir3_d2" => 0, "inj" => NONE, "agn1" => NONE, "agn2" => NONE), array());
             }
         }
     }
     return true;
 }
开发者ID:TheNAF,项目名称:naflm,代码行数:86,代码来源:class_upload_botocs.php

示例4: main

    public static function main($argv)
    {
        global $lng;
        title($lng->getTrn('name', 'Gallery'));
        list($sel_lid, $HTML_LeagueSelector) = HTMLOUT::simpleLeagueSelector();
        if (isset($_POST['type'])) {
            echo "<center><a href='handler.php?type=gallery'>" . $lng->getTrn('common/back') . "</a></center>\n";
            switch ($_POST['type']) {
                case 'team':
                    $t = new Team((int) $_POST['tid']);
                    echo "<b>" . $lng->getTrn('playersof', 'Gallery') . " {$t->name}</b><br><hr><br>\n";
                    foreach ($t->getPlayers() as $p) {
                        $img = new ImageSubSys(IMGTYPE_PLAYER, $p->player_id);
                        $pic = $img->getPath();
                        echo "<div style='float:left; padding:10px;'>{$p->name} (#{$p->nr})<br><a href='" . urlcompile(T_URL_PROFILE, T_OBJ_PLAYER, $p->player_id, false, false) . "'><img HEIGHT=150 src='{$pic}' alt='pic'></a></div>";
                    }
                    break;
                case 'stad':
                    echo "<b>" . $lng->getTrn('stads', 'Gallery') . "</b><br><hr><br>\n";
                    $teams = get_rows('teams', array('team_id', 'name'), array("f_lid = {$sel_lid}"));
                    objsort($teams, array('+name'));
                    foreach ($teams as $t) {
                        $img = new ImageSubSys(IMGTYPE_TEAMSTADIUM, $t->team_id);
                        $pic = $img->getPath();
                        echo "<div style='float:left; padding:10px;'>{$t->name}<br><a href='{$pic}'><img HEIGHT=150 src='{$pic}' alt='pic'></a></div>";
                    }
                    break;
                case 'coach':
                    echo "<b>" . $lng->getTrn('coaches', 'Gallery') . "</b><br><hr><br>\n";
                    $q = "SELECT coach_id, name FROM coaches,memberships WHERE cid = coach_id AND lid = {$sel_lid} GROUP BY cid, lid ORDER BY name ASC";
                    $result = mysql_query($q);
                    while ($c = mysql_fetch_object($result)) {
                        $img = new ImageSubSys(IMGTYPE_COACH, $c->coach_id);
                        $pic = $img->getPath();
                        echo "<div style='float:left; padding:10px;'>{$c->name}<br><a href='{$pic}'><img HEIGHT=150 src='{$pic}' alt='pic'></a></div>";
                    }
                    break;
            }
            return;
        }
        echo $HTML_LeagueSelector;
        echo "<br><br>\n";
        echo $lng->getTrn('note', 'Gallery');
        ?>
    <ul>
    <li>
        <?php 
        $teams = get_rows('teams', array('team_id', 'name'), array("f_lid = {$sel_lid}"));
        objsort($teams, array('+name'));
        echo $lng->getTrn('players', 'Gallery') . "\n        <form method='POST' style='display:inline; margin:0px;'><select name='tid' onChange='this.form.submit();'>\n        <option value='0'>&mdash; " . $lng->getTrn('none', 'Gallery') . " &mdash;</option>" . implode("\n", array_map(create_function('$o', 'return "<option value=\'$o->team_id\'>$o->name</option>";'), $teams)) . "</select><input type='hidden' name='type' value='team'></form>\n        ";
        ?>
    </li>
    <li><?php 
        echo inlineform(array('type' => 'stad'), 'stadForm', $lng->getTrn('stads', 'Gallery'));
        ?>
</li>
    <li><?php 
        echo inlineform(array('type' => 'coach'), 'coachesForm', $lng->getTrn('coaches', 'Gallery'));
        ?>
</li>
    </ul>
    <?php 
    }
开发者ID:nicholasmr,项目名称:obblm,代码行数:63,代码来源:class_gallery.php

示例5: main

 public static function main($argv)
 {
     global $pdf;
     global $DEA;
     global $skillarray;
     global $rules;
     global $inducements;
     define("MARGINX", 20);
     define("MARGINY", 20);
     define("DEFLINECOLOR", '#000000');
     define("HEADLINEBGCOLOR", '#c3c3c3');
     // Custom settings for inducements.
     define('MAX_STARS', 2);
     define('MERC_EXTRA_COST', 30000);
     define('MERC_EXTRA_SKILL_COST', 50000);
     // Color codes.
     define('COLOR_ROSTER_NORMAL', COLOR_HTML_NORMAL);
     define('COLOR_ROSTER_READY', COLOR_HTML_READY);
     define('COLOR_ROSTER_MNG', COLOR_HTML_MNG);
     define('COLOR_ROSTER_DEAD', COLOR_HTML_DEAD);
     define('COLOR_ROSTER_SOLD', COLOR_HTML_SOLD);
     define('COLOR_ROSTER_STARMERC', COLOR_HTML_STARMERC);
     define('COLOR_ROSTER_JOURNEY', COLOR_HTML_JOURNEY);
     define('COLOR_ROSTER_JOURNEY_USED', COLOR_HTML_JOURNEY_USED);
     define('COLOR_ROSTER_NEWSKILL', COLOR_HTML_NEWSKILL);
     //-----
     define('COLOR_ROSTER_CHR_EQP1', COLOR_HTML_CHR_EQP1);
     // Characteristic equal plus one.
     define('COLOR_ROSTER_CHR_GTP1', COLOR_HTML_CHR_GTP1);
     // Characteristic greater than plus one.
     define('COLOR_ROSTER_CHR_EQM1', COLOR_HTML_CHR_EQM1);
     // Characteristic equal minus one.
     define('COLOR_ROSTER_CHR_LTM1', COLOR_HTML_CHR_LTM1);
     // Characteristic less than minus one.
     define('T_PDF_ROSTER_SET_EMPTY_ON_ZERO', true);
     # Prints cp, td etc. as '' (empty string) when field = 0.
     $ind_cost = 0;
     //
     // Most of team and player data is copy/pasted from teams.php
     //
     $team_id = $_GET['team_id'];
     // Is team id valid?
     if (!get_alt_col('teams', 'team_id', $team_id, 'team_id')) {
         fatal("Invalid team ID.");
     }
     $team = new Team($team_id);
     $coach = isset($_SESSION['logged_in']) ? new Coach($_SESSION['coach_id']) : null;
     setupGlobalVars(T_SETUP_GLOBAL_VARS__LOAD_LEAGUE_SETTINGS, array('lid' => $team->f_lid));
     // Load correct $rules for league.
     $players = $team->getPlayers();
     $tmp_players = array();
     foreach ($players as $p) {
         if ($p->is_dead || $p->is_sold) {
             continue;
         }
         array_push($tmp_players, $p);
     }
     $players = $tmp_players;
     // Team specific data
     $rerollcost = $DEA[$team->f_rname]['other']['rr_cost'];
     $pdf = new BB_PDF('L', 'pt', 'A4');
     // Creating a new PDF doc. Landscape, scale=pixels, size A4
     $pdf->SetAutoPageBreak(false, 20);
     // No auto page break to mess up layout
     $pdf->SetAuthor('Daniel Straalman');
     $pdf->SetCreator('OBBLM');
     $pdf->SetTitle('PDF Roster for ' . utf8_decode($team->name));
     $pdf->SetSubject('PDF Roster for ' . utf8_decode($team->name));
     $pdf->AddFont('Tahoma', '', 'tahoma.php');
     // Adding regular font Tahoma which is in font dir
     $pdf->AddFont('Tahoma', 'B', 'tahomabd.php');
     // Adding Tahoma Bold
     // Initial settings
     $pdf->SetFont('Tahoma', 'B', 14);
     $pdf->AddPage();
     $pdf->SetLineWidth(1.5);
     $currentx = MARGINX;
     $currenty = MARGINY;
     $pdf->SetFillColorBB($pdf->hex2cmyk(HEADLINEBGCOLOR));
     $pdf->RoundedRect($currentx, $currenty, 802, 20, 6, 'DF');
     // Filled rectangle around Team headline
     $pdf->SetDrawColorBB($pdf->hex2cmyk(DEFLINECOLOR));
     // Text in headline
     $pdf->SetXY($currentx + 30, $currenty);
     $pdf->Cell(310, 20, utf8_decode($team->name), 0, 0, 'L', false, '');
     $pdf->SetFont('Tahoma', '', 12);
     $pdf->Cell(60, 20, "Race:", 0, 0, 'R', false, '');
     $pdf->Cell(70, 20, $team->f_rname, 0, 0, 'L', false, '');
     $pdf->Cell(300, 20, "Head Coach: " . utf8_decode($team->f_cname), 0, 0, 'R', false, '');
     $currenty += 25;
     $currentx += 6;
     $pdf->SetXY($currentx, $currenty);
     $pdf->SetFillColorBB($pdf->hex2cmyk(HEADLINEBGCOLOR));
     $pdf->SetDrawColorBB($pdf->hex2cmyk(DEFLINECOLOR));
     $pdf->SetFont('Tahoma', 'B', 8);
     $pdf->SetLineWidth(1.5);
     $h = 14;
     // Printing headline for player table
     $pdf->Cell(23, $h, 'Nr', 1, 0, 'C', true, '');
     $pdf->Cell(97, $h, 'Name', 1, 0, 'L', true, '');
//.........这里部分代码省略.........
开发者ID:nicholasmr,项目名称:obblm,代码行数:101,代码来源:pdf_roster.php

示例6: _infocus

function _infocus($teams)
{
    //Create a new array of teams to display
    $ids = array();
    foreach ($teams as $team) {
        if (!$team['retired']) {
            $ids[] = $team['team_id'];
        }
    }
    if (empty($teams)) {
        return;
    }
    global $lng, $_INFOCUSCNT;
    //Select random team
    $teamKey = array_rand($ids);
    $teamId = $ids[$teamKey];
    $team = new Team($teamId);
    $teamLink = "<a href='" . urlcompile(T_URL_PROFILE, T_OBJ_TEAM, $teamId, false, false) . "'>{$team->name}</a>";
    //Create $logo_html
    $img = new ImageSubSys(IMGTYPE_TEAMLOGO, $team->team_id);
    $logo_html = "<img border='0px' height='60' alt='Team picture' src='" . $img->getPath($team->f_race_id) . "'>";
    //Create $starPlayers array used to display the three most experienced players on the team
    $starPlayers = array();
    foreach ($team->getPlayers() as $p) {
        if ($p->is_dead || $p->is_sold) {
            continue;
        }
        $starPlayers[] = array('name' => preg_replace('/\\s/', '&nbsp;', $p->name), 'spp' => $p->mv_spp);
    }
    //Sort the array
    usort($starPlayers, create_function('$objA,$objB', 'return ($objA["spp"] < $objB["spp"]) ? +1 : -1;'));
    $starPlayers = array_slice($starPlayers, 0, 3);
    # Show only 3 Star players
    ?>
    <style type="text/css">
        /* InFocus Mod */
        #inFocusBox<?php 
    echo $_INFOCUSCNT;
    ?>
 .leftContentTd{
            font-weight: bold;
            padding-right: 1em;
        }

        #inFocusBox<?php 
    echo $_INFOCUSCNT;
    ?>
 .teamLogo {
            float: left;
            margin: 0 36px 0 20px;
        }

        #inFocusBox<?php 
    echo $_INFOCUSCNT;
    ?>
 .teamName {
            font-weight: bold;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 {
            position:relative;
            left: 160px;
            height: 80px;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 P {
            font-weight: bold;
            margin-top: 5px;
            margin-bottom: 5px;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV {
            position:absolute;
            top:0;
            left:0;
            z-index:8;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV.invisible {
            display: none;
        }

        #inFocusContent<?php 
    echo $_INFOCUSCNT;
    ?>
 DIV.inFocus {
            z-index:10;
            display: inline;
//.........这里部分代码省略.........
开发者ID:rythos42,项目名称:naflm,代码行数:101,代码来源:sections.php


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