Class StrategyFactory

java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.statics.StrategyFactory

public class StrategyFactory extends Object
A factory for creating MovementStrategy instances
  • Constructor Details

    • StrategyFactory

      public StrategyFactory()
  • Method Details

    • getStrategyClass

      public static <T extends MovementStrategy> Class<T> getStrategyClass(MovementType type)
      Get the strategy class for a given MovementType
      Type Parameters:
      T - The type of MovementStrategy
      Parameters:
      type - The MovementType
      Returns:
      The strategy class
    • createStrategy

      public static <T extends MovementStrategy> T createStrategy(VehicleModel model, MovementType type)
      Create a MovementStrategy instance for a given VehicleModel and MovementType
      Type Parameters:
      T - The type of MovementStrategy
      Parameters:
      model - The VehicleModel
      type - The MovementType
      Returns:
      The MovementStrategy instance