IImageEngine

The interface of the image engine.  The IImageEngine stores all of the information provided by all of the ImageSets in the loaded RuleSets.  It groups the ImageSets by their keys and provides mechanisms for reading one an image out of an image set with a key/name combination, or reading all images for a given key.  A separate function that reads images out of a .tex file is also provided.  The IImageEngine is accessible through the GameEngine.

Project

RulesCore

Include

IImageEngine.h

Summary
The interface of the image engine.
Returns a single image based on the key/name combination.
Fills an array with all images belonging to a given key.
Reads images from a .tex file.
The IImageEngine destructor.

Public

Summary
Returns a single image based on the key/name combination.
Fills an array with all images belonging to a given key.
Reads images from a .tex file.

Pure Virtual Functions

GetImage

virtual wxImage &GetImage(const wxString &key, 
const wxString &name, 
const wxSize &size = wxDefaultSize) const=0

Returns a single image based on the key/name combination.  The image is scaled to the given size, if any.

Parameters

keyThe image group key to search in.
nameThe image name to look up.
sizeThe size of the outgoing image.

Returns

The image.  May be an empty image if the image was not based on the given key and name.

GetAllImages

virtual void GetAllImages(const wxString &key,
ImagePairArray &array)=0

Fills an array with all images belonging to a given key.  The array is filled with std::pair<wxString, wxImage> combinations The string is the name of the image, and the wxImage is the image itself.

Parameters

keyThe image group key of the images to retrieve.
arrayThe outgoing array of string/image pairs.

ReadImages

virtual void ReadImages(const wxInt32 size,
wxImage pList[],
const wxString &filename) const=0

Reads images from a .tex file.

Parameters

sizeThe number of images in the .tex file.
pListA pointer to an array of images.  Must be size in length.
filenameThe name of the .tex file to load.

Protected

Summary
The IImageEngine destructor.

Destructor

~IImageEngine

virtual ~IImageEngine()=0

The IImageEngine destructor.  It is pure virtual because this class must be derived from in order to be used.

virtual wxImage &GetImage(const wxString &key, 
const wxString &name, 
const wxSize &size = wxDefaultSize) const=0
Returns a single image based on the key/name combination.
virtual void GetAllImages(const wxString &key,
ImagePairArray &array)=0
Fills an array with all images belonging to a given key.
virtual void ReadImages(const wxInt32 size,
wxImage pList[],
const wxString &filename) const=0
Reads images from a .tex file.
virtual ~IImageEngine()=0
The IImageEngine destructor.
A repository of knowledge about a .tex file.
A repository of all things rules-related.
The interface of the image engine.
The engine that drives the game.
RulesCore is the HOSS of Cities3D.