📄 mainloop.java
字号:
/* * This code is from the book: * * Winder, R and Roberts, G (2000) Developing Java * Software, second edition, John Wiley & Sons. * * It is copyright (c) 2000 Russel Winder and Graham Roberts. */package SimFrameWork ;/** * This class implements the main control loop of a simulation * which is run in a separate thread. This allows the simulation * to run independently of whatever else the rest of the program * is doing. * * @version 2.0 March 1999 * @author Graham Roberts */public class MainLoop extends Control { /** * Need a world object to run. * * @param g grid to be run. */ public MainLoop(Grid g) { world = g ; } /** * Move simulation through next time step. */ public void update() { world.step() ; } /** * Reference to world being run. */ private Grid world ;}
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -