megamek.server.victory
Class SummingThresholdVictory
java.lang.Object
megamek.server.victory.SummingThresholdVictory
- All Implemented Interfaces:
- java.io.Serializable, Victory
public class SummingThresholdVictory
- extends java.lang.Object
- implements Victory, java.io.Serializable
a summing victory condition will first sum all given victory conditions, if
any of them are in victory state AND someone is over the threshold, then will
return victory , otherwise just the scores the scores will be an average of
the given victory scores.
- See Also:
- Serialized Form
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
vs
protected Victory[] vs
thr
protected int thr
SummingThresholdVictory
public SummingThresholdVictory(int threshold,
Victory[] victories)
victory
public Victory.Result victory(IGame game,
java.util.HashMap<java.lang.String,java.lang.Object> ctx)
- Specified by:
victory in interface Victory
- Parameters:
game - - the game (state) we are playingctx - - a map Strings to simple serializable objects (preferably
Integers , Strings ,Doubles etc) which are used to store state
between executions if such feature is absolutely required.. as
a key you should use something atleast class- specific to
limit namespace collisions
- Returns:
- a result with true if victory occured, false if not must not
return null MUST NOT modify game state!