src/character/member.h

Go to the documentation of this file.
00001 /******************************************************************************
00002  *  Wormux is a convivial mass murder game.
00003  *  Copyright (C) 2001-2004 Lawrence Azzoug.
00004  *
00005  *  This program is free software; you can redistribute it and/or modify
00006  *  it under the terms of the GNU General Public License as published by
00007  *  the Free Software Foundation; either version 2 of the License, or
00008  *  (at your option) any later version.
00009  *
00010  *  This program is distributed in the hope that it will be useful,
00011  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  *  GNU General Public License for more details.
00014  *
00015  *  You should have received a copy of the GNU General Public License
00016  *  along with this program; if not, write to the Free Software
00017  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA
00018  ******************************************************************************
00019  *****************************************************************************/
00020 
00021 #ifndef MEMBER_H
00022 #define MEMBER_H
00023 #include <map>
00024 #include <vector>
00025 #include "body.h"
00026 #include "movement.h"
00027 #include "../graphic/sprite.h"
00028 #include "../tool/resource_manager.h"
00029 #include "../tool/point.h"
00030 #include "../tool/xml_document.h"
00031 
00032 typedef std::vector<Point2f> v_attached;
00033 
00034 class c_junction; //defined in body.h
00035 
00036 class Member
00037 {
00038   Member* parent;
00039   double angle_rad;
00040 protected:
00041   Point2f anchor;
00042 
00043 public:
00044   Sprite* spr;
00045 
00046   std::string name;
00047   std::map<std::string, v_attached> attached_members;
00048 
00049   Point2f pos;
00050   Point2f scale;
00051   float alpha;
00052   std::string type;
00053   bool go_through_ground;
00054 
00055   virtual ~Member();
00056   Member(xmlpp::Element *xml, Profile* res);
00057   Member(Member* m);
00058   virtual void Draw(const Point2i & _pos, int flip_x, int direction);
00059   void RotateSprite();
00060   void ResetMovement();
00061   void ApplySqueleton(Member* parent_member);
00062   void ApplyMovement(member_mvt& mvt, std::vector<class c_junction>& squel_lst);
00063   const Point2i GetPos();
00064   inline void SetAngle(const double &angle) { angle_rad = angle; };
00065 };
00066 
00067 class WeaponMember : public Member
00068 {
00069 public:
00070   WeaponMember();
00071   ~WeaponMember();
00072   void Draw(const Point2i & _pos, int flip_x, int direction);
00073 };
00074 
00075 #endif //MEMBER_H

Generated on Mon Jan 1 13:10:55 2007 for Wormux by  doxygen 1.4.7