@Test public void testAddScreen1 () { ScreenManager<IScreen> manager = this.createScreenManager(); manager.addScreen("dummy_screen", new OtherDummyScreen()); }
@Override public void addScreen(String name, IScreen screen) { if (name == null) { throw new NullPointerException(TAG_NAME_CANNOT_NULL); } if (name.isEmpty()) { throw new IllegalArgumentException(TAG_NAME_CANNOT_EMPTY); } if (screen == null) { throw new NullPointerException("screen cannot be null."); } if (this.screens.get(name) != null) { throw new IllegalStateException("screen '" + name + "' already exists!"); } screen.onStart(this); this.screens.put(name, screen); this.cachedScreenList.add(screen); Gdx.app.debug(TAG_SCREENS, "add screen: " + name); }
DefaultScreenManager implements ScreenManager<IScreen> { @Override public void addScreen(String name, IScreen screen) { if (name == null) { throw new NullPointerException(TAG_NAME_CANNOT_NULL); } if (name.isEmpty()) { throw new IllegalArgumentException(TAG_NAME_CANNOT_EMPTY); } if (screen == null) { throw new NullPointerException("screen cannot be null."); } if (this.screens.get(name) != null) { throw new IllegalStateException("screen '" + name + "' already exists!"); } screen.onStart(this); this.screens.put(name, screen); this.cachedScreenList.add(screen); Gdx.app.debug(TAG_SCREENS, "add screen: " + name); } }
DefaultScreenManager implements ScreenManager<IScreen> { @Override public void addScreen(String name, IScreen screen) { if (name == null) { throw new NullPointerException(TAG_NAME_CANNOT_NULL); } if (name.isEmpty()) { throw new IllegalArgumentException(TAG_NAME_CANNOT_EMPTY); } if (screen == null) { throw new NullPointerException("screen cannot be null."); } if (this.screens.get(name) != null) { throw new IllegalStateException("screen '" + name + "' already exists!"); } screen.onStart(this); this.screens.put(name, screen); this.cachedScreenList.add(screen); Gdx.app.debug(TAG_SCREENS, "add screen: " + name); } DefaultScreenManager(); }
DefaultScreenManager implements ScreenManager<IScreen> { @Override public void addScreen(String name, IScreen screen) { if (name == null) { throw new NullPointerException(TAG_NAME_CANNOT_NULL); } if (name.isEmpty()) { throw new IllegalArgumentException(TAG_NAME_CANNOT_EMPTY); } if (screen == null) { throw new NullPointerException("screen cannot be null."); } if (this.screens.get(name) != null) { throw new IllegalStateException("screen '" + name + "' already exists!"); } screen.onStart(this); this.screens.put(name, screen); this.cachedScreenList.add(screen); Gdx.app.debug(TAG_SCREENS, "add screen: " + name); } DefaultScreenManager(); @Override void addScreen(String name, IScreen screen); @Override void removeScreen(String name); @Override void push(String name); @Override void leaveAllAndEnter(String name); @Override IScreen pop(); @Override IScreen getScreenByName(String name); @Override ObjectArrayList<IScreen> listScreens(); @Override ObjectArrayList<IScreen> listActiveScreens(); @Override void resize(int width, int height); @Override void update(); @Override void draw(); @Override void dispose(); }
DefaultScreenManager implements ScreenManager<IScreen> { @Override public void addScreen(String name, IScreen screen) { if (name == null) { throw new NullPointerException(TAG_NAME_CANNOT_NULL); } if (name.isEmpty()) { throw new IllegalArgumentException(TAG_NAME_CANNOT_EMPTY); } if (screen == null) { throw new NullPointerException("screen cannot be null."); } if (this.screens.get(name) != null) { throw new IllegalStateException("screen '" + name + "' already exists!"); } screen.onStart(this); this.screens.put(name, screen); this.cachedScreenList.add(screen); Gdx.app.debug(TAG_SCREENS, "add screen: " + name); } DefaultScreenManager(); @Override void addScreen(String name, IScreen screen); @Override void removeScreen(String name); @Override void push(String name); @Override void leaveAllAndEnter(String name); @Override IScreen pop(); @Override IScreen getScreenByName(String name); @Override ObjectArrayList<IScreen> listScreens(); @Override ObjectArrayList<IScreen> listActiveScreens(); @Override void resize(int width, int height); @Override void update(); @Override void draw(); @Override void dispose();  }