Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | File List | Namespace Members | Class Members | File Members | Related Pages

objects.h

Go to the documentation of this file.
00001 
00005 /***************************************************************************
00006                           gamemap.h  -  description
00007                              -------------------
00008     begin                : Tue Feb 17 2001
00009     copyright            : (C) 2001 by Martin Bickel
00010     email                : bickel@asc-hq.org
00011  ***************************************************************************/
00012 
00013 /***************************************************************************
00014  *                                                                         *
00015  *   This program is free software; you can redistribute it and/or modify  *
00016  *   it under the terms of the GNU General Public License as published by  *
00017  *   the Free Software Foundation; either version 2 of the License, or     *
00018  *   (at your option) any later version.                                   *
00019  *                                                                         *
00020  ***************************************************************************/
00021 
00022 
00023 #ifndef objectsH
00024  #define objectsH
00025 
00026  #include <vector>
00027 
00028  #include "typen.h"
00029  #include "mapitemtype.h"
00030  #include "overviewmapimage.h"
00031  #include "graphics/surface.h"
00032  
00033  class ObjectType;
00034 
00035 class AgeableItem {
00036     protected:
00037        AgeableItem() : lifetimer(-1) {};
00038     public:
00039        int lifetimer;
00040 
00042        static bool age( AgeableItem& obj );
00043 };
00044 
00046 class Object : public AgeableItem {
00047     public:
00048        const ObjectType* typ;
00049        int damage;
00050        int dir;
00051        int remainingGrowthTime;
00052        
00053        Object ();
00054        Object ( const ObjectType* o );
00055        void display ( Surface& surface, const SPoint& pos, int weather = 0 ) const;
00056        const OverviewMapImage* getOverviewMapImage( int weather );
00057        void setdir ( int dir );
00058        int  getdir ( void );
00059 
00060 };
00061 
00062 const int cminenum = 4;
00063 extern const char* MineNames[cminenum] ;
00064 extern const int MineBasePunch[cminenum]  ;
00065 
00066 enum MineTypes { cmantipersonnelmine = 1 , cmantitankmine, cmmooredmine, cmfloatmine  };
00067 
00068 class MineType : public MapItemType {
00069       MineTypes type;
00070    public:
00071       int id;
00072 
00074       vector<int> secondaryIDs;
00075 
00076       ASCString name;
00077       ASCString location;
00078       
00079       int getID() const { return id; }; 
00080       
00081       MineType( MineTypes t ) : type ( t ), id( int(t)) {};
00082       MineType( const MineType& w ) : type ( w.type ) {};
00083       ASCString getName() const {
00084          return MineNames[int(type)-1];
00085       };
00086       
00087       void paint ( Surface& surface, const SPoint& pos ) const ;
00088       static void paint( MineTypes type, int player, Surface& surf, const SPoint& pos );
00089 };
00090 
00091 #endif
00092 

Generated on Tue Jun 24 01:27:46 2008 for Advanced Strategic Command by  doxygen 1.4.2