/** * @file character.h * @ingroup character * * Database abstraction module. * * @author Geoff Davis <geoff@circlemudsquared.org> * @author Greg Buxton <greg@circlemudsquared.org> * * @par Copyright: * Copyright (C) 2006 Geoff Davis <geoff@circlemudsquared.org><br> * Greg Buxton <greg@circlemudsquared.org> * * @par * Copyright (C) 1993, 94 by the Trustees of the Johns Hopkins University<br> * CircleMUD is based on DikuMUD, Copyright (C) 1990, 1991. * * @par * All rights reserved. See license.doc for complete information. * * @package cs * @version 1.0 */ #ifndef __CHARACTER_H__ #define __CHARACTER_H__ #include "base.h" #include "dao.h" #include "zone.h" #include "room.h" /** * Equips an item in a wear slot. * @param ch the character to be equipped * @param obj the item with which the character is to be equipped * @param pos the wear slot (WEAR_xxx) where the item is to be worn * @return none */ void char_equipItem(charData_t *ch, itemData_t *obj, int pos); /** * Removes a character from its room. * @param ch the character to be removed * @return none */ void char_fromRoom(charData_t *ch); /** * Places a character into a room. * @param ch the character to be placed * @param room the room the place the character into * @return none */ void char_toRoom(charData_t *ch, roomData_t *room); /** * Removes the item equipped in a wear slot. * @param ch the character to be unequipped * @param pos the wear slot (WEAR_xxx) to be unequipped * @return the item unequipped from the wear slot, or NULL */ itemData_t *char_unequipItem(charData_t *ch, int pos); /** * Extracts a character. * @param ch the character to be extracted * @return none */ void char_extract(charData_t *ch); /** * Extracts a character. * @param ch the character to be extracted * @return none */ void char_extractFinal(charData_t *ch); /** * Extracts any characters with a pending extraction. * @return none */ void char_extractPendingChars(void); void charPlayerData_toDao(daoData_t *parentDao, charPlayerData_t *cpData, bool isPlayer); void charAbilities_toDao(daoData_t *parentDao, charAbilities_t *caData); void charPointData_toDao(daoData_t *parentDao, charPointData_t *cpData, bool isPlayer); void playerSpecials_toDao(daoData_t *parentDao, playerSpecials_t *psData); void savedPlayerSpecials_toDao(daoData_t *parentDao, savedPlayerSpecials_t *psData); void savedCharSpecials_toDao(daoData_t *parentDao, savedCharSpecials_t *csData, bool isPlayer); /** * Load a charPlayerData_t from it's dao representation * * NOTE: This will re-set all string variables, so should only be used for players * or mobile prototypes * * @param cpData charPlayerData_t to populate * @param isPlayer TRUE or FALSE if player character * @param dao charPlayerData_t in dao format */ void charPlayerData_fromDao(charPlayerData_t *cpData, bool isPlayer, daoData_t *dao); /** * Load a charAbilities_t from it's dao representation * * @param caData charAbilities_t to populate * @param dao charPlayerData_t in dao format */ void charAbilities_fromDao(charAbilities_t *caData, daoData_t *dao); /** * Load a charPointData_t from it's dao representation * * @param cpData charPointData_t to populate * @param isPlayer TRUE or FLASE if player character * @param dao charPointData_t in dao format */ void charPointData_fromDao(charPointData_t *cpData, bool isPlayer, daoData_t *dao); /** * Load a playerSpecials_t from it's dao representation * * @param psData playerSpecials_t to populate * @param dao playerSpecials_t in dao format */ void playerSpecials_fromDao(playerSpecials_t *psData, daoData_t *dao); /** * Load a savedPlayerSpecials_t from it's dao representation * * @param psData savedPlayerSpecials_t to populate * @param dao savedPlayerSpecials_t in dao format */ void savedPlayerSpecials_fromDao(savedPlayerSpecials_t *psData, daoData_t *dao); /** * Load a savedCharSpecials_t from it's dao representation * * @param csData savedCharSpecials_t to populate * @param isPlayer TRUE or FALSE if player character * @param dao savedCharSpecials_t in dao format */ void savedCharSpecials_fromDao(savedCharSpecials_t *csData, bool isPlayer, daoData_t *dao); #endif /* __CHARACTER_H__ */