/*
 * 
 *
 * Copyright (C) 2001 Atomic Blue (info@planeshift.it, http://www.atomicblue.org)
 *
 *
 * This program is free software; you can redistribute it and/or
 * modify it under the terms of the GNU General Public License
 * as published by the Free Software Foundation (version 2 of the License)
 * This program is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 * GNU General Public License for more details.
 * You should have received a copy of the GNU General Public License
 * along with this program; if not, write to the Free Software
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 *
 */
#ifndef PS_HEADER_SLOTS
#define PS_HEADER_SLOTS

#include <csutil/csstring.h>
#include <csutil/strhash.h>
#include <csutil/parray.h>

/** Holds a list of the possible socket identifiers that items can be attached to.
 */
enum EQUIPMENT_SLOTS 
{
    PSCHARACTER_SLOT_NONE = -1,
    PSCHARACTER_SLOT_RIGHTHAND = 0,
    PSCHARACTER_SLOT_LEFTHAND = 1,
    PSCHARACTER_SLOT_BOTHHANDS = 2,
    PSCHARACTER_SLOT_RIGHTFINGER = 3,
    PSCHARACTER_SLOT_LEFTFINGER = 4,
    PSCHARACTER_SLOT_HEAD = 5,
    PSCHARACTER_SLOT_NECK = 6,
    PSCHARACTER_SLOT_BACK = 7,
    PSCHARACTER_SLOT_ARMS = 8,
    PSCHARACTER_SLOT_GLOVES = 9,
    PSCHARACTER_SLOT_BOOTS = 10,
    PSCHARACTER_SLOT_LEGS = 11,
    PSCHARACTER_SLOT_BELT = 12,
    PSCHARACTER_SLOT_BRACERS = 13,
    PSCHARACTER_SLOT_TORSO = 14,
    PSCHARACTER_SLOT_MIND = 15,
    PSCHARACTER_SLOT_COUNT = 16
};

/** A hash map class that stores a name->ID of sockets. This way we can easily 
  * work with numbers and then convert to string if we need to.  This is shared
  * class across both the client and server since both may need this.  
  */
class SlotName
{
public: 
    SlotName();
    /// Get the enum ID from a string name.
    int GetID( const csString& name );
    
    /// Get the name from an enum
    const char* GetName( int id );

    /// Get the secondary, non exact name
    const char* GetSecondaryName( int id );
    void AddSecondaryName(const char* primary, const char* secondary);
    
private:

    struct PrimaryToSecondary
    {
        csString primary,secondary;
    };

    csStringHash slotNames;
    csPDelArray<PrimaryToSecondary> secondaryNames;
};
#endif
