party.h

Go to the documentation of this file.
00001 
00006 /*  Copyright (C) 2000-2003  The Exult Team
00007  *
00008  *  This program is free software; you can redistribute it and/or modify
00009  *  it under the terms of the GNU General Public License as published by
00010  *  the Free Software Foundation; either version 2 of the License, or
00011  *  (at your option) any later version.
00012  *
00013  *  This program is distributed in the hope that it will be useful,
00014  *  but WITHOUT ANY WARRANTY; without even the implied warranty of
00015  *  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00016  *  GNU General Public License for more details.
00017  *
00018  *  You should have received a copy of the GNU General Public License
00019  *  along with this program; if not, write to the Free Software
00020  *  Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
00021  */
00022 
00023 #ifndef INCL_PARTY_H
00024 #define INCL_PARTY_H 1
00025 
00026 #include "singles.h"
00027 #include "tiles.h"
00028 
00029 class Actor;
00030 
00031 #define EXULT_PARTY_MAX 8
00032 
00033 /*
00034  *  Manage the party.
00035  */
00036 class Party_manager : public Game_singletons
00037   {
00038   int party[EXULT_PARTY_MAX]; // NPC #'s of party members.
00039   int party_count;    // # of NPC's in party.
00040   int dead_party[16];   // NPC #'s of dead party members.
00041   int dead_party_count;
00042   Actor *valid[EXULT_PARTY_MAX];  // NPC's able to walk with Avatar.
00043   int validcnt;
00044           // Formation-walking:
00045   void move_followers(Actor *npc, int vindex, int dir);
00046   int step(Actor *npc, Actor *leader, int dir, Tile_coord dest);
00047 public:
00048   Party_manager();
00049   void set_count(int n)   // For initializing from file.
00050     { party_count = n; }
00051   void set_member(int i, int npcnum)
00052     { party[i] = npcnum; }
00053   int get_count()     // Get # party members.
00054     { return party_count; }
00055   int get_member(int i)   // Get npc# of i'th party member.
00056     { return party[i]; }
00057   int get_dead_count()    // Same for dead party members.
00058     { return dead_party_count; }
00059   int get_dead_member(int i)
00060     { return dead_party[i]; }
00061           // Add/remove party member.
00062   bool add_to_party(Actor *npc);
00063   bool remove_from_party(Actor *npc);
00064   int in_dead_party(Actor *npc);
00065   bool add_to_dead_party(Actor *npc);
00066   bool remove_from_dead_party(Actor *npc);
00067           // Update status of NPC that died or
00068           //   was resurrected.
00069   void update_party_status(Actor *npc);
00070   void link_party();    // Set party's id's.
00071           // Formation-walking:
00072   void get_followers(int dir);
00073   };
00074 
00075 
00076 #endif

Generated on Mon Jul 9 14:42:49 2007 for ExultEngine by  doxygen 1.5.1