diff options
author | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-02-26 22:22:22 +0100 |
---|---|---|
committer | Bjørn Lindeijer <bjorn@lindeijer.nl> | 2009-03-06 00:27:26 +0100 |
commit | c75511fffc77d517fbf854ec8bef791f055de44c (patch) | |
tree | c431846c7d7a6934f103d21129a20a0dc4fd1c8e /src/beingmanager.cpp | |
parent | 646cc317351d60e0fefcab789248310662fcbbc8 (diff) | |
download | mana-c75511fffc77d517fbf854ec8bef791f055de44c.tar.gz mana-c75511fffc77d517fbf854ec8bef791f055de44c.tar.bz2 mana-c75511fffc77d517fbf854ec8bef791f055de44c.tar.xz mana-c75511fffc77d517fbf854ec8bef791f055de44c.zip |
Got rid of Sint{8,16,32} and Uint32 for being ID
Using unsigned rarely makes sense, especially when the server doesn't
use it either. Other uses of unsigned should be reviewed.
In all other cases, int is the fastest integer type on any architecture.
Using 8 or 16 bits can basically only be a memory optimization.
Diffstat (limited to 'src/beingmanager.cpp')
-rw-r--r-- | src/beingmanager.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/beingmanager.cpp b/src/beingmanager.cpp index 15f683af..83e16f4c 100644 --- a/src/beingmanager.cpp +++ b/src/beingmanager.cpp @@ -67,7 +67,7 @@ void BeingManager::setPlayer(LocalPlayer *player) mBeings.push_back(player); } -Being* BeingManager::createBeing(Uint32 id, Uint16 job) +Being *BeingManager::createBeing(int id, Uint16 job) { Being *being; @@ -99,7 +99,7 @@ void BeingManager::destroyBeing(Being *being) delete being; } -Being* BeingManager::findBeing(Uint32 id) +Being *BeingManager::findBeing(int id) { for (BeingIterator i = mBeings.begin(); i != mBeings.end(); i++) { @@ -111,7 +111,7 @@ Being* BeingManager::findBeing(Uint32 id) return NULL; } -Being* BeingManager::findBeing(Uint16 x, Uint16 y, Being::Type type) +Being *BeingManager::findBeing(int x, int y, Being::Type type) { beingFinder.x = x; beingFinder.y = y; @@ -122,7 +122,7 @@ Being* BeingManager::findBeing(Uint16 x, Uint16 y, Being::Type type) return (i == mBeings.end()) ? NULL : *i; } -Being* BeingManager::findBeingByPixel(Uint16 x, Uint16 y) +Being *BeingManager::findBeingByPixel(int x, int y) { BeingIterator itr = mBeings.begin(); BeingIterator itr_end = mBeings.end(); @@ -148,7 +148,7 @@ Being* BeingManager::findBeingByPixel(Uint16 x, Uint16 y) return NULL; } -Being* BeingManager::findBeingByName(std::string name, Being::Type type) +Being *BeingManager::findBeingByName(std::string name, Being::Type type) { for (BeingIterator i = mBeings.begin(); i != mBeings.end(); i++) { @@ -161,7 +161,7 @@ Being* BeingManager::findBeingByName(std::string name, Being::Type type) return NULL; } -Beings& BeingManager::getAll() +Beings &BeingManager::getAll() { return mBeings; } @@ -202,7 +202,7 @@ void BeingManager::clear() } } -Being* BeingManager::findNearestLivingBeing(Uint16 x, Uint16 y, int maxdist, +Being *BeingManager::findNearestLivingBeing(int x, int y, int maxdist, Being::Type type) { Being *closestBeing = NULL; @@ -229,7 +229,7 @@ Being* BeingManager::findNearestLivingBeing(Uint16 x, Uint16 y, int maxdist, return (maxdist >= dist) ? closestBeing : NULL; } -Being* BeingManager::findNearestLivingBeing(Being *aroundBeing, int maxdist, +Being *BeingManager::findNearestLivingBeing(Being *aroundBeing, int maxdist, Being::Type type) { Being *closestBeing = NULL; |