本文整理汇总了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;
}