/**
* @file zone.h
* @ingroup zone
*
* Zone based code
*
* @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 __ZONE_H__
#define __ZONE_H__
#include "db.h"
#include "hashMap.h"
/* ************************************************************************ */
/* Structure Definitions */
/* ************************************************************************ */
/**
* @ingroup zone
* @defgroup resetCommand_t
* Zone Reset command structure
* @{
*/
struct _resetCommand_t {
int command; /**< current command */
bool if_flag; /**< if TRUE: exe only if last exe'd */
bool disabled; /**< if TRUE: don't run zone cmd */
int maxNum; /**< Param of reset command */
int direction; /**< Param of reset command */
int state; /**< Param of reset command */
int wearLocation; /**< Param of reset command */
char *sArg1; /**< String value of arg */
char *sArg2; /**< String value of arg */
char *sArg3; /**< String value of arg */
roomData_t *inRoom; /**< Arg pointer */
itemData_t *item; /**< Arg pointer */
itemData_t *inItem; /**< Arg pointer */
charData_t *mobile; /**< Arg pointer */
};
/**
* @}
*/
/**
* @ingroup zone
* @defgroup zoneData_t
* New zone structure
* @{
*/
struct _zoneData_t {
char *keyword; /**< Keyword for Zone */
char *name; /**< Name for Zone */
int lifespan; /**< # minutes between zone resets */
int age; /**< # minutes since reset */
resetCommand_t *cmd; /**< Command table for reset */
hashMap_t *rooms; /**< map of Zone's rooms */
hashMap_t *items; /**< map of Zone's items */
hashMap_t *mobiles; /**< map of Zone's mobiles */
hashMap_t *shops; /**< map of Zone's shops */
};
/**
* @}
*/
/* ************************************************************************ */
/* Public Functions */
/* ************************************************************************ */
void zoneData_loadWorld();
void zoneData_setName(zoneData_t *zone, char *name);
void zoneData_reset(zoneData_t *zone);
void zones_ageAll(void);
void world_listToPlayer(charData_t *ch, int listType);
size_t numPrototypes(int protoType);
hashKey_t hashVnum(const void *v);
hashKey_t hashStr(const void *s);
zoneData_t *zoneData_new(char *zKey);
zoneData_t *zoneData_find(char *zKey);
void roomData_linkExits();
int vnum_search(charData_t *ch, int type, char *keyword);
#endif /* __ZONE_H__ */