Class StrategyFactory
java.lang.Object
nl.sbdeveloper.vehiclesplus.api.vehicles.statics.StrategyFactory
A factory for creating MovementStrategy instances
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends MovementStrategy>
TcreateStrategy(VehicleModel model, MovementType type) Create a MovementStrategy instance for a given VehicleModel and MovementTypestatic <T extends MovementStrategy>
Class<T> getStrategyClass(MovementType type) Get the strategy class for a given MovementType
-
Constructor Details
-
StrategyFactory
public StrategyFactory()
-
-
Method Details
-
getStrategyClass
Get the strategy class for a given MovementType- Type Parameters:
T- The type of MovementStrategy- Parameters:
type- The MovementType- Returns:
- The strategy class
-
createStrategy
Create a MovementStrategy instance for a given VehicleModel and MovementType- Type Parameters:
T- The type of MovementStrategy- Parameters:
model- The VehicleModeltype- The MovementType- Returns:
- The MovementStrategy instance
-