// AISetDirection.cpp : implementation file
//

#include "stdafx.h"
#include "Simulator.h"
#include "AISetDirection.h"

#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif

/////////////////////////////////////////////////////////////////////////////
// AISetDirection dialog


AISetDirection::AISetDirection(CWnd* pParent /*=NULL*/)
	: CDialog(AISetDirection::IDD, pParent)
{
	//{{AFX_DATA_INIT(AISetDirection)
		// NOTE: the ClassWizard will add member initialization here
	//}}AFX_DATA_INIT
	Once = TRUE;
}


void AISetDirection::DoDataExchange(CDataExchange* pDX)
{
	CDialog::DoDataExchange(pDX);
	//{{AFX_DATA_MAP(AISetDirection)
	DDX_Control(pDX, IDC_DIRECTION, m_SetDirection);
	//}}AFX_DATA_MAP

	if (Once)
	{
		Once = FALSE;
		m_SetDirection.SetCurSel(0);		
	}
}


BEGIN_MESSAGE_MAP(AISetDirection, CDialog)
	//{{AFX_MSG_MAP(AISetDirection)
	//}}AFX_MSG_MAP
END_MESSAGE_MAP()

/////////////////////////////////////////////////////////////////////////////
// AISetDirection message handlers


void AISetDirection::OnOK() 
{
	// TODO: Add extra validation here

	m_Direction = m_SetDirection.GetCurSel();

	// just in case
	if (m_Direction > 3)
		m_Direction = 0;
	
	CDialog::OnOK();
}
