本文整理匯總了Java中info.gridworld.world.World類的典型用法代碼示例。如果您正苦於以下問題:Java World類的具體用法?Java World怎麽用?Java World使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
World類屬於info.gridworld.world包,在下文中一共展示了World類的9個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: locationClicked
import info.gridworld.world.World; //導入依賴的package包/類
/**
* Callback on mousePressed when editing a grid.
*/
private void locationClicked() {
World<T> world = parentFrame.getWorld();
Location loc = display.getCurrentLocation();
if (loc != null && !world.locationClicked(loc))
editLocation();
parentFrame.repaint();
}
示例2: deleteLocation
import info.gridworld.world.World; //導入依賴的package包/類
/**
* Edits the contents of the current location, by displaying the constructor
* or method menu.
*/
public void deleteLocation() {
World<T> world = parentFrame.getWorld();
Location loc = display.getCurrentLocation();
if (loc != null) {
world.remove(loc);
parentFrame.repaint();
}
}
示例3: locationClicked
import info.gridworld.world.World; //導入依賴的package包/類
/**
* Callback on mousePressed when editing a grid.
*/
private void locationClicked()
{
World<T> world = parentFrame.getWorld();
Location loc = display.getCurrentLocation();
if (loc != null && !world.locationClicked(loc))
editLocation();
parentFrame.repaint();
}
示例4: deleteLocation
import info.gridworld.world.World; //導入依賴的package包/類
/**
* Edits the contents of the current location, by displaying the constructor
* or method menu.
*/
public void deleteLocation()
{
World<T> world = parentFrame.getWorld();
Location loc = display.getCurrentLocation();
if (loc != null)
{
world.remove(loc);
parentFrame.repaint();
}
}
示例5: getWorld
import info.gridworld.world.World; //導入依賴的package包/類
/**
* Gets the world that this frame displays
* @return the world
*/
public World<T> getWorld()
{
return world;
}
示例6: ForLoopCircles
import info.gridworld.world.World; //導入依賴的package包/類
public ForLoopCircles()
{
circleGrid = new BoundedGrid<String>(1,10);
circleWorld = new World<String>(circleGrid);
}
示例7: BoxWord
import info.gridworld.world.World; //導入依賴的package包/類
public BoxWord()
{
charGrid = new BoundedGrid<String>(0,0);
charWorld = new World<String>(charGrid);
}
示例8: drawCircles
import info.gridworld.world.World; //導入依賴的package包/類
public void drawCircles()
{
for (int i=0; i<circleGrid.getNumCols(); i++){
circleGrid.put(new Location(0,i),"O");
}
//add a for loop here
circleWorld = new World<String>(circleGrid);
}
示例9: getWorld
import info.gridworld.world.World; //導入依賴的package包/類
/**
* Gets the world that this frame displays
*
* @return the world
*/
public World<T> getWorld() {
return world;
}