summaryrefslogtreecommitdiff
path: root/src/playerinfo.h
diff options
context:
space:
mode:
authorJared Adams <jaxad0127@gmail.com>2010-08-01 21:32:16 -0600
committerJared Adams <jaxad0127@gmail.com>2010-08-01 21:35:09 -0600
commita3e61c0e830c46b51c0d135962ad361c02b93243 (patch)
tree3b94948be5750c8f968ea89723799eb4f119c063 /src/playerinfo.h
parent0e189bbe81c88283438aabb4fec3ba30920d3a36 (diff)
downloadmana-client-a3e61c0e830c46b51c0d135962ad361c02b93243.tar.gz
mana-client-a3e61c0e830c46b51c0d135962ad361c02b93243.tar.bz2
mana-client-a3e61c0e830c46b51c0d135962ad361c02b93243.tar.xz
mana-client-a3e61c0e830c46b51c0d135962ad361c02b93243.zip
Remove isActive methods from buy/sell windows
Uses a state variable in PlayerInfo instead. Moves isTalking from Being to PlayerInfo. Also some small cleanups. Reviewed-by: Chuck Miller
Diffstat (limited to 'src/playerinfo.h')
-rw-r--r--src/playerinfo.h46
1 files changed, 37 insertions, 9 deletions
diff --git a/src/playerinfo.h b/src/playerinfo.h
index 3214e64e..fabce6ea 100644
--- a/src/playerinfo.h
+++ b/src/playerinfo.h
@@ -66,6 +66,14 @@ class Equipment;
class Inventory;
class Item;
+enum BuySellState
+{
+ BUYSELL_NONE,
+ BUYSELL_CHOOSING,
+ BUYSELL_BUYING,
+ BUYSELL_SELLING
+};
+
/**
* Special information storage structure.
*/
@@ -168,6 +176,31 @@ namespace PlayerInfo
*/
Item *getEquipment(unsigned int slot);
+// -- Buy/Sell/Trade ----------------------------------------------------------
+
+ /**
+ * Returns true if the player is involved in a buy, sell, or related
+ * interaction, false otherwise.
+ */
+ BuySellState getBuySellState();
+
+ /**
+ * Sets whether the player is currently involved in a buy, sell, or related
+ * interaction.
+ */
+ void setBuySellState(BuySellState buySellState);
+
+ /**
+ * Returns true if the player is involved in a trade at the moment, false
+ * otherwise.
+ */
+ bool isTrading();
+
+ /**
+ * Sets whether the player is currently involved in trade or not.
+ */
+ void setTrading(bool trading);
+
// --- Specials ---------------------------------------------------------------
/**
@@ -188,20 +221,15 @@ namespace PlayerInfo
void setBackend(const PlayerInfoBackend &backend);
/**
- * Does necessary updates every tick.
- */
- void logic();
-
- /**
- * Returns true if the player is involved in a trade at the moment, false
+ * Returns true if the player is involved in a NPC interaction, false
* otherwise.
*/
- bool isTrading();
+ bool isTalking();
/**
- * Sets whether the player is currently involved in trade or not.
+ * Does necessary updates every tick.
*/
- void setTrading(bool trading);
+ void logic();
/**
* Initializes some internals.