ice.game - ICE 0.1 API documentation

ICE 0.1 API documentation

# ice.game

Game class.

class GameStartException: object.Exception;

  Thrown when the game fails to start.

struct GameSubsystems;

  Provided by Game to allow access its subsystems.

  Passed to classes that need access to many game subsystems but shouldn't be able to e.g. update the game state.

  pure nothrow @property GameGUI gui();

    Get a reference to the game GUI.

  pure nothrow @property VideoDriver videoDriver();

    Get a reference to the video driver used to draw the game.

  const pure nothrow @property const(GameTime) gameTime();

    Get a const reference to the game time subsystem.

  pure nothrow @property VFSDir gameDir();

    Get the game data directory.

  pure nothrow @property GraphicsEffectManager effectManager();

    Get a reference to the graphics effect manager.

  pure nothrow @property SoundSystem sound();

    Get a reference to the sound system.

  const nothrow @property Rectf gameArea();

    Get the game area.

  pure nothrow @property EntitySystem entitySystem();

    Get a reference to the entity system (e.g. to add new entities).

struct GameOverData;

  Stores various data about the end of a game.

  StatisticsComponent playerStatistics;

    Statistics of the player.

  bool gameWon;

    Did the player win the game?

  real totalTime;

    Total time taken by the game, in game time seconds (i.e. not measuring pauses).

class Game;

  Class managing a single game in a level.

  enum PlayerState;

    Possible states of the player ship.

    PreSpawn

      THe player ship has not been spawned yet.

    Alive

      The player ship exists.

    Dead

      The player ship has died.

  enum GamePhase;

    Game phases.

    Playing

      Gameplay phase.

    PreOver

      Phase during the game over effect, before the score screen shows up.

    Over

      Game over - we're not playing but we still aren't out of the game (e.g. score screen).

  bool run();

    Update the game.

    Returns:
    true if the game should continue to run, false otherwise.
  pure nothrow @property void videoDriver(VideoDriver rhs);

    Set the VideoDriver used to draw game.

  static nothrow @property Rectf gameArea();

    Get game area.

class GameContainer;

  Container managing dependencies and construction of Game.

  this(GUISystem guiSystem, SoundSystem sound);

    Produce a GameContainer with dependencies that never change between game instances.

    Parameters:

    GUISystem guiSystem | A reference to the GUI system.
    SoundSystem sound | A reference to the sound system.

  Game produce(Platform platform, MonitorManager monitor, GUISwapper guiSwapper, VideoDriver videoDriver, VFSDir gameDir, ResourceManager!(Node) yamlManager, PlayerProfile profile, ref YAMLNode levelSource);

    Produce a Game and return a reference to it.

    Parameters:

    Platform platform | Platform to use for user input.
    MonitorManager monitor | MonitorManager to monitor game subsystems.
    GUISwapper guiSwapper | A reference to the GUI swapper.
    VideoDriver videoDriver | Video driver to draw graphics with.
    VFSDir gameDir | Game data directory.
    PlayerProfile profile | Profile of the current player.
    YAMLNode levelSource | YAML source of the level to load.

    Returns:
    Produced Game.
    Throws:
    GameStartException if the game fails to start.
  void destroy();

    Destroy the contained Game.

Copyright © Ferdinand Majerech 2011. | Page generated by AutoDDoc and Ddoc.