#include <theme.h>
Public Types | |
| enum | ImageType { LEFT_KEEPER_ON_FLOOR, RIGHT_KEEPER_ON_FLOOR, UP_KEEPER_ON_FLOOR, DOWN_KEEPER_ON_FLOOR, LEFT_KEPPER_ON_DEAD_FLOOR, RIGHT_KEPPER_ON_DEAD_FLOOR, UP_KEPPER_ON_DEAD_FLOOR, DOWN_KEPPER_ON_DEAD_FLOOR, LEFT_KEEPER_ON_GOAL, RIGHT_KEEPER_ON_GOAL, UP_KEEPER_ON_GOAL, DOWN_KEEPER_ON_GOAL, LEFT_MOVING_KEEPER, RIGHT_MOVING_KEEPER, DOWN_MOVING_KEEPER, UP_MOVING_KEEPER, LEFT_VIRTUAL_KEEPER, RIGHT_VIRTUAL_KEEPER, UP_VIRTUAL_KEEPER, DOWN_VIRTUAL_KEEPER, GEM_ON_FLOOR, GEM_ON_DEAD_FLOOR, GEM_ON_GOAL, MOVING_GEM, EMPTY_FLOOR, EMPTY_DEAD_FLOOR, EMPTY_GOAL, LEFT_ARROW, RIGHT_ARROW, UP_ARROW, DOWN_ARROW, WALL, OUTSIDE } |
Public Methods | |
| Theme (QDomElement const &dom_element) | |
| bool | hideGems () const |
| void | setHideGems (bool hide) |
| bool | hideGoals () const |
| void | setHideGoals (bool hide) |
| bool | outsideAsWall () const |
| void | setOutsideAsWall (bool outside_as_wall) |
| QString const & | name () const |
| QString const & | backgroundImage () const |
| QColor | backgroundColor () const |
| std::vector< int > const & | imageIndices (ImageType type, QPoint const &position, Map const &map) const |
| std::vector< int > const & | imageIndicesFromPosition (int direction, QPoint const &position, Map const &map) const |
| PieceImage const & | pieceImage (int index) const |
| int | nrOfPieceImages () const |
| double | upperBorder () const |
| double | lowerBorder () const |
| double | leftBorder () const |
| double | rightBorder () const |
Private Methods | |
| void | addAlternates (QDomElement const &dom_element) |
| void | addPieceImageAlternates (QDomElement const &dom_element) |
| void | addWallPieceAlternates (QDomElement const &dom_element) |
| void | addAlternatesImages (QDomElement const &dom_element) |
| int | patternForPieceImage (QDomElement const &dom_element, QString const &name) |
| int | patternForWallPiece (QDomElement const &dom_element, QString const &name) |
| int | getNonWallPattern (QPoint const &position, Map const &map) const |
| int | getWallPattern (QPoint const &position, Map const &map) const |
Private Attributes | |
| QString | m_name |
| double | m_upper_border |
| double | m_lower_border |
| double | m_left_border |
| double | m_right_border |
| QColor | m_background_color |
| QString | m_background_image |
| std::vector< int > | m_alternate_starts |
| std::vector< int > | m_alternate_sizes |
| std::vector< int > | m_alternative_piece_image_starts |
| std::vector< int > | m_alternative_piece_image_nr |
| std::vector< int > | m_patterns |
| std::vector< int > | m_piece_image_indices |
| std::vector< PieceImage > | m_piece_images |
| bool | m_hide_gems |
| bool | m_hide_goals |
| bool | m_outside_as_wall |
Static Private Attributes | |
| char const * | s_elements [33] |
| char const * | s_short_elements [33] |
| int const | s_types_for_hidden_gems [33] |
| int const | s_types_for_hidden_goals [33] |
|
|
|
Creates a theme from an dom element.
|
|
|
Adds the alternates of an image type.
|
|
|
Addes the alternates piece images of the dom element.
|
|
|
Adds piece image alternates.
|
|
|
Adds wall piece alternates.
|
|
|
Returns the background color, which will be used if we don't have a background image or it could not be loaded.
|
|
|
Returns the name background image or an empty string if we dont use one.
|
|
|||||||||||||||
|
Returns the pattern for a non wall piece at the given position in the map. @pattern position The position of the image. @pattern map The map to use. |
|
|||||||||||||||
|
Returns the pattern for a wall piece at the given position in the map. @pattern position The position of the image. @pattern map The map to use. |
|
|
Returns true, if we hide the gems.
|
|
|
Returns true, if we hide the goals.
|
|
||||||||||||||||||||||
|
Returns the indices of the images requested.
|
|
||||||||||||||||||||||
|
Returns the indices of the images of the piece at the given position.
|
|
|
Return the left border given relative to the field size.
|
|
|
Returns the lower border given relative to the field size.
|
|
|
Returns the name of the theme.
|
|
|
Returns the number of piece images.
|
|
|
Returns true if outside fields are treated as wall.
|
|
|||||||||||||||
|
Returns the pattern value for the given attribute of the dom element for piece images.
|
|
|||||||||||||||
|
Returns the pattern value for the given attribute of the dom element for wall pieces.
|
|
|
Returns the piece image with the given index.
|
|
|
Returns the right border given relative to the field size.
|
|
|
Hides all gems.
|
|
|
Hides all goals.
|
|
|
Sets if outside fields are treated as wall.
|
|
|
Returns the upper border given relative to the field size.
|
|
|
The number of alternates for the image types.
|
|
|
The start index of the image type in the alternates.
|
|
|
The number of alternative piece images for the alternates.
|
|
|
The start index of alternative piece images for the alternates.
|
|
|
The background color to use.
|
|
|
The background image to use.
|
|
|
If true, all gems are hidden.
|
|
|
If true, all goals are hidden.
|
|
|
The left border.
|
|
|
The lower border.
|
|
|
The name of the theme.
|
|
|
If true, outside fields are treated as wall.
|
|
|
The alternates patterns.
|
|
|
Points to the piece indices.
|
|
|
The piece images.
|
|
|
The right border.
|
|
|
The upper border.
|
|
|
Here we store the names of the elements of the root element of the theme file.
|
|
|
Here we store the alternative short names of the elements of the root element of the theme file.
|
|
|
The translation table if we don't show gems.
|
|
|
The translation table if we don't show goals.
|
1.2.9.1 written by Dimitri van Heesch,
© 1997-2001