Class Transition

java.lang.Object
de.gurkenlabs.litiengine.entities.behavior.Transition
All Implemented Interfaces:
Comparable<Transition>
Direct Known Subclasses:
EntityTransition

public abstract class Transition extends Object implements Comparable<Transition>
Represents a transition with a priority and a target state.
  • Constructor Summary

    Constructors
    Modifier
    Constructor
    Description
    protected
    Transition(int priority)
    Initializes a new instance of the Transition class with the specified priority.
    protected
    Transition(int priority, State targetState)
    Initializes a new instance of the Transition class with the specified priority and target state.
  • Method Summary

    Modifier and Type
    Method
    Description
    int
    Compares this transition with another transition based on their priorities.
    protected abstract boolean
    Checks if the conditions for the transition are fulfilled.
    Gets the next state of the transition.
    int
    Gets the priority of the transition.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Transition

      protected Transition(int priority)
      Initializes a new instance of the Transition class with the specified priority.
      Parameters:
      priority - the priority of the transition
    • Transition

      protected Transition(int priority, State targetState)
      Initializes a new instance of the Transition class with the specified priority and target state.
      Parameters:
      priority - the priority of the transition
      targetState - the target state of the transition
  • Method Details

    • compareTo

      public int compareTo(Transition other)
      Compares this transition with another transition based on their priorities.
      Specified by:
      compareTo in interface Comparable<Transition>
      Parameters:
      other - the other transition to compare with
      Returns:
      a negative integer, zero, or a positive integer as this transition's priority is less than, equal to, or greater than the specified transition's priority
    • getNextState

      public State getNextState()
      Gets the next state of the transition.
      Returns:
      the next state of the transition
    • getPriority

      public int getPriority()
      Gets the priority of the transition.
      Returns:
      the priority of the transition
    • conditionsFullfilled

      protected abstract boolean conditionsFullfilled()
      Checks if the conditions for the transition are fulfilled.
      Returns:
      true if the conditions are fulfilled, false otherwise