summaryrefslogtreecommitdiff
path: root/src/floor_item.cpp
diff options
context:
space:
mode:
authorBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-25 20:03:31 +0000
committerBjörn Steinbrink <B.Steinbrink@gmx.de>2005-08-25 20:03:31 +0000
commit9ba130f4628d8e52ebd50b810e761a81f69c0c4a (patch)
tree7493736309632e753f4f3aba1d001f14f9ad765f /src/floor_item.cpp
parent7cd9c0d02d148cdbacbca6624d8749a344ddbfe0 (diff)
downloadmana-9ba130f4628d8e52ebd50b810e761a81f69c0c4a.tar.gz
mana-9ba130f4628d8e52ebd50b810e761a81f69c0c4a.tar.bz2
mana-9ba130f4628d8e52ebd50b810e761a81f69c0c4a.tar.xz
mana-9ba130f4628d8e52ebd50b810e761a81f69c0c4a.zip
Move extern declaration of the floor item list. Lower indentation level.
Diffstat (limited to 'src/floor_item.cpp')
-rwxr-xr-xsrc/floor_item.cpp26
1 files changed, 17 insertions, 9 deletions
diff --git a/src/floor_item.cpp b/src/floor_item.cpp
index 486720e3..d7c597fe 100755
--- a/src/floor_item.cpp
+++ b/src/floor_item.cpp
@@ -23,9 +23,12 @@
#include "floor_item.h"
+#include <list>
+
std::list<FloorItem*> floorItems;
-void empty_floor_items() {
+void empty_floor_items()
+{
std::list<FloorItem *>::iterator i;
for (i = floorItems.begin(); i != floorItems.end(); i++) {
delete (*i);
@@ -33,11 +36,13 @@ void empty_floor_items() {
floorItems.clear();
}
-void add_floor_item(FloorItem *floorItem) {
+void add_floor_item(FloorItem *floorItem)
+{
floorItems.push_back(floorItem);
}
-void remove_floor_item(unsigned int int_id) {
+void remove_floor_item(unsigned int int_id)
+{
std::list<FloorItem *>::iterator i;
for (i = floorItems.begin(); i != floorItems.end(); i++) {
if ((*i)->int_id == int_id) {
@@ -48,7 +53,8 @@ void remove_floor_item(unsigned int int_id) {
}
}
-unsigned int find_floor_item_by_cor(unsigned short x, unsigned short y) {
+unsigned int find_floor_item_by_cor(unsigned short x, unsigned short y)
+{
std::list<FloorItem *>::iterator i;
for (i = floorItems.begin(); i != floorItems.end(); i++) {
FloorItem *floorItem = (*i);
@@ -60,7 +66,8 @@ unsigned int find_floor_item_by_cor(unsigned short x, unsigned short y) {
return 0;
}
-FloorItem *find_floor_item_by_id(unsigned int int_id) {
+FloorItem *find_floor_item_by_id(unsigned int int_id)
+{
std::list<FloorItem*>::iterator i;
for (i = floorItems.begin(); i != floorItems.end(); i++) {
FloorItem *floorItem = (*i);
@@ -71,10 +78,11 @@ FloorItem *find_floor_item_by_id(unsigned int int_id) {
return NULL;
}
-FloorItem::FloorItem() {
- id = 0; int_id = 0;
- x = 0; y = 0;
+FloorItem::FloorItem():
+ id(0), int_id(0), x(0), y(0)
+{
}
-FloorItem::~FloorItem() {
+FloorItem::~FloorItem()
+{
}