| Package | com.whirled.contrib.card.trick |
| Class | public class ScoreBreakdown |
| Property | Defined by | ||
|---|---|---|---|
| teamName : String [read-only] Access the name of the team for this breakdown.
| ScoreBreakdown | ||
| total : int [read-only] Access the total score for the breakdown.
| ScoreBreakdown | ||
| Property | Defined by | ||
|---|---|---|---|
| _elements : Array | ScoreBreakdown | ||
| _table : Table | ScoreBreakdown | ||
| _team : Team | ScoreBreakdown | ||
| Method | Defined by | ||
|---|---|---|---|
|
ScoreBreakdown(table:Table, team:int)
Create a new score breakdown.
| ScoreBreakdown | ||
|
addPlayerAchievement(value:int, playerIdx:int, achievement:String):void
Adds a new achievement for the team that was orchestrated by one player in particular.
| ScoreBreakdown | ||
|
addTeamAchievement(value:int, achievement:String):void
Adds a new achivement for the team that contributes to the overall score for the round.
| ScoreBreakdown | ||
|
addTeamFailure(value:int, action:String):void
Adds a new failure for the team that contributes to the overall score for the round.
| ScoreBreakdown | ||
|
describe():Array
Get an array of String's, each describing one breakdown item added by the add functions
above, suitable for the (English speaking) user's consumption.
| ScoreBreakdown | ||
|
getPlayerName(idx:int):String
Get the name of a given player.
| ScoreBreakdown | ||
| _elements | property |
protected var _elements:Array
| _table | property |
protected var _table:Table
| _team | property |
protected var _team:Team
| teamName | property |
teamName:String [read-only]Access the name of the team for this breakdown. Assumes there are 2 players on a team. TODO: allow for more than 2 players
Implementation public function get teamName():String
| total | property |
total:int [read-only]Access the total score for the breakdown. This is a sum of all the values given in the add functions above.
Implementation public function get total():int
| ScoreBreakdown | () | constructor |
public function ScoreBreakdown(table:Table, team:int)Create a new score breakdown.
Parameterstable:Table — the table for the game
|
|
team:int — the index of the team being scored. |
| addPlayerAchievement | () | method |
public function addPlayerAchievement(value:int, playerIdx:int, achievement:String):voidAdds a new achievement for the team that was orchestrated by one player in particular. When converting to text, this causes a possessive form of the player's name to prefix the achievement text.
Parametersvalue:int — the contribution to the team's score of the achievement
|
|
playerIdx:int — the index of the player within the team that has achieved
|
|
achievement:String — text describing the achievement, e.g. "refraining from taking any
tricks" |
| addTeamAchievement | () | method |
public function addTeamAchievement(value:int, achievement:String):voidAdds a new achivement for the team that contributes to the overall score for the round. If the value is less than zero, it is implied that the team did not achieve the achievement and hence a "not" is prefixed to the text conversion for the item. If value is zero, the achievement is not recorded.
Parametersvalue:int — the contribution of the achievement to the overall score
|
|
achievement:String — text describing the achievement, e.g. "winning all their tricks" |
| addTeamFailure | () | method |
public function addTeamFailure(value:int, action:String):voidAdds a new failure for the team that contributes to the overall score for the round. If the value is greater than zero, it is implied that the team did not fail and hence a "not" is prefixed to the text conversion for the item. If the value is zero, the achievement is not recorded.
Parametersvalue:int — numeric contribution of the failure to the score, usually less than 0
|
|
action:String — text describing the failure, e.g. "taking too many tricks" |
| describe | () | method |
public function describe():ArrayGet an array of String's, each describing one breakdown item added by the add functions above, suitable for the (English speaking) user's consumption.
ReturnsArray |
| getPlayerName | () | method |
public function getPlayerName(idx:int):StringGet the name of a given player.
Parametersidx:int — the index of the player within the team |
String |