Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames

WormbotHandler3SPN.WIR_GameHandler_AM


00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025
00026
00027
00028
00029
00030
00031
00032
00033
00034
00035
00036
00037
00038
00039
00040
00041
00042
00043
00044
00045
00046
00047
00048
00049
00050
00051
00052
00053
00054
00055
00056
00057
00058
00059
00060
00061
00062
00063
00064
00065
00066
00067
00068
00069
00070
00071
00072
00073
00074
00075
00076
00077
00078
00079
00080
00081
00082
00083
00084
00085
00086
00087
00088
00089
00090
00091
00092
00093
00094
00095
00096
00097
00098
00099
00100
00101
00102
00103
00104
00105
00106
00107
00108
00109
00110
00111
00112
00113
00114
00115
/******************************************************************************
Copyright (c) 2005-2007 by Wormbo <wormbo@online.de>
$Id$

Handler for Arena Master.
******************************************************************************/


class WIR_GameHandler_AM extends WIR_GameHandler_TAM;


//== AddRow ==================================================================
/**
Adds data in a row on the left or right side of the scoreboard table.
*/
//=============================================================================

function AddRow(out array<WIR_Util.TAlignedTable> Table, int row, PlayerReplicationInfo PRI, bool bRightSide)
{
  local int col, coloffset;
  
  if ( bRightSide )
    coloffset = (Table.Length + 1) / 2;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = Repl(FormatPlayerName(PRI, True), "[^B]", "", True); // strip code for bold
  ++col;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = string(int(PRI.GetPropertyText("RoundsWon")));
  ++col;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = string(int(PRI.Score));
  ++col;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = int(PRI.GetPropertyText("Percent")) $ "%";
  ++col;
  
  if ( Table[col+coloffset].Rows.Length <= row )
    Table[col+coloffset].Rows.Length = row + 1;
  Table[col+coloffset].Rows[row].Content = string(int(PRI.GetPropertyText("WeaponDamage")));
  ++col;
}


//== InOrder ==================================================================
/**
Returns True if player 1 ranks higher than player 2.
*/
//=============================================================================

function bool InOrder(PlayerReplicationInfo PRI1, PlayerReplicationInfo PRI2)
{
  if ( PRI1 == None || PRI2 == None )
    return PRI1 != None;
  
  if ( int(PRI1.GetPropertyText("RoundsWon")) > int(PRI2.GetPropertyText("RoundsWon")) )
    return true;
  if ( int(PRI1.GetPropertyText("RoundsWon")) < int(PRI2.GetPropertyText("RoundsWon")) )
    return false;
  
  if ( PRI1.Score > PRI2.Score )
    return true;
  if ( PRI1.Score < PRI2.Score )
    return false;
  
  if ( PRI1.Deaths < PRI2.Deaths )
    return true;
  if ( PRI1.Deaths > PRI2.Deaths )
    return false;
  
  return PRI1.PlayerName > PRI2.PlayerName;
}


//=============================================================================
// Default properties
//=============================================================================

defaultproperties
{
  StringTableHeader(0)  = "[^U]Name"
  StringTableHeader(1)  = "Wins"
  StringTableHeader(2)  = "Score"
  StringTableHeader(3)  = "Acc."
  StringTableHeader(4)  = "Dam.[^O]"
  StringTableHeader(5)  = " "
  StringTableHeader(6)  = "[^U]Name"
  StringTableHeader(7)  = "Wins"
  StringTableHeader(8)  = "Score"
  StringTableHeader(9)  = "Acc."
  StringTableHeader(10) = "Dam.[^O]"
  
  ColumnAlign(0)  = TXTA_Left
  ColumnAlign(1)  = TXTA_Right
  ColumnAlign(2)  = TXTA_Right
  ColumnAlign(3)  = TXTA_Right
  ColumnAlign(4)  = TXTA_Right
  ColumnAlign(5)  = TXTA_Center
  ColumnAlign(6)  = TXTA_Left
  ColumnAlign(7)  = TXTA_Right
  ColumnAlign(8)  = TXTA_Right
  ColumnAlign(9)  = TXTA_Right
  ColumnAlign(10) = TXTA_Right
  
  HandlerGroup = "Wormbot (AM)"
  StringScoreTemplate = "[roundswon]/[score]/[weapondamage]/[ping]ms"
}

Overview Package Class Source Class tree Glossary
previous class      next class frames      no frames
Class file time: Mo 12.3.2007 10:46:18.000 - Creation time: Do 14.8.2014 09:58:55.480 - Created with UnCodeX