Class ToolManager

java.lang.Object
de.tum.cit.ase.editor.tools.ToolManager

public class ToolManager extends Object
The ToolManager class provides utility methods for managing tools.
  • 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 of
      grid - the 2D array representing the grid
      canvas - the canvas to associate the tool instance with
      Returns:
      an instance of the specified tool class
    • freeTool

      public static <T extends Tool> void freeTool(T toolObject)
      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