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

  1. /***************************************************************************
  2.  * static.h  -  headers 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_STATIC_ENEMY_H
  17. #define SMC_STATIC_ENEMY_H
  18.  
  19. #include "../enemies/enemy.h"
  20.  
  21. /* *** *** *** *** *** *** cStaticEnemy *** *** *** *** *** *** *** *** *** *** *** */
  22.  
  23. class cStaticEnemy : public cEnemy 
  24. {
  25. /* Static enemies don't move but will
  26.  * hit you if you touch them.
  27.  */
  28. public:
  29.     // constructor
  30.     cStaticEnemy( float x, float y );
  31.     // create from stream
  32.     cStaticEnemy( CEGUI::XMLAttributes &attributes );
  33.     // destructor
  34.     virtual ~cStaticEnemy( void );
  35.  
  36.     // init defaults
  37.     void Init( void );
  38.     // copy
  39.     virtual cStaticEnemy *Copy( void );
  40.  
  41.     // create from stream
  42.     virtual void Create_from_Stream( CEGUI::XMLAttributes &attributes );
  43.     // save to stream
  44.     virtual void Save_to_Stream( ofstream &file );
  45.  
  46.     // Set the static image
  47.     void Set_Static_Image( string filename );
  48.     // Set the rotation speed
  49.     void Set_Rotation_Speed( float speed );
  50.  
  51.     /* downgrade state ( if already weakest state : dies )
  52.      * force : usually dies or a complete downgrade
  53.     */
  54.     virtual void DownGrade( bool force = 0 );
  55.     virtual void DieStep( void );
  56.  
  57.     // update
  58.     virtual void Update( void );
  59.  
  60.     // if update is valid for the current state
  61.     virtual bool Is_Update_Valid( void );
  62.  
  63.     // ignore onground check
  64.     virtual void Check_on_Ground( void ) {};
  65.     /* Validate the given collision object
  66.      * returns 1 if an internal collision with this object is valid
  67.      * returns 2 if the given object collides with this object (blocking)
  68.     */
  69.     virtual unsigned int Validate_Collision( cSprite *obj );
  70.     // collision from player
  71.     virtual void Handle_Collision_Player( cObjectCollision *collision );
  72.     // collision from an enemy
  73.     virtual void Handle_Collision_Enemy( cObjectCollision *collision );
  74.  
  75.     // leveleditor activation
  76.     virtual void Editor_Activate( void );
  77.     // leveleditor events
  78.     bool Editor_Image_Key( const CEGUI::EventArgs &event );  // editor image key up
  79.     bool Editor_Rotation_Speed_Key( const CEGUI::EventArgs &event );  // editor rotation speed key up
  80.  
  81.     // image filename
  82.     string img_filename;
  83.     // rotation speed
  84.     float rotation_speed;
  85.  
  86. private:
  87.     // Create the Name from the current settings
  88.     void Create_Name( void );
  89. };
  90.  
  91. /* *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** *** */
  92.  
  93. #endif
  94.