Packagecom.whirled.contrib.card.trick
Classpublic class WinnersAndLosers

Represents the winning and losing teams of a game and provides conversion to players.



Public Properties
 PropertyDefined by
  highestLosingScore : int
[read-only] Access the highest losing score.
WinnersAndLosers
  highestScore : int
[read-only] Access the highest score of all teams.
WinnersAndLosers
  losingPlayers : Array
[read-only] Access the array of players ids that are on a losing team.
WinnersAndLosers
  losingTeams : Array
[read-only] Access the array of losing Team objects.
WinnersAndLosers
  scoreDifferential : int
[read-only] Access the amount that the winners lead by (ahead of the highest scoring losers).
WinnersAndLosers
  winningPlayers : Array
[read-only] Access the array of players ids that are on a winning team.
WinnersAndLosers
  winningTeams : Array
[read-only] Access the array of winning Team objects.
WinnersAndLosers
Protected Properties
 PropertyDefined by
  _losers : Array
WinnersAndLosers
  _scores : Scores
WinnersAndLosers
  _winners : Array
WinnersAndLosers
Public Methods
 MethodDefined by
  
WinnersAndLosers(scores:Scores, winners:Array)
Create based on a precalculated array of winning Team objects.
WinnersAndLosers
Protected Methods
 MethodDefined by
  
playersOn(teams:Array):Array
WinnersAndLosers
Property detail
highestLosingScoreproperty
highestLosingScore:int  [read-only]

Access the highest losing score. Evalulates to int.MINVALUE if there are no losers.

Implementation
    public function get highestLosingScore():int
highestScoreproperty 
highestScore:int  [read-only]

Access the highest score of all teams.

Implementation
    public function get highestScore():int
_losersproperty 
protected var _losers:Array
losingPlayersproperty 
losingPlayers:Array  [read-only]

Access the array of players ids that are on a losing team.

Implementation
    public function get losingPlayers():Array
losingTeamsproperty 
losingTeams:Array  [read-only]

Access the array of losing Team objects.

Implementation
    public function get losingTeams():Array
scoreDifferentialproperty 
scoreDifferential:int  [read-only]

Access the amount that the winners lead by (ahead of the highest scoring losers). Returns 0 in the case of an all-way tie.

Implementation
    public function get scoreDifferential():int
_scoresproperty 
protected var _scores:Scores
_winnersproperty 
protected var _winners:Array
winningPlayersproperty 
winningPlayers:Array  [read-only]

Access the array of players ids that are on a winning team.

Implementation
    public function get winningPlayers():Array
winningTeamsproperty 
winningTeams:Array  [read-only]

Access the array of winning Team objects.

Implementation
    public function get winningTeams():Array
Constructor detail
WinnersAndLosers()constructor
public function WinnersAndLosers(scores:Scores, winners:Array)

Create based on a precalculated array of winning Team objects. All remaining teams are the losers.

Parameters
scores:Scores — containing all teams
 
winners:Array — array of Team objects that share the highest score
Method detail
playersOn()method
protected function playersOn(teams:Array):ArrayParameters
teams:Array

Returns
Array