mhframework
Class MHDataModel

java.lang.Object
  extended by mhframework.MHDataModel

public abstract class MHDataModel
extends java.lang.Object

A facade for game engine utilities in MHFramework. This class is currently being redesigned to behave more like an actual facade that simplifies the usage of these vital subsystems.

Old Documentation (Deprecated!)

This is the generic base class for managing game data. Due to the application-specific nature of a game's data model, this class must be extended and specialized in order to be used.

Subclasses of MHDataModel should:

Here is a primitive outline which may be used as a starting point for your customized data model. Note the private member INSTANCE, the private constructor, and the getInstance() method.


// BEGIN COPIED CODE ------------------------------------------------

import mhframework.*;
import java.awt.*;

public class MHDataModelTest extends MHDataModel
{
    private static MHDataModelTest INSTANCE = new MHDataModelTest();

    private MHDataModelTest()
    {
    }

    public static MHDataModel getInstance()
    {
        return INSTANCE;
    }
}

// END COPIED CODE --------------------------------------------------

Version:
1.0
Author:
Michael Henson

Constructor Summary
MHDataModel()
           
 
Method Summary
static MHMediaTracker getMediaTracker()
           
 MHMidiPlayer getMidiPlayer()
           
 MHSoundManager getSoundManager()
          Returns a reference to the sound manager.
static MHTileSetManager getTileSetManager()
          Returns a reference to the tile set manager.
 boolean isProgramOver()
          Determines whether the entire program has finished executing.
 java.awt.Image loadImage(java.lang.String filename)
           
 javax.sound.midi.Sequence loadMidiFile(java.lang.String filename)
           
 int loadSoundFile(java.lang.String filename)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MHDataModel

public MHDataModel()
Method Detail

getSoundManager

public MHSoundManager getSoundManager()
Returns a reference to the sound manager.

Returns:
A reference to the sound manager.

loadSoundFile

public int loadSoundFile(java.lang.String filename)

getTileSetManager

public static MHTileSetManager getTileSetManager()
Returns a reference to the tile set manager.

Returns:
A reference to the tile set manager.

isProgramOver

public boolean isProgramOver()
Determines whether the entire program has finished executing.

Returns:
The value of the "program over" flag.

loadImage

public java.awt.Image loadImage(java.lang.String filename)

getMidiPlayer

public MHMidiPlayer getMidiPlayer()
Returns:
the midiPlayer

loadMidiFile

public javax.sound.midi.Sequence loadMidiFile(java.lang.String filename)

getMediaTracker

public static MHMediaTracker getMediaTracker()