Package org.jpacman.framework.controller

Examples of org.jpacman.framework.controller.RandomGhostMover


   * @throws FactoryException If required resources can't be loaded.
   * @return The main UI object.
   */
  public MainUI initializeNormalGame() throws FactoryException {
    initialize();
        withGhostController(new RandomGhostMover(getGame()));
        createUI();
        return this;
    }
View Full Code Here


  @Test
  public void testWithGhostController() throws FactoryException
    mainUI.initialize();
    assertNull(mainUI.getGhostController());
   
    IController ghostMover1 = new RandomGhostMover(mainUI.getGame());
    IController ghostMover2 = new RandomGhostMover(mainUI.getGame());
   
    //Below we apply forced pointer comparison to check the setter.
    mainUI.withGhostController(ghostMover1);
    assertSame(ghostMover1, mainUI.getGhostController());
   
View Full Code Here

   */
  @Test
  public void testChangeGhostControllerAfterUI() throws FactoryException {
      assumeTrue(MainUI.class.desiredAssertionStatus());
    mainUI.initialize();
    mainUI.withGhostController(new RandomGhostMover(mainUI.getGame()));
    mainUI.createUI();
   
    boolean gotException = false;
   
    //After creating the UI, the GhostController should not be allowed to be changed.
    //This should cause an assertion error.
        try {
            mainUI.withGhostController(new RandomGhostMover(mainUI.getGame()));   
        }
        catch (AssertionError ae) {
            gotException = true;
        }
        assertTrue(gotException);   
View Full Code Here

TOP

Related Classes of org.jpacman.framework.controller.RandomGhostMover

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.