Class Task

java.lang.Object
blockly_robot.robot.logic.Task

public class Task extends Object
Eine Trainingsaufgabe (Task) besteht aus mehreren (in der Regel 3) Schwierigkeitsgraden (Difficulty). Ein Schwierigkeitsgrad kann einen oder mehrere Tests (Level) haben.
  • Constructor Details

    • Task

      public Task(String filePath)
  • Method Details

    • loadByTaskPath

      public static Task loadByTaskPath(String taskPath)
      Parameters:
      taskPath - Der relative Pfad zu resources/data/tasks
    • extractTaskPath

      public static String extractTaskPath(String path)
    • taskPath

      @Getter public String taskPath()
    • data

      @Getter public TaskData data()
    • title

      @Getter public String title()
    • intro

      @Getter public String intro()
    • itemCreator

      @Getter public ItemCreator itemCreator()
    • borderColor

      @Getter public String borderColor()
      Returns the grid color.
      Returns:
      the grid color as a String.
    • backgroundColor

      @Getter public String backgroundColor()
      Returns the background color.
      Returns:
      the background color as a String.
    • bagSize

      @Getter public int bagSize()
    • maxFallAltitude

      @Getter public int maxFallAltitude()
    • nbPlatforms

      @Getter public int nbPlatforms()
    • levels

      @Getter public Map<Difficulty,List<Level>> levels()
      Returns a map of difficulty levels and their corresponding list of levels.
      Returns:
      the map of difficulty levels and their corresponding list of levels
    • level

      @Getter public Level level(Difficulty difficulty, int test)
      Retrieves the level for a given difficulty and test.
      Parameters:
      difficulty - the difficulty of the task
      test - the test index (0 is the first test)
      Returns:
      the level corresponding to the given difficulty and test
    • level

      @Getter public Level level(Difficulty difficulty)
      Returns the level associated with the given difficulty.
      Parameters:
      difficulty - the difficulty of the task
      Returns:
      the level associated with the difficulty
    • level

      @Getter public Level level(int difficulty)
      Retrieves the level based on the given difficulty.
      Parameters:
      difficulty - the difficulty level as an integer (0 is easy, 1 is medium, 2 is hard)
      Returns:
      the corresponding level
    • level

      @Getter public Level level()
      Returns the first version of a training task with the easiest difficulty. / Gibt die erste Version einer Trainingsaufgabe mit dem leichtesten Schwierigkeitsgrad zurück.
    • levelCollection

      @Getter public LevelCollection levelCollection()
    • contextData

      @Getter public Context contextData()
    • virtualRobot

      @Getter public VirtualRobot virtualRobot()
      Returns the virtual robot of the first version of a training task with the easiest difficulty. / Gibt einen virtuellen Roboter der erste Version einer Trainingsaufgabe mit dem leichtesten Schwierigkeitsgrad zurück.
    • maxCols

      @Getter public int maxCols()
      Die Anzahl der Kacheln einer Spalte, des Tests (Level) mit der größten horizontalen Ausdehnung.
    • maxRows

      @Getter public int maxRows()
      Die Anzahl der Kacheln einer Zeile, des Tests (Level) mit der größten vertikalen Ausdehnung.
    • numberOfDifficulties

      @Getter public int numberOfDifficulties()
      Die Anzahl an Schwierigkeitsgraden (In der Regel 3).
    • maxLevelsPerDifficulty

      @Getter public int maxLevelsPerDifficulty()
      Die Anzahl der Tests des Schwierigkeitsgrads mit den meisten Tests.
    • numberOfLevels

      @Getter public int numberOfLevels()
      Die Anzahl aller Tests (Level).
    • hasGravity

      public boolean hasGravity()
    • autoWithdraw

      @Getter public boolean autoWithdraw()
    • bagInit

      @Getter public BagInit bagInit()