Interface IRobocodeEngine

  • All Known Implementing Classes:
    RobocodeEngine

    public interface IRobocodeEngine
    Interface for the RobocodeEngine.
    Author:
    Pavel Savara (original), Flemming N. Larsen (contributor)
    • Method Detail

      • close

        void close()
        Closes the RobocodeEngine and releases any allocated resources it holds. You should call this when you have finished using the RobocodeEngine. This method automatically disposes the Robocode window if it open.
      • getVersion

        java.lang.String getVersion()
        Returns the installed version of Robocode controlled by this RobocodeEngine.
        Returns:
        the installed version of Robocode controlled by this RobocodeEngine.
      • setVisible

        void setVisible​(boolean visible)
        Shows or hides the Robocode window.
        Parameters:
        visible - true if the Robocode window must be set visible; false otherwise.
      • getLocalRepository

        RobotSpecification[] getLocalRepository()
        Returns all robots available from the local robot repository of Robocode. These robots must exists in the /robocode/robots directory, and must be compiled in advance, before these robot are returned with this method.
        Returns:
        an array of all available robots from the local robot repository.
        See Also:
        RobotSpecification, getLocalRepository(String)
      • getLocalRepository

        RobotSpecification[] getLocalRepository​(java.lang.String selectedRobotList)
        Returns a selection of robots available from the local robot repository of Robocode. These robots must exists in the /robocode/robots directory, and must be compiled in advance, before these robot are returned with this method.

        Notice: If a specified robot cannot be found in the repository, it will not be returned in the array of robots returned by this method.

        Parameters:
        selectedRobotList - a comma or space separated list of robots to return. The full class name must be used for specifying the individual robot, e.g. "sample.Corners, sample.Crazy".
        Returns:
        an array containing the available robots from the local robot repository based on the selected robots specified with the selectedRobotList parameter.
        Since:
        1.6.2
        See Also:
        RobotSpecification, getLocalRepository()
      • runBattle

        void runBattle​(BattleSpecification battleSpecification,
                       java.lang.String initialPositions,
                       boolean waitTillOver)
        Runs the specified battle.
        Parameters:
        battleSpecification - the specification of the battle to run including the participating robots.
        initialPositions - a comma or space separated list like: x1,y1,heading1, x2,y2,heading2, which are the coordinates and heading of robot #1 and #2. So e.g. 0,0,180, 50,80,270 means that robot #1 has position (0,0) and heading 180, and robot #2 has position (50,80) and heading 270.
        waitTillOver - will block caller till end of battle if set
        Since:
        1.7.1.2
        See Also:
        runBattle(BattleSpecification), BattleSpecification, getLocalRepository()