Пример #1
0
/*
 * btt_check -- perform a consistency check on a btt namespace
 *
 * This routine contains a fairly high-impact set of consistency checks.
 * It may use a good amount of dynamic memory and CPU time performing
 * the checks.  Any lightweight, quick consistency checks are included
 * in read_layout() so they happen every time the BTT area is opened
 * for use.
 *
 * Returns true if consistent, zero if inconsistent, -1/error if checking
 * cannot happen due to other errors.
 *
 * No lane number required here because only one thread is allowed -- all
 * other threads must be locked out of all btt routines for this btt
 * namespace while this is running.
 */
int
btt_check(struct btt *bttp)
{
	LOG(3, "bttp %p", bttp);

	int consistent = 1;

	if (!bttp->laidout) {
		/* consistent by definition */
		LOG(3, "no layout yet");
		return consistent;
	}

	/* XXX report issues found during read_layout (from flags) */

	/* for each arena... */
	struct arena *arenap = bttp->arenas;
	for (int i = 0; i < bttp->narena; i++) {
		/*
		 * Perform the consistency checks for the arena.
		 */
		int retval = check_arena(bttp, arenap);
		if (retval < 0)
			return retval;
		else if (retval == 0)
			consistent = 0;
	}

	/* XXX stub */
	return consistent;
}
Пример #2
0
void cScreenTown::process()
{
	if (!ids_set)set_ids();								// we need to make sure the ID variables are set
	init();
	if (g_InterfaceEvents.GetNumEvents() == 0) return;	// no events means we can go home
	if (girlimage_id != -1 && !eventrunning)	HideImage(girlimage_id, true);

	/*
	*	otherwise, compare event IDs
	*
	*	if it's the back button, pop the window off the stack
	*	and we're done
	*/
	/* */if (g_InterfaceEvents.CheckButton(back_id))		{ g_InitWin = true;		g_WinManager.Pop();					return; }
	else if (g_InterfaceEvents.CheckButton(slavemarket_id)) { g_InitWin = true;		g_WinManager.push("Slave Market");	return; }
	else if (g_InterfaceEvents.CheckButton(prison_id))		{ g_InitWin = true;		g_WinManager.push("Prison");		return; }
	else if (g_InterfaceEvents.CheckButton(house_id))		{ g_Building = BUILDING_HOUSE;	g_CurrHouse = 0;	g_InitWin = true;	g_WinManager.push("Player House");	return; }
	else if (g_InterfaceEvents.CheckButton(clinic_id))		{ check_clinic(0);		g_InitWin = true;			return; }
	else if (g_InterfaceEvents.CheckButton(studio_id))		{ check_studio(0);		g_InitWin = true;			return; }
	else if (g_InterfaceEvents.CheckButton(arena_id))		{ check_arena(0);		g_InitWin = true;			return; }
	else if (g_InterfaceEvents.CheckButton(centre_id))		{ check_centre(0);		g_InitWin = true;			return; }
	else if (g_InterfaceEvents.CheckButton(farm_id))		{ check_farm(0);		g_InitWin = true;			return; }
	else if (g_InterfaceEvents.CheckButton(mayor_id))		{ g_InitWin = true;		g_WinManager.push("Mayor");	return; }
	else if (g_InterfaceEvents.CheckButton(bank_id))		{ g_InitWin = true;		g_WinManager.push("Bank");	return; }
	else if (g_InterfaceEvents.CheckButton(shop_id))		{ g_InitWin = true;		g_AllTogle = false;	g_WinManager.push("Item Management");	return; }
	else if (g_InterfaceEvents.CheckButton(brothel0_id))	{ check_brothel(0);		g_InitWin = true;	return; }
	else if (g_InterfaceEvents.CheckButton(brothel1_id))	{ check_brothel(1);		g_InitWin = true;	return; }
	else if (g_InterfaceEvents.CheckButton(brothel2_id))	{ check_brothel(2);		g_InitWin = true;	return; }
	else if (g_InterfaceEvents.CheckButton(brothel3_id))	{ check_brothel(3);		g_InitWin = true;	return; }
	else if (g_InterfaceEvents.CheckButton(brothel4_id))	{ check_brothel(4);		g_InitWin = true;	return; }
	else if (g_InterfaceEvents.CheckButton(brothel5_id))	{ check_brothel(5);		g_InitWin = true;	return; }
	else if (g_InterfaceEvents.CheckButton(brothel6_id))	{ check_brothel(6);		g_InitWin = true;	return; }
	else if (g_InterfaceEvents.CheckButton(walk_id))		{ do_walk();			if (!g_Cheats) g_WalkAround = true;	g_InitWin = true; }
	else if (g_InterfaceEvents.CheckButton(setup_id))		{ g_InitWin = true;		g_WinManager.push("Property Management");		return; }	// `J` added

}