Planeshift
slots.h
Go to the documentation of this file.
1 /*
2  *
3  *
4  * Copyright (C) 2001 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
5  *
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License
9  * as published by the Free Software Foundation (version 2 of the License)
10  * This program is distributed in the hope that it will be useful,
11  * but WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  * You should have received a copy of the GNU General Public License
15  * along with this program; if not, write to the Free Software
16  * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
17  *
18  */
19 #ifndef PS_HEADER_SLOTS
20 #define PS_HEADER_SLOTS
21 
22 #include <csutil/csstring.h>
23 #include <csutil/strhashr.h>
24 #include <csutil/parray.h>
25 
33 {
84  PSCHARACTER_SLOT_BULK_END = 48 // not a valid number
85 };
86 
92 {
93 public:
94  SlotNameHash();
96  int GetID( const csString& name );
97 
99  const char* GetName( int id );
100 
102  const char* GetSecondaryName( int id );
103  void AddSecondaryName(const char* primary, const char* secondary);
104 
105 private:
106 
107  struct PrimaryToSecondary
108  {
109  csString primary,secondary;
110  };
111 
112  csStringHashReversible slotNames;
113  csPDelArray<PrimaryToSecondary> secondaryNames;
114 };
115 
118 #endif
const char * GetSecondaryName(int id)
Get the secondary, non exact name.
int GetID(const csString &name)
Get the enum ID from a string name.
INVENTORY_SLOT_NUMBER
Holds a list of the possible socket identifiers that items can be attached to.
Definition: slots.h:32
A hash map class that stores a name->ID of sockets.
Definition: slots.h:91
const char * GetName(int id)
Get the name from an enum.
void AddSecondaryName(const char *primary, const char *secondary)