home *** CD-ROM | disk | FTP | other *** search
/ Maximum CD 2009 February / maximum-cd-2009-02.iso / DiscContents / SMC_1.6_win32.exe / src / objects / levelexit.h < prev    next >
Encoding:
C/C++ Source or Header  |  2008-07-01  |  3.0 KB  |  103 lines

  1. /***************************************************************************
  2.  * levelexit.h  -  header for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2003 - 2008 Florian Richter
  5.  ***************************************************************************/
  6. /*
  7.    This program is free software; you can redistribute it and/or modify
  8.    it under the terms of the GNU General Public License as published by
  9.    the Free Software Foundation; either version 3 of the License, or
  10.    (at your option) any later version.
  11.    
  12.    You should have received a copy of the GNU General Public License
  13.    along with this program.  If not, see <http://www.gnu.org/licenses/>.
  14. */
  15.  
  16. #ifndef SMC_LEVELEXIT_H
  17. #define SMC_LEVELEXIT_H
  18.  
  19. #include "../core/globals.h"
  20. #include "../objects/objectsprite.h"
  21.  
  22. /* *** *** *** *** *** *** *** Level Exit types *** *** *** *** *** *** *** *** *** *** */
  23.  
  24. enum Level_Exit_type
  25. {
  26.     LEVELEXIT_BEAM        = 0,    // no animation ( f.e. a door )
  27.     LEVELEXIT_WARP        = 1        // player moves rotated slowly into the destination direction
  28. };
  29.  
  30. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  31.  
  32. /* Level exit
  33.  * if a level filename it's the destination
  34. */
  35. class cLevel_Exit : public cImageObjectSprite
  36. {
  37. public:
  38.     // constructor
  39.     cLevel_Exit( float x, float y );
  40.     // create from stream
  41.     cLevel_Exit( CEGUI::XMLAttributes &attributes );
  42.     // destructor
  43.     virtual ~cLevel_Exit( void );
  44.  
  45.     // init defaults
  46.     void Init( void );
  47.     // copy this sprite
  48.     virtual cLevel_Exit *Copy( void );
  49.  
  50.     // create from stream
  51.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  52.     // save to stream
  53.     virtual void Save_to_Stream( ofstream &file );
  54.     // Set direction
  55.     void Set_Direction( ObjectDirection dir );
  56.  
  57.     // draw
  58.     virtual void Draw( cSurfaceRequest *request = NULL );
  59.  
  60.     // Activate
  61.     void Activate( void );
  62.  
  63.     // Set the type
  64.     void Set_Type( Level_Exit_type ltype );
  65.  
  66.     // Set the destination level
  67.     void Set_Level( string filename );
  68.     // Return the destination level
  69.     string Get_Level( bool with_dir = 1, bool with_end = 1 );
  70.  
  71.     // Set the destination entry
  72.     void Set_Entry( string entry_name );
  73.  
  74.     // if draw is valid for the current state and position
  75.     virtual bool Is_Draw_Valid( void );
  76.  
  77.     // level editor activation
  78.     virtual void Editor_Activate( void );
  79.     // level editor events
  80.     bool Editor_Direction_Select( const CEGUI::EventArgs &event ); // editor direction option selected
  81.     bool Editor_Destination_Level_Key( const CEGUI::EventArgs &event );  // editor destination level key up
  82.     bool Editor_Destination_Entry_Key( const CEGUI::EventArgs &event );  // editor destination entry key up
  83.  
  84.     // level exit type
  85.     Level_Exit_type exit_type;
  86.     // destination level
  87.     string dest_level;
  88.     // destination entry ( only used if in same level )
  89.     string dest_entry;
  90.  
  91.     // editor type color
  92.     Color editor_color;
  93.     // editor entry name text
  94.     GL_Surface *editor_entry_name;
  95.  
  96. private:
  97.     void Create_Name( void );
  98. };
  99.  
  100. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  101.  
  102. #endif
  103.