Interface VictoryCondition

All Known Subinterfaces:
BVVictoryCondition
All Known Implementing Classes:
BattlefieldControlVictory, BVDestroyedVictoryCondition, BVRatioVictoryCondition, DrawTriggeredEvent, EnemyCmdrDestroyedVictory, KillCountVictory, PlayerAgreedVictory, VictoryPointVictory, VictoryTriggeredEvent

public interface VictoryCondition
Interface for classes judging whether a victory occurred or not. These classes must not modify the game state. Reporting must be done via the given interface.
Note: VictoryConditions may be checked any number of times at various points in the game and implementing classes must be able to deal with this. For example, a VictoryCondition that counts rounds must not assume that is called only once per round.
Note: VictoryConditions should add proper reports to their resulting VictoryResult. When doing so, note that their results might be filtered in double-blind games. So, the reports should be mostly of the "what is the score"-type (player A occupies the victory location) or fact-type (Player A has destroyed player B's commander).
Note: The context should use simple serializable objects (preferably Integers, Strings, Doubles etc.) to store state between executions if such a feature is absolutely required.
  • Method Summary

    Modifier and Type
    Method
    Description
    checkVictory(Game game, Map<String,Object> context)
    Tests if a victory (or draw) has occurred and returns a properly filled in VictoryResult.
  • Method Details

    • checkVictory

      VictoryResult checkVictory(Game game, Map<String,Object> context)
      Tests if a victory (or draw) has occurred and returns a properly filled in VictoryResult. Should return VictoryResult.noResult() if this victory condition has not been met.
      Parameters:
      game - The current Game
      context - The context to consider, see VictoryCondition (currently unused)
      Returns:
      The result of the victory condition test