|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.ObjectEnvironment
public class Environment
WARNING: THIS IS A 2D ENVIRONMENT
Field Summary | |
---|---|
private Atmosphere |
atmosphere
|
private double |
averageTemperature
temperature |
private java.awt.Color |
backgroundColor
Background |
private javax.swing.ImageIcon |
backgroundImage
|
private int |
dayLength
|
static int |
DEFAULTSECTORSIZE
|
private double |
height
|
private java.util.Set |
items
|
java.util.Set |
itemsToBeAdded
add/remove |
java.util.Set |
itemsToBeRemoved
|
private boolean |
loopBoundaries
|
private java.lang.String |
name
name |
private Sector[][] |
sector
|
private double |
temperatureRange
|
private boolean |
tileImage
|
private int |
tileSize
|
private int |
time
time |
private double |
width
|
Constructor Summary | |
---|---|
Environment(double w,
double h,
java.lang.String backgroundFileName)
|
Method Summary | |
---|---|
boolean |
add(Item m)
|
Atmosphere |
atmosphere()
atmosphere |
double |
averageTemperature()
|
java.awt.Color |
backgroundColor()
|
javax.swing.ImageIcon |
backgroundImage()
|
Item |
checkForCollisions(Item i)
|
void |
clearAllSectors()
|
int |
clock()
|
boolean |
contains(Item m)
|
static double |
convertCentigradeToFahrenheit(double c)
|
static double |
convertFahrenheitToCentigrade(double f)
|
void |
createRandomWater(double amount)
|
double |
currentTemperature()
|
int |
dayLength()
|
void |
fillCircleUsable(int x,
int y,
int radius,
boolean use)
|
void |
fillDisease(int xo,
int yo,
int xf,
int yf,
double amount)
|
void |
fillUsable(int xo,
int yo,
int xf,
int yf,
boolean use)
|
void |
fillWater(int xo,
int yo,
int xf,
int yf,
boolean wet)
|
Sector |
findSector(Vector pos)
|
java.util.LinkedList |
getAllVisibleSectors()
|
java.util.Set |
getItemsWithinRadius(Vector pos,
double x,
double y)
|
java.util.LinkedList |
getSectorsWithinRadius(Vector pos,
double x,
double y)
|
double |
height()
|
void |
incrementTime()
|
boolean |
isEmptySpot(Vector pos)
|
boolean |
isEmptySpot(Vector pos,
double rOC)
|
boolean |
isNightTime()
|
Item |
itemAtPosition(Vector pos)
|
java.util.Set |
items()
get/set methods |
boolean |
loopBoundaries()
|
void |
loopItemPosition(Item i,
Vector oldPos)
|
java.lang.String |
name()
|
void |
recordMove(Item m,
Vector oldPos)
|
boolean |
remove(Item m)
|
void |
setAtmosphere(Atmosphere a)
|
void |
setAverageTemperature(double t)
|
void |
setBackgroundColor(java.awt.Color c)
|
void |
setBackgroundImage(javax.swing.ImageIcon i)
|
void |
setDayLength(int d)
|
void |
setLoopBoundaries(boolean b)
|
void |
setName(java.lang.String s)
|
void |
setTemperatureRange(double r)
|
void |
setTileImage(boolean b)
|
void |
setTileSize(int i)
|
void |
setTime(int t)
|
double |
temperatureRange()
|
boolean |
tileImage()
|
int |
tileSize()
|
int |
time()
|
java.lang.String |
toString()
|
void |
update()
update |
boolean |
validPosition(Vector pos)
|
boolean |
validPosition(Vector pos,
double radius)
|
double |
width()
|
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Field Detail |
---|
public static final int DEFAULTSECTORSIZE
private Sector[][] sector
private java.util.Set items
private Atmosphere atmosphere
private java.lang.String name
private int time
private int dayLength
private double averageTemperature
private double temperatureRange
public java.util.Set itemsToBeAdded
public java.util.Set itemsToBeRemoved
private boolean loopBoundaries
private double height
private double width
private java.awt.Color backgroundColor
private javax.swing.ImageIcon backgroundImage
private boolean tileImage
private int tileSize
Constructor Detail |
---|
public Environment(double w, double h, java.lang.String backgroundFileName)
Method Detail |
---|
public java.lang.String name()
public void setName(java.lang.String s)
public java.lang.String toString()
toString
in class java.lang.Object
public Atmosphere atmosphere()
public void setAtmosphere(Atmosphere a)
public void createRandomWater(double amount)
public int time()
public void incrementTime()
public void setTime(int t)
public int dayLength()
public void setDayLength(int d)
public int clock()
public boolean isNightTime()
public double averageTemperature()
public void setAverageTemperature(double t)
public double temperatureRange()
public void setTemperatureRange(double r)
public double currentTemperature()
public static double convertFahrenheitToCentigrade(double f)
public static double convertCentigradeToFahrenheit(double c)
public boolean add(Item m)
public boolean remove(Item m)
public boolean contains(Item m)
public void recordMove(Item m, Vector oldPos)
public boolean validPosition(Vector pos)
public boolean validPosition(Vector pos, double radius)
public Sector findSector(Vector pos)
public Item checkForCollisions(Item i)
public boolean loopBoundaries()
public void setLoopBoundaries(boolean b)
public void loopItemPosition(Item i, Vector oldPos)
public boolean isEmptySpot(Vector pos)
public boolean isEmptySpot(Vector pos, double rOC)
public Item itemAtPosition(Vector pos)
public void clearAllSectors()
public void fillWater(int xo, int yo, int xf, int yf, boolean wet)
public void fillDisease(int xo, int yo, int xf, int yf, double amount)
public void fillUsable(int xo, int yo, int xf, int yf, boolean use)
public void fillCircleUsable(int x, int y, int radius, boolean use)
public void update()
public java.util.Set items()
public double height()
public double width()
public java.util.Set getItemsWithinRadius(Vector pos, double x, double y)
public java.util.LinkedList getAllVisibleSectors()
public java.util.LinkedList getSectorsWithinRadius(Vector pos, double x, double y)
public java.awt.Color backgroundColor()
public void setBackgroundColor(java.awt.Color c)
public javax.swing.ImageIcon backgroundImage()
public void setBackgroundImage(javax.swing.ImageIcon i)
public boolean tileImage()
public void setTileImage(boolean b)
public int tileSize()
public void setTileSize(int i)
|
||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |