summaryrefslogtreecommitdiff
path: root/src/gui/partywindow.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2009-03-29 20:35:19 -0600
committerJared Adams <jaxad0127@gmail.com>2009-03-29 20:36:58 -0600
commitbbf4d657e77fd39887b9941af1fe75a5ec27d988 (patch)
treed03c2973cff4d11e2eddbb856483369255ee40af /src/gui/partywindow.h
parent985e65f31b9cc06f13b733ddd5c7a9daa1331e21 (diff)
downloadmana-client-bbf4d657e77fd39887b9941af1fe75a5ec27d988.tar.gz
mana-client-bbf4d657e77fd39887b9941af1fe75a5ec27d988.tar.bz2
mana-client-bbf4d657e77fd39887b9941af1fe75a5ec27d988.tar.xz
mana-client-bbf4d657e77fd39887b9941af1fe75a5ec27d988.zip
Fix up eAthena party handling some more
Diffstat (limited to 'src/gui/partywindow.h')
-rw-r--r--src/gui/partywindow.h48
1 files changed, 41 insertions, 7 deletions
diff --git a/src/gui/partywindow.h b/src/gui/partywindow.h
index 64cfb582..049030e5 100644
--- a/src/gui/partywindow.h
+++ b/src/gui/partywindow.h
@@ -25,8 +25,10 @@
#include "window.h"
#include "confirm_dialog.h"
+#include "gui/widgets/avatar.h"
+
#include <string>
-#include <vector>
+#include <map>
#include <guichan/actionevent.hpp>
#include <guichan/actionlistener.hpp>
@@ -37,8 +39,13 @@
*/
struct PartyMember
{
+ int id;
std::string name;
- int vitality;
+ int health;
+ int healthMax;
+ bool leader;
+ bool online;
+ Avatar *avatar;
};
/**
@@ -65,14 +72,41 @@ class PartyWindow : public Window, gcn::ActionListener
void draw(gcn::Graphics *graphics);
/**
- * Add party member
+ * Find a party member based on ID
+ */
+ PartyMember *findMember(int id) { return mMembers[id]; }
+
+ /**
+ * Find a party member based on ID. Creates if it doesn't already exist.
+ */
+ PartyMember *findMember2(int id);
+
+ /**
+ * Returns the id of the first member found with the given name or -1
+ * if it isn't found.
+ */
+ int findMember(const std::string &name);
+
+ /**
+ * Update/add a party member
+ */
+ void updateMember(int id, const std::string &memberName,
+ bool leader = false, bool online = true);
+
+ /**
+ * Remove party member
+ */
+ void removeMember(int id);
+
+ /**
+ * Remove party member
*/
- void addPartyMember(const std::string &memberName);
+ void removeMember(const std::string &name);
/**
* Remove party member
*/
- void removePartyMember(const std::string &memberName);
+ void updateOnlne(int id, bool online);
/**
* Show party invite
@@ -86,8 +120,8 @@ class PartyWindow : public Window, gcn::ActionListener
void action(const gcn::ActionEvent &event);
private:
- typedef std::vector<PartyMember> PartyList;
- PartyList mPartyMembers;
+ typedef std::map<int, PartyMember*> PartyList;
+ PartyList mMembers;
std::string mPartyInviter;
ConfirmDialog *acceptDialog;
};