Planeshift

slots.h

Go to the documentation of this file.
00001 /*
00002  *
00003  *
00004  * Copyright (C) 2001 Atomic Blue ([email protected], http://www.atomicblue.org)
00005  *
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License
00009  * as published by the Free Software Foundation (version 2 of the License)
00010  * This program is distributed in the hope that it will be useful,
00011  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00012  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00013  * GNU General Public License for more details.
00014  * You should have received a copy of the GNU General Public License
00015  * along with this program; if not, write to the Free Software
00016  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
00017  *
00018  */
00019 #ifndef PS_HEADER_SLOTS
00020 #define PS_HEADER_SLOTS
00021 
00022 #include <csutil/csstring.h>
00023 #include <csutil/strhashr.h>
00024 #include <csutil/parray.h>
00025 
00032 enum INVENTORY_SLOT_NUMBER
00033 {
00034     PSCHARACTER_SLOT_STORAGE = -2,
00035     PSCHARACTER_SLOT_NONE = -1,
00036     PSCHARACTER_SLOT_RIGHTHAND = 0,
00037     PSCHARACTER_SLOT_LEFTHAND = 1,
00038     PSCHARACTER_SLOT_BOTHHANDS = 2,
00039     PSCHARACTER_SLOT_RIGHTFINGER = 3,
00040     PSCHARACTER_SLOT_LEFTFINGER = 4,
00041     PSCHARACTER_SLOT_HELM = 5,
00042     PSCHARACTER_SLOT_NECK = 6,
00043     PSCHARACTER_SLOT_BACK = 7,
00044     PSCHARACTER_SLOT_ARMS = 8,
00045     PSCHARACTER_SLOT_GLOVES = 9,
00046     PSCHARACTER_SLOT_BOOTS = 10,
00047     PSCHARACTER_SLOT_LEGS = 11,
00048     PSCHARACTER_SLOT_BELT = 12,
00049     PSCHARACTER_SLOT_BRACERS = 13,
00050     PSCHARACTER_SLOT_TORSO = 14,
00051     PSCHARACTER_SLOT_MIND = 15,
00052     PSCHARACTER_SLOT_BULK1 = 16,
00053     PSCHARACTER_SLOT_BULK2 = 17,
00054     PSCHARACTER_SLOT_BULK3 = 18,
00055     PSCHARACTER_SLOT_BULK4 = 19,
00056     PSCHARACTER_SLOT_BULK5 = 20,
00057     PSCHARACTER_SLOT_BULK6 = 21,
00058     PSCHARACTER_SLOT_BULK7 = 22,
00059     PSCHARACTER_SLOT_BULK8 = 23,
00060     PSCHARACTER_SLOT_BULK9 = 24,
00061     PSCHARACTER_SLOT_BULK10 = 25,
00062     PSCHARACTER_SLOT_BULK11 = 26,
00063     PSCHARACTER_SLOT_BULK12 = 27,
00064     PSCHARACTER_SLOT_BULK13 = 28,
00065     PSCHARACTER_SLOT_BULK14 = 29,
00066     PSCHARACTER_SLOT_BULK15 = 30,
00067     PSCHARACTER_SLOT_BULK16 = 31,
00068     PSCHARACTER_SLOT_BULK17 = 32,
00069     PSCHARACTER_SLOT_BULK18 = 33,
00070     PSCHARACTER_SLOT_BULK19 = 34,
00071     PSCHARACTER_SLOT_BULK20 = 35,
00072     PSCHARACTER_SLOT_BULK21 = 36,
00073     PSCHARACTER_SLOT_BULK22 = 37,
00074     PSCHARACTER_SLOT_BULK23 = 38,
00075     PSCHARACTER_SLOT_BULK24 = 39,
00076     PSCHARACTER_SLOT_BULK25 = 40,
00077     PSCHARACTER_SLOT_BULK26 = 41,
00078     PSCHARACTER_SLOT_BULK27 = 42,
00079     PSCHARACTER_SLOT_BULK28 = 43,
00080     PSCHARACTER_SLOT_BULK29 = 44,
00081     PSCHARACTER_SLOT_BULK30 = 45,
00082     PSCHARACTER_SLOT_BULK31 = 46,
00083     PSCHARACTER_SLOT_BULK32 = 47,
00084     PSCHARACTER_SLOT_BULK_END = 48 // not a valid number
00085 };
00086 
00091 class SlotNameHash
00092 {
00093 public:
00094     SlotNameHash();
00096     int GetID( const csString& name );
00097 
00099     const char* GetName( int id );
00100 
00102     const char* GetSecondaryName( int id );
00103     void AddSecondaryName(const char* primary, const char* secondary);
00104 
00105 private:
00106 
00107     struct PrimaryToSecondary
00108     {
00109         csString primary,secondary;
00110     };
00111 
00112     csStringHashReversible slotNames;
00113     csPDelArray<PrimaryToSecondary> secondaryNames;
00114 };
00115 
00118 #endif