megamek.common
Class InitiativeRoll

java.lang.Object
  extended by megamek.common.InitiativeRoll
All Implemented Interfaces:
java.io.Serializable, java.lang.Comparable<InitiativeRoll>

public class InitiativeRoll
extends java.lang.Object
implements java.lang.Comparable<InitiativeRoll>, java.io.Serializable

A roll, or sequence of rolls, made by the player to determine initiative order. Also contains some methods for ordering players by initiative.

Version:
Author:
Ben
See Also:
Serialized Form

Constructor Summary
InitiativeRoll()
           
 
Method Summary
 void addRoll(int bonus)
           
 void clear()
           
 int compareTo(InitiativeRoll other)
           
 boolean equals(InitiativeRoll other)
          Two initiative rolls are equal if they match, roll by roll
 int getRoll(int index)
           
 void replaceRoll(int bonus)
          Replace the previous init roll with a new one, and make a note that it was replaced.
 int size()
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InitiativeRoll

public InitiativeRoll()
Method Detail

clear

public void clear()

addRoll

public void addRoll(int bonus)

replaceRoll

public void replaceRoll(int bonus)
Replace the previous init roll with a new one, and make a note that it was replaced. Used for Tactical Genius special pilot ability (lvl 3).


size

public int size()

getRoll

public int getRoll(int index)

equals

public boolean equals(InitiativeRoll other)
Two initiative rolls are equal if they match, roll by roll


compareTo

public int compareTo(InitiativeRoll other)
Specified by:
compareTo in interface java.lang.Comparable<InitiativeRoll>

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object