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

  1. /***************************************************************************
  2.  * level_entry.h  -  header for the corresponding cpp file
  3.  *
  4.  * Copyright (C) 2007 - 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_LEVEL_ENTRY_H
  17. #define SMC_LEVEL_ENTRY_H
  18.  
  19. #include "../core/globals.h"
  20. #include "../objects/objectsprite.h"
  21.  
  22. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  23.  
  24. /* Level Entry
  25.  * 
  26. */
  27. class cLevel_Entry : public cImageObjectSprite
  28. {
  29. public:
  30.     // constructor
  31.     cLevel_Entry( float x, float y );
  32.     // create from stream
  33.     cLevel_Entry( CEGUI::XMLAttributes &attributes );
  34.     // destructor
  35.     virtual ~cLevel_Entry( void );
  36.  
  37.     // init defaults
  38.     void Init( void );
  39.     // copy this sprite
  40.     virtual cLevel_Entry *Copy( void );
  41.  
  42.     // create from stream
  43.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  44.     // save to stream
  45.     virtual void Save_to_Stream( ofstream &file );
  46.     // Set direction
  47.     void Set_Direction( ObjectDirection dir );
  48.  
  49.     // draw
  50.     virtual void Draw( cSurfaceRequest *request = NULL );
  51.  
  52.     // Get centered player position y
  53.     float Get_Player_Pos_X( void );
  54.     // Get centered player position y
  55.     float Get_Player_Pos_Y( void );
  56.  
  57.     // Activate
  58.     void Activate( void );
  59.  
  60.     // Set the name
  61.     void Set_Name( string str_name );
  62.  
  63.     // if draw is valid for the current state and position
  64.     virtual bool Is_Draw_Valid( void );
  65.  
  66.     // level editor activation
  67.     virtual void Editor_Activate( void );
  68.     // level editor events
  69.     bool Editor_Direction_Select( const CEGUI::EventArgs &event ); // editor direction option selected
  70.     bool Editor_Name_Key( const CEGUI::EventArgs &event );  // editor name key up
  71.  
  72.     // identification name
  73.     string entry_name;
  74.  
  75.     // editor type color
  76.     Color editor_color;
  77.     // editor entry name text
  78.     GL_Surface *editor_entry_name;
  79.  
  80. private:
  81.     void Create_Name( void );
  82. };
  83.  
  84. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  85.  
  86. #endif
  87.