Package de.tum.cit.ase.editor.tools
Class ToolManager
java.lang.Object
de.tum.cit.ase.editor.tools.ToolManager
The ToolManager class provides utility methods for managing tools.
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionstatic <T extends Tool>
voidfreeTool
(T toolObject) Frees a tool by returning it to the object pool.static <T extends EditorTool>
TRetrieves an instance of the specified tool class using a generic type parameter.
-
Constructor Details
-
ToolManager
public ToolManager()
-
-
Method Details
-
getTool
public static <T extends EditorTool> T getTool(Class<T> toolClass, TileTypes[][] grid, Canvas canvas) Retrieves an instance of the specified tool class using a generic type parameter.- Type Parameters:
T
- the type of the tool class- Parameters:
toolClass
- the class of the tool to retrieve an instance ofgrid
- the 2D array representing the gridcanvas
- the canvas to associate the tool instance with- Returns:
- an instance of the specified tool class
-
freeTool
Frees a tool by returning it to the object pool.- Type Parameters:
T
- the type of the tool object- Parameters:
toolObject
- the tool object to free
-