World

public class World(source)

A wrapper of a KarelWorld which represents a global world.

Constructors

Link copied to clipboard
public void World()

Functions

Link copied to clipboard
public static void addFieldClickListener(FieldClickListener fieldClickListener)
Adds the given field click listener to the input handler of the global world.
Link copied to clipboard
public static void addKeyPressListener(KeyPressListener keyPressListener)
Adds the given key press listener to the input handler of the global world.
Link copied to clipboard
public static int getDelay()
Returns the current delay value that delays all robot actions after their execution.
Link copied to clipboard
public static KarelWorld getGlobalWorld()
Returns an instance of the global world.
Link copied to clipboard
public static int getHeight()
Returns the height of the global World.
Link copied to clipboard
public static int getWidth()
Returns the width of the global World.
Link copied to clipboard
protected static boolean isGlobal()
Returns true if a global world exists.
Link copied to clipboard
public static void placeBlock(int x, int y)
Places a block at the specified coordinate.
Link copied to clipboard
public static void placeHorizontalWall(int x, int y)
Places a horizontal wall at the specified coordinate.
Link copied to clipboard
public static void placeVerticalWall(int x, int y)
Places a vertical wall at the specified coordinate.
Link copied to clipboard
public static void putCoins(int x, int y, int numberOfCoins)
Places the specified number of coins at the specified coordinate.
Link copied to clipboard
public static void reset()
Resets the world by creating a new global world and thus indirectly removes all entities.
Link copied to clipboard
public static void setDelay(int delay)
Sets the delay that delays all robot actions after their execution.
Link copied to clipboard
public static void setSize(int width, int height)
Creates a new global world with the specified world size.
Link copied to clipboard
public static void setVisible(boolean visible)
Sets the visibility of the world to the specified visibility value.