// CardGameDlg.h : header file
//

#if !defined(AFX_CARDGAMEDLG_H__223DF847_F36D_4FBD_8EA5_AFC90465E4A6__INCLUDED_)
#define AFX_CARDGAMEDLG_H__223DF847_F36D_4FBD_8EA5_AFC90465E4A6__INCLUDED_

#if _MSC_VER > 1000
#pragma once
#endif // _MSC_VER > 1000

#pragma warning(disable: 4786)

/////////////////////////////////////////////////////////////////////////////
// CCardGameDlg dialog
#include <map>
#include <tchar.h>
#include <olectl.h>
#include "cards.h"

#define HIMETRIC_INCH	2540
#define MAP_LOGHIM_TO_PIX(x,ppli)   ( ((ppli)*(x) + HIMETRIC_INCH/2) / HIMETRIC_INCH )

typedef std::map<int, LPPICTURE, std::less<int> > PicCardType;

namespace myUtilities
{
   void LoadPictureFile(LPCTSTR szFile, LPPICTURE &gpPic);
   void RenderPic(CDialog* pDlg, HDC hDC, LPPICTURE pPic, long lx, long ly);
}

class CCardGameDlg : public CDialog
{
// Construction
public:
	CCardGameDlg(CWnd* pParent = NULL);	// standard constructor

// Dialog Data
	//{{AFX_DATA(CCardGameDlg)
	enum { IDD = IDD_CARDGAME_DIALOG };
	double	m_MyPoints;
	int		m_MyDollars;
	int		m_PcDollars;
	double	m_PcPoints;
	CString	m_Message;
	int		m_bet;
	//}}AFX_DATA

	// ClassWizard generated virtual function overrides
	//{{AFX_VIRTUAL(CCardGameDlg)
	protected:
	virtual void DoDataExchange(CDataExchange* pDX);	// DDX/DDV support
	//}}AFX_VIRTUAL
friend void CALLBACK EXPORT TimerPcCard(
   HWND hWnd,      // handle of CWnd that called SetTimer
   UINT nMsg,      // WM_TIMER
   UINT nIDEvent,   // timer identification
   DWORD dwTime    // system time
);
private:
   GameNapoletano m_gn;
   PicCardType m_CardMap;
   PicCardType::iterator m_itMyCard;
   PicCardType::iterator m_itPcCard;
   std::vector<LPPICTURE> m_picMyVect;
   std::vector<LPPICTURE> m_picPcVect;
   int m_iCountCards;
   bool m_bFirstCard;
   bool m_bStopCard;
   bool m_end_hand;
   int m_gameResult;
   void OnPcCard(); 
   void CheckWin();
   LPPICTURE m_resultPic;
   void MyPlaySound(LPCSTR pszSound, HMODULE hmod, DWORD fdwSound);
   bool m_bSound;
// Implementation
protected:
	HICON m_hIcon;
	HCURSOR m_hCursor;

	// Generated message map functions
	//{{AFX_MSG(CCardGameDlg)
	virtual BOOL OnInitDialog();
	afx_msg void OnPaint();
   afx_msg HCURSOR OnQueryDragIcon();
	afx_msg void OnCard();
	afx_msg void OnStop();
	afx_msg void OnExit();
	afx_msg BOOL OnSetCursor(CWnd* pWnd, UINT nHitTest, UINT message);
	afx_msg void OnHelpbut();
	afx_msg void OnSelendokCombobet();
	afx_msg void OnSound();
	afx_msg void OnKeyDown(UINT nChar, UINT nRepCnt, UINT nFlags);
	//}}AFX_MSG
	DECLARE_MESSAGE_MAP()
};

//{{AFX_INSERT_LOCATION}}
// Microsoft Visual C++ will insert additional declarations immediately before the previous line.

#endif // !defined(AFX_CARDGAMEDLG_H__223DF847_F36D_4FBD_8EA5_AFC90465E4A6__INCLUDED_)
