/* -------------------------------------------------------------------- */
/*								SCRFHALL.CPP							*/
/* -------------------------------------------------------------------- */
/*	This file contains all the internal functions for user scripts		*/
/* -------------------------------------------------------------------- */
#include "ctdl.h"
#pragma hdrstop

#include "scrfunc.h"

#include "hall.h"

/* -------------------------------------------------------------------- */
/*							HALL FILE STUFF 							*/
/* -------------------------------------------------------------------- */

void sfGethallname(strList *params)
	{
	SETSTR(HallData->GetEntry(evaluateInt(params->string))->GetName());
	}

void sfGethallgroup(strList *params)
	{
	SETINT(HallData->GetEntry(evaluateInt(params->string))->GetGroupNumber());
	}

void sfIshallinuse(strList *params)
	{
	SETBOOL(HallData->GetEntry(evaluateInt(params->string))->IsInuse());
	}

void sfIshallgrp(strList *params)
	{
	SETBOOL(HallData->GetEntry(evaluateInt(params->string))->IsOwned());
	}

void sfIshalldesc(strList *params)
	{
	SETBOOL(HallData->GetEntry(evaluateInt(params->string))->IsDescribed());
	}

void sfIshallenterroom(strList *params)
	{
	SETBOOL(HallData->GetEntry(evaluateInt(params->string))->IsEnterRoom());
	}

void sfGethalldesc(strList *params)
	{
	SETSTR(HallData->GetEntry(evaluateInt(params->string))->GetDescriptionFile());
	}

void sfIsRoomInHall(strList *params)
	{
	SETBOOL(HallData->GetEntry(evaluateInt(params->string))->
			IsRoomInHall(evaluateInt(params->next->string)));
	}

void sfSetRoomInHall(strList *params)
	{
	HallData->GetEntry(evaluateInt(params->string))->
			SetRoomInHall(evaluateInt(params->next->string),
			evaluateBool(params->next->next->string));
	}

void sfFindHallByName(strList *params)
	{
	if (params->next && evaluateBool(params->next->string))
		{
		SETINT(partialhall(evaluateString(params->string)));
		}
	else
		{
		SETINT(hallexists(evaluateString(params->string)));
		}
	}
