/*****************************************************************************
 * $Id: main.cc,v 1.1 2005/08/29 00:48:07 devel Exp $
 * @file
 * @author	Jim E. Brooks  http://www.jimbrooks.org
 * @brief	Test of state-machine.
 *//*
 * LEGAL:	COPYRIGHT (C) 2005 JIM E. BROOKS
 *          THIS SOURCE CODE IS RELEASED UNDER THE TERMS
 *          OF THE GNU GENERAL PUBLIC LICENSE (GPL).
 *****************************************************************************/

#define MAIN_CC 1
#include "common.hh"
#include "gfx_machine.hh"
#include "ai.hh"
using namespace gfx;

// Test a Machine.
int main( int argc, char** argv )
{
	gStreamDebug = &cerr;

	// Create a Machine object.
	extern Machine::Opcode gSmprocPatrol[];		// state-machine procedure for a patrolling Craft
	UserData* userData = new UserData;
	Machine* machine = new Machine( gSmprocPatrol, userData );

	// This loop simulates a timer-tick that drives the machine.
	for ( int tick = 0; ; ++tick )
	{
		*gStreamDebug << "[tick=" << tick << "]\n";
		if ( ! machine->Tick() ) break;
	}

	exit( 0 );
}
