Steam Fort 0.5

src/item.hpp

Go to the documentation of this file.
00001 /*********************************************************************
00002  * Copyright 2011 Bartek thindil Jasicki
00003  *
00004  *  This file is part of Steam Fort.
00005  *
00006  *  Steam Fort is free software: you can redistribute it and/or modify
00007  * it under the terms of the GNU General Public License as published by
00008  * the Free Software Foundation, either version 3 of the License, or
00009  * (at your option) any later version.
00010  *
00011  * Steam Fort is distributed in the hope that it will be useful,
00012  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00013  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00014  * GNU General Public License for more details.
00015  *
00016  * You should have received a copy of the GNU General Public License
00017  * along with Steam Fort.  If not, see <http://www.gnu.org/licenses/>.
00018 *********************************************************************/
00019 #ifndef ITEM_HPP
00020 #define ITEM_HPP
00021 #include <string>
00022 #include "libtcod.hpp"
00023 
00027 typedef enum ItemTypes
00028   {
00029     TREE,
00030     ROCK,
00031     STONE,
00032     WOOD,
00033     RESOURCE,
00034     OBJECT,
00035     FUEL,
00036     VEIN,
00037     TIN,
00038     COPPER,
00039     COAL,
00040     ORE,
00041     BRONZE,
00042     METAL,
00043     LEG,
00044     ARM,
00045     TORSO,
00046     HEAD,
00047     HELMET,
00048     BRACERS,
00049     ARMOR,
00050     GREAVES,
00051     UPGRADE1,
00052     UPGRADE2,
00053     UPGRADE3,
00054     UPGRADE4,
00055     UPGRADE5,
00056     UPGRADE6,
00057     UPGRADE7,
00058     UPGRADE8,
00059     UPGRADE9,
00060     IRON,
00061     STEEL,
00062     COKE,
00063     SAND,
00064     HUPGRADE,
00065     AUPGRADE,
00066     TUPGRADE,
00067     LUPGRADE,
00068     WEAPON,
00069     LEATHER,
00070     BONE
00071   } ITEMTYPE;
00072 
00076 class Item
00077 {
00078 public:
00082   std::string name;
00086   TCODList<int> types;
00090   int x;
00094   int y;
00098   char ch;
00102   TCODColor color;
00106   bool walkable;
00110   bool transparent;
00114   bool taken;
00118   bool stored;
00122   bool hidden;
00126   std::string description;
00130   bool designated;
00134   int data;
00138   std::string damage;
00142   int range;
00143 
00144   Item();
00145   int additem(bool start);
00146   void setitem(int x1, int y1, int iindex = -1, bool start = false);
00147   void useitem();
00148   void deleteitem();
00149 };
00150 
00151 void buildItemsUI();
00152 void setVisibleItems(bool visible);
00153 int find_proto_obj(std::string name, TCODList<int> *types = new TCODList<int>());
00154 int find_obj(std::string name, int x = -1, int y = -1, TCODList<int> *types = new TCODList<int>(), bool hidden = false);
00155 int find_near_obj(std::string name, int x, int y, int radius, TCODList<int> *types, bool stored = true, bool hidden = false);
00156 TCODList<int> find_all_proto_obj(TCODList<int> types);
00157 TCODList<int> find_all_obj(TCODList<int> types);
00158 
00159 #endif
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines