#include <scenario.h>
Collaboration diagram for Scenario:

Public Member Functions | |
| Scenario () | |
| Creates a new scenario. To load a specific map, use loadMap(mapname). | |
| Hit | checkPlace (const SDL_Rect &src, const SDL_Rect &dest) const |
| std::set< Character * > | getCharactersIn (Uint16 mask, const SDL_Rect &rect, bool touch=false, Uint16 radius=0, Uint16 dir=DIR_ALL) const |
| std::set< Object * > | getObjectsIn (Uint16 mask, const SDL_Rect &rect, bool touch=false, Uint16 radius=0, Uint16 dir=DIR_ALL) const |
| Object * | getObjectAt (Sint16 x, Sint16 y, Uint16 mask=ALL) const |
| Returns the first found object at the given position. | |
| Uint16 | getDirection (const SDL_Rect &src, const SDL_Rect &dest) const |
| int | loadScenario (string scenarioname) |
| Load a new scenario. | |
| void | newMap (const ParameterMap &bg_parameters) |
| Create a new empty map with the specified background. | |
| int | loadMapBuf (string mapname) |
| Used to load the map file into a buffer. | |
| int | reloadMap () |
| Reload the map file using the buffered map file. | |
| int | loadMap (string mapname) |
| Loads and initializes the map data. | |
| int | loadMap (Uint8 level=0) |
| void | loadNextMap () |
| int | startScenario () |
| void | winScenario () |
| void | resetScenario () |
Public Attributes | |
| Background * | background |
| Background. | |
| SDL_Rect * | area |
| Size of the background (map area). | |
| Player * | player |
| Current player. | |
| ImageCache * | imgcache |
| Image Cache. | |
| SoundCache * | sndcache |
| Sound Cache. | |
| ObjectsPool * | pool |
| Object pool. | |
| PhysicHandler * | physic |
| Physic Handler. | |
| bool | failed |
| True if the mission failed. | |
| bool | finnished |
| True if the mission is finnished (suceeded or failed). | |
| string | mapname |
| Name of the current map file. | |
| string | scenarioname |
| Name of the scenario. | |
| string | bgimage |
| Name of the map background image. | |
| std::vector< string > | mapbuf |
| Uint32 | max_obj_num |
| The number of created objects. | |
| std::vector< string > | maps |
| std::vector< string > | playlist |
| Uint8 | currentmap |
Loads the corresponding map data (objects) and performs location checks.
HeaderOption "parameters"
Background "parameters"
#ENDHEADER
"Object class name" "x position" "y position" "parameters"
The parameters depend on the object: Each object checks it's corresponding parameters.
The parameter format is like this:
option1=value1,option2=value2,...
A value may be a parameterlist of suboptions:
option1=subopt1=subval1:subopt2=subval2:...,option2=value2
Defaults:
x and y default to 0
Example:
Background image=background.bmp
#ENDHEADER
Teleporter 0 0 image=teleporter.bmp,exitx=20,exity=100,name=teleporter1
|
||||||||||||
|
Checks where the source rectangle overlaps the destination rectangle.
|
|
||||||||||||||||||||||||
|
|
|
||||||||||||
|
Returns the directions from the source rectangle to the destination rectangle
|
|
|
Loads and initializes the map data. Parses the map file and tries to add the objects by using addObjectByName()
|
1.3.8