|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectbot.gen.Gen
This is a utility class that takes boards and does stuff to them.
| Constructor Summary | |
Gen()
|
|
| Method Summary | |
static Square |
acidLine(Board b,
int sx,
int sy,
int dx,
int dy,
int len)
Draw a line len units long starting at sx, sy going dx,dy per step. |
static void |
addSquare(Board b,
int xcor,
int ycor)
Add a square at given coordinates. |
static void |
addSquare(Board b,
int x,
int y,
Actor a)
Add square with given actor in it. |
static void |
addSquare(Board b,
int x,
int y,
Thing t)
Add square with given thing in it. |
static void |
addSquare(Board b,
Point p)
Add a square at given coordinates. |
static void |
addSquare(Board b,
Point p,
Thing t)
Add a square at given coordinates. |
static Square |
drawBranch(Board board,
int sx,
int sy,
int branchLength)
Starting at sx,sy wander around randomly in branchLength segments from the origin. |
static Square |
getRandomEvenSquare(Board b)
Nab a square with coordinates that are even numbers. |
static Square |
getRandomSquare(Board b,
boolean need_empty)
|
static void |
landAtOrigin(Board board)
Make starting spot the origin. |
static Square |
line(Board b,
int sx,
int sy,
int dir,
int len)
Draw a line len units long starting at sx, sy going dir Take len steps. |
static Square |
line(Board b,
int sx,
int sy,
int dx,
int dy,
int len)
Draw a line len units long starting at sx, sy going dx,dy per step. |
static Thing |
makeRandomThing()
|
static Thing |
makeRandomThing(boolean danger)
Generate a random object. |
static Thing |
makeRandomThing(String[] objects)
|
static void |
moveOut(Board b,
Square s)
Randomly place any actor or thing currently on the given square so the square is empty. |
static int |
numEmptiesNextdoor(Board b,
Point p)
Return number of non-wall squares next to where the given square is. |
static void |
place(Board b,
int x,
int y,
Thing t)
Place thing at given coordinates. |
static void |
placeRandomThings(Board board,
int num)
|
static void |
randomActorPlace(Board b,
Actor thing)
|
static void |
randomKeyPlace(Board b)
Place key on random square in board (that does not have anything else there |
static void |
randomThingPlace(Board b,
Thing thing)
|
static void |
setActor(Board b,
int x,
int y,
Actor a)
Place thing at given coordinates. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
public Gen()
| Method Detail |
public static Square line(Board b,
int sx,
int sy,
int dir,
int len)
public static Square line(Board b,
int sx,
int sy,
int dx,
int dy,
int len)
public static Square acidLine(Board b,
int sx,
int sy,
int dx,
int dy,
int len)
public static void addSquare(Board b,
int xcor,
int ycor)
public static void addSquare(Board b,
Point p)
public static void addSquare(Board b,
Point p,
Thing t)
public static void addSquare(Board b,
int x,
int y,
Thing t)
public static void addSquare(Board b,
int x,
int y,
Actor a)
public static Square drawBranch(Board board,
int sx,
int sy,
int branchLength)
public static Square getRandomSquare(Board b,
boolean need_empty)
public static Square getRandomEvenSquare(Board b)
public static void landAtOrigin(Board board)
public static void randomKeyPlace(Board b)
public static void randomThingPlace(Board b,
Thing thing)
public static void randomActorPlace(Board b,
Actor thing)
public static void moveOut(Board b,
Square s)
public static void place(Board b,
int x,
int y,
Thing t)
public static void setActor(Board b,
int x,
int y,
Actor a)
public static int numEmptiesNextdoor(Board b,
Point p)
public static void placeRandomThings(Board board,
int num)
public static Thing makeRandomThing()
public static Thing makeRandomThing(boolean danger)
danger -
public static Thing makeRandomThing(String[] objects)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||