Package barsuift.simLife.universe

Examples of barsuift.simLife.universe.UniverseContext


            application.saveUniverse();
            fail("Should throw an IllegalStateException");
        } catch (IllegalStateException e) {
            // OK expected exception
        }
        UniverseContext universeContext = application.createEmptyUniverse();
        Universe universe = universeContext.getUniverse();
        // now there is a current universe, but still no current save file
        try {
            application.saveUniverse();
            fail("Should throw an IllegalStateException");
        } catch (IllegalStateException e) {
View Full Code Here


    }

    public void testOpen() throws OpenException, SaveException {
        // create a test file to be read
        BasicUniverseContextFactory factory = new BasicUniverseContextFactory();
        UniverseContext universeContext = factory.createRandom();
        UniverseContextIO io = new UniverseContextIO(saveFile);
        io.write(universeContext);
        // now try to read it
        UniverseContext universeContext2 = application.openUniverse(saveFile);
        assertEquals(universeContext.getState(), universeContext2.getState());
    }
View Full Code Here

            application.saveUniverse();
            fail("Should throw an IllegalStateException");
        } catch (IllegalStateException e) {
            // OK expected exception
        }
        UniverseContext universeContext = application.createEmptyUniverse();
        Universe universe = universeContext.getUniverse();
        // now there is a current universe, but still no current save file
        try {
            application.saveUniverse();
            fail("Should throw an IllegalStateException");
        } catch (IllegalStateException e) {
View Full Code Here

    }

    public void testOpen() throws OpenException, SaveException {
        // create a test file to be read
        BasicUniverseContextFactory factory = new BasicUniverseContextFactory();
        UniverseContext universeContext = factory.createRandom();
        UniverseContextIO io = new UniverseContextIO(saveFile);
        io.write(universeContext);
        // now try to read it
        UniverseContext universeContext2 = application.openUniverse(saveFile);
        assertEquals(universeContext.getState(), universeContext2.getState());
    }
View Full Code Here

        stopApp();
        application.createEmptyUniverse();
    }

    private void stopApp() {
        UniverseContext universeContext = application.getUniverseContext();
        if (universeContext != null) {
            MainSynchronizer synchronizer = universeContext.getSynchronizer();
            if (synchronizer.isRunning()) {
                synchronizer.stop();
            }
        }
    }
View Full Code Here

        stopApp();
        open();
    }

    private void stopApp() {
        UniverseContext universeContext = application.getUniverseContext();
        if (universeContext != null) {
            MainSynchronizer synchronizer = universeContext.getSynchronizer();
            if (synchronizer.isRunning()) {
                synchronizer.stop();
            }
        }
    }
View Full Code Here

        stopApp();
        application.createRandomUniverse();
    }

    private void stopApp() {
        UniverseContext universeContext = application.getUniverseContext();
        if (universeContext != null) {
            MainSynchronizer synchronizer = universeContext.getSynchronizer();
            if (synchronizer.isRunning()) {
                synchronizer.stop();
            }
        }
    }
View Full Code Here

TOP

Related Classes of barsuift.simLife.universe.UniverseContext

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.