Source for file TeamList.php

Documentation is available at TeamList.php

  1. <?php
  2. /**
  3.  * Defines TeamList class.
  4.  *
  5.  * @package recAnalyst
  6.  * @version $Id: TeamList.php 23 2009-05-11 12:51:06Z biegleux $
  7.  * @author biegleux <biegleux[at]gmail[dot]com>
  8.  * @copyright copyright (c) 2008-2009 biegleux
  9.  * @license http://www.opensource.org/licenses/gpl-3.0.html GNU General Public License version 3 (GPLv3)
  10.  * @link http://recanalyst.sourceforge.net/
  11.  * @filesource
  12.  */
  13.  
  14. /**
  15.  * Class TeamList.
  16.  *
  17.  * TeamList implements a list of teams in the game.
  18.  *
  19.  * @package recAnalyst
  20.  */
  21. class TeamList extends TList
  22. {
  23.     /**
  24.      * Adds a team to the list
  25.      *
  26.      * @param Team $team the team we wish to add
  27.      */
  28.     public function addTeam (Team $team)
  29.     {
  30.         parent::addItem ($team);
  31.     }
  32.  
  33.     /**
  34.      * Returns a team at the specified offset.
  35.      *
  36.      * @param int $index an index of the team
  37.      * @return Team|boolthe team or false if the index is out of the range
  38.      */
  39.     public function getTeam ($index)
  40.     {
  41.         return parent::getItem ($index);
  42.     }
  43.  
  44.     /**
  45.      * Returns a team with its index equal as the one required.
  46.      *
  47.      * @param int $index team's index
  48.      * @return Team|boolthe team or false if no team has been found
  49.      */
  50.     public function getTeamByIndex ($index)
  51.     {
  52.         for ($i 0$i $this->count$i++)
  53.         {
  54.             if ($this->list[$i]->getIndex (== $index)
  55.             {
  56.                 return $this->list[$i];
  57.             }
  58.         }
  59.         return false;
  60.     }
  61. }
  62. ?>

Documentation generated on Mon, 11 May 2009 16:43:54 +0200 by phpDocumentor 1.4.1