SHOW:
|
|
- or go back to the newest paste.
| 1 | private class BGPlayer | |
| 2 | {
| |
| 3 | public BGPlayer(String PlayerName) | |
| 4 | {
| |
| 5 | this.m_PlayerName = PlayerName; | |
| 6 | } | |
| 7 | ||
| 8 | private String m_PlayerName; | |
| 9 | public String getPlayerName(){ return m_PlayerName; }
| |
| 10 | ||
| 11 | private int m_CapturedFlags = 0; | |
| 12 | public int getCapturedFlags(){ return this.m_CapturedFlags;}
| |
| 13 | ||
| 14 | private int m_Multi = 0; | |
| 15 | private int m_BestMulti = 1; | |
| 16 | private long m_KillTimestamp = System.currentTimeMillis(); | |
| 17 | ||
| 18 | private int m_Kills = 0; | |
| 19 | public int getKills(){ return this.m_Kills;}
| |
| 20 | public void KilledPlayer() | |
| 21 | {
| |
| 22 | // add player kills | |
| 23 | this.m_Kills += 1; | |
| 24 | // check for multikill | |
| 25 | if (System.currentTimeMillis() - m_KillTimestamp < 1000) | |
| 26 | {
| |
| 27 | m_Multi+=1; | |
| 28 | if (m_Multi > m_BestMulti) m_BestMulti = m_Multi; | |
| 29 | } | |
| 30 | else | |
| 31 | {
| |
| 32 | m_Multi = 1; | |
| 33 | } | |
| 34 | ||
| 35 | // update kill timestamp | |
| 36 | m_KillTimestamp = System.currentTimeMillis(); | |
| 37 | } | |
| 38 | ||
| 39 | private int m_Deaths = 0; | |
| 40 | public int getDeaths(){ return this.m_Deaths;}
| |
| 41 | public void Died(){ this.m_Deaths += 1;}
| |
| 42 | ||
| 43 | private int m_DamageDealt = 0; | |
| 44 | public int getDamageDealt() { return this.m_DamageDealt; }
| |
| 45 | public void dealtDamage(int Damage) { this.m_DamageDealt += Damage;}
| |
| 46 | ||
| 47 | private int m_DamageTaken = 0; | |
| 48 | public int getDamageTaken() { return this.m_DamageTaken; }
| |
| 49 | public void tookDamage(int Damage) { this.m_DamageTaken += Damage;}
| |
| 50 | } |