Class ConstantSpeed

    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
    • Field Summary

      Fields 
      Modifier and Type Field Description
    • Enum Constant Summary

      Enum Constants 
      Enum Constant Description
    • Constructor Detail

      • ConstantSpeed

        ConstantSpeed(Reaction<out Object> reaction, double speed)
        Parameters:
        reaction - the reaction
        speed - the speed, in meters/second
    • Method Detail

      • getNodeMovementLength

         double getNodeMovementLength(P target)
        Parameters:
        target - the Position describing where the Node is directed
        Returns:

        the current node's movement. The returned value represents a length.

      • cloneIfNeeded

         ConstantSpeed<T, P> cloneIfNeeded(Node<T> destination, Reaction<T> reaction)
        Parameters:
        destination - the Node where the strategy is being cloned
        reaction - the Reaction where strategy is being cloned
        Returns:

        A copy of the strategy if the strategy is stateful, and this object otherwise. The default implementation assumes a stateless strategy.