megamek.server.victory
Class BVRatioVictory
java.lang.Object
megamek.server.victory.AbstractBVVictory
megamek.server.victory.BVRatioVictory
- All Implemented Interfaces:
- java.io.Serializable, Victory
public class BVRatioVictory
- extends AbstractBVVictory
implements bv-ratio victory checking ratio is defined as
friendlybv/enemybv>(bvratiopercent/100)=>win so this comparison is valid for
3 team combat , but you must drop ALL enemies combined to below given ratio.
if multiple players reach this goal at the same time, the result is declared
a draw NOTENOTE: this could be improved to take into account ratios which
exceed given ratio
- See Also:
- Serialized Form
|
Field Summary |
protected int |
ratio
|
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
ratio
protected int ratio
BVRatioVictory
public BVRatioVictory(int ratio)
victory
public Victory.Result victory(IGame game,
java.util.HashMap<java.lang.String,java.lang.Object> ctx)
- 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!