Android Open Source - androidtbsgame Scene Manager






From Project

Back to project page androidtbsgame.

License

The source code is released under:

MIT License

If you think the Android project androidtbsgame listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.

Java Source Code

package de.mmssb.androidtbsgame.andengine.managers;
/*from  w  w  w.j  a v  a  2 s  .  c  om*/
import org.andengine.entity.scene.Scene;

import de.mmssb.androidtbsgame.andengine.Model;
import de.mmssb.androidtbsgame.andengine.scenes.GameScene;

/**
 * @author Manu
 * 
 */
public class SceneManager extends Manager {
  public static enum SceneType {
    SPLASH, MENU, GAME
  }

  private SceneType actualSceneType;
  private GameScene gameScene;

  /**
   * Creates an instance of {@link SceneManager}
   * 
   * @param activity
   * @param engine
   * @param camera
   * @param resourceManager
   */
  public SceneManager(Model model) {
    super(model);
  }

  /**
   * Creates all Scenes. Call from SplashScene(!)
   */
  public void load() {
    gameScene = new GameScene(getModel());
  }

  /**
   * @return the actual selected {@link Scene}
   */
  public Scene getActualScene() {
    switch (actualSceneType) {
    case GAME:
      return gameScene;
    case MENU:
      return null;
    case SPLASH:
      return null;
    default:
      return null;
    }
  }

  public GameScene getGameScene() {
    return gameScene;
  }

  /**
   * Sets the actual {@link Scene}
   * 
   * @param actualSceneType
   *            the actualSceneType to set
   */
  public Scene setActualSceneType(SceneType actualSceneType) {
    this.actualSceneType = actualSceneType;
    Scene actualScene = getActualScene();
    if (actualScene != null) {
      getModel().getMainActivity().getEngine().setScene(actualScene);
    }
    return actualScene;
  }

  public SceneType getActualSceneType() {
    return actualSceneType;
  }

}




Java Source Code List

de.mmssb.androidtbsgame.andengine.BoardMap.java
de.mmssb.androidtbsgame.andengine.GameControl.java
de.mmssb.androidtbsgame.andengine.MainActivity.java
de.mmssb.androidtbsgame.andengine.Model.java
de.mmssb.androidtbsgame.andengine.entities.board.Board.java
de.mmssb.androidtbsgame.andengine.entities.board.Cell.java
de.mmssb.androidtbsgame.andengine.entities.board.Mark.java
de.mmssb.androidtbsgame.andengine.hud.ImageButtonSprite.java
de.mmssb.androidtbsgame.andengine.hud.ModelHUD.java
de.mmssb.androidtbsgame.andengine.managers.CellControl.java
de.mmssb.androidtbsgame.andengine.managers.Manager.java
de.mmssb.androidtbsgame.andengine.managers.ResourceManager.java
de.mmssb.androidtbsgame.andengine.managers.SceneManager.java
de.mmssb.androidtbsgame.andengine.managers.SharedPreferencesManager.java
de.mmssb.androidtbsgame.andengine.scenes.GameScene.java
de.mmssb.androidtbsgame.andengine.scenes.ModelScene.java
de.mmssb.androidtbsgame.andengine.units.AnimationProperties.java