diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-11-13 01:32:16 +0000 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2005-11-13 01:32:16 +0000 |
commit | a0081a3072230f1becbc0b1cf33572ab67a68d07 (patch) | |
tree | db86430217ebb7fcff7abbc93ece529032d71db0 /src/being.cpp | |
parent | e86de3e7ce09660e615792dba50af9de5d2d82c5 (diff) | |
download | manaserv-a0081a3072230f1becbc0b1cf33572ab67a68d07.tar.gz manaserv-a0081a3072230f1becbc0b1cf33572ab67a68d07.tar.bz2 manaserv-a0081a3072230f1becbc0b1cf33572ab67a68d07.tar.xz manaserv-a0081a3072230f1becbc0b1cf33572ab67a68d07.zip |
Nothing of much significance, mainly checking whether I can commit.
Diffstat (limited to 'src/being.cpp')
-rw-r--r-- | src/being.cpp | 25 |
1 files changed, 17 insertions, 8 deletions
diff --git a/src/being.cpp b/src/being.cpp index be0b312d..ce8462f3 100644 --- a/src/being.cpp +++ b/src/being.cpp @@ -273,7 +273,8 @@ Being::getRawStatistics(void) /** * Update the internal status. */ -void Being::update(void) +void +Being::update(void) { // computed stats. mStats.health = 20 + (20 * mRawStats.vitality); @@ -286,19 +287,22 @@ void Being::update(void) mNeedUpdate = false; } -void Being::setInventory(const std::vector<unsigned int> &inven) +void +Being::setInventory(const std::vector<unsigned int> &inven) { inventory = inven; } -bool Being::addInventory(unsigned int itemId) +bool +Being::addInventory(unsigned int itemId) { // If required weight could be tallied to see if player can pick up more. inventory.push_back(itemId); return true; } -bool Being::delInventory(unsigned int itemId) +bool +Being::delInventory(unsigned int itemId) { for (std::vector<unsigned int>::iterator i = inventory.begin(); i != inventory.end(); i++) { @@ -310,16 +314,20 @@ bool Being::delInventory(unsigned int itemId) return false; } -bool Being::hasItem(unsigned int itemId) { +bool +Being::hasItem(unsigned int itemId) +{ for (std::vector<unsigned int>::iterator i = inventory.begin(); - i != inventory.end(); i++) { + i != inventory.end(); i++) + { if (*i == itemId) return true; } return false; } -bool Being::equip(unsigned int itemId, unsigned char slot) +bool +Being::equip(unsigned int itemId, unsigned char slot) { // currently this is too simplistic and doesn't check enough // but until further functionality is implemented in the @@ -331,7 +339,8 @@ bool Being::equip(unsigned int itemId, unsigned char slot) return false; } -bool Being::unequip(unsigned char slot) +bool +Being::unequip(unsigned char slot) { // NOTE: 0 will be invalid item id (or we could use key/value pairs) equipment[slot] = 0; |