megamek.server.victory
Interface Victory.Result

All Known Implementing Classes:
SimpleDrawResult, SimpleNoResult, SimpleResult, VictoryResult
Enclosing interface:
Victory

public static interface Victory.Result

result class which can be queried for winner and if victory occurred victory might be true and winner "None" if the players have drawn winner might be NONE and team set to winning team. NOTE: a player which is in a team, should not win by himself. so if there is a winning team and a winning player it is a draw this should actually be a victorypoint-like structure with boolean for "game end" (victory) and 0.0(loss) to 1.0(victory) score for each team and player


Method Summary
 int[] getPlayers()
          list players
 double getPlayerScore(int id)
           
 java.util.ArrayList<Report> getReports()
           
 int[] getTeams()
          list teams
 double getTeamScore(int id)
          list team scores all teams which are not listed, can be assumed to be at 0.0
 int getWinningPlayer()
           
 int getWinningTeam()
           
 boolean isDraw()
           
 boolean isWinningPlayer(int id)
           
 boolean isWinningTeam(int id)
           
 boolean victory()
           
 

Method Detail

victory

boolean victory()
Returns:
true if the game is about to end since someone has completed the victory conditions

getPlayerScore

double getPlayerScore(int id)
Returns:
player victory level 0.0(total loss) to 1.0 (total victory) anybody not listed can be assumed to be at 0.0 score

getPlayers

int[] getPlayers()
list players


getTeamScore

double getTeamScore(int id)
list team scores all teams which are not listed, can be assumed to be at 0.0


getTeams

int[] getTeams()
list teams


isWinningTeam

boolean isWinningTeam(int id)
Returns:
true if this is a winning team id (draw == win in this case)

isWinningPlayer

boolean isWinningPlayer(int id)
Returns:
true if this is a winning player id (draw == win in this case)

getReports

java.util.ArrayList<Report> getReports()
Returns:
arrayList of reports generated by the victory checking. Usually empty when no victory should never be null might contain reports about victoryconditions which are about to be filled or are time triggered

getWinningTeam

int getWinningTeam()
Returns:
id of the winning team, Player.TEAM_NONE if it's a draw

getWinningPlayer

int getWinningPlayer()
Returns:
id of the winning player, Player.TEAM_NONE if it's a draw

isDraw

boolean isDraw()
Returns:
if this is a draw