/** * DemoSim.java * * @author Zuo Yan * @version 1.0 */ import world.World; import vehicle.*; /** * Main class that demostrate some funtionality of the framework * */ public class DemoSim { /** * Main Method
* Takes one optional parameter:
* the path and file name of the world file.
*/
public static void main(String[] args) {
World myWorld = new World();
if (args.length == 1) {
myWorld = world.WorldCreator.modifyWorld(args[0], myWorld);
} else {
myWorld = world.WorldCreator.modifyWorld(myWorld);
}
if (myWorld != null) {
AbstractVehicle av = new BasicVehicle(myWorld);
av.moveTo(10, 230);
AbstractVehicle av2 = new AutomaticRightMovingV(myWorld);
av2.moveTo(10, 80);
myWorld.addVehicle(av);
myWorld.addVehicle(av2);
myWorld.start();
}
}
}