www.pudn.com > linkfive.rar > LinkFDoc.cpp
// LinkFDoc.cpp : implementation of the CLinkFDoc class
//
#include "stdafx.h"
#include "LinkF.h"
#include "LinkFDoc.h"
#ifdef _DEBUG
#define new DEBUG_NEW
#undef THIS_FILE
static char THIS_FILE[] = __FILE__;
#endif
/////////////////////////////////////////////////////////////////////////////
// CLinkFDoc
IMPLEMENT_DYNCREATE(CLinkFDoc, CDocument)
BEGIN_MESSAGE_MAP(CLinkFDoc, CDocument)
//{{AFX_MSG_MAP(CLinkFDoc)
// NOTE - the ClassWizard will add and remove mapping macros here.
// DO NOT EDIT what you see in these blocks of generated code!
//}}AFX_MSG_MAP
END_MESSAGE_MAP()
/////////////////////////////////////////////////////////////////////////////
// CLinkFDoc construction/destruction
CLinkFDoc::CLinkFDoc()
{
// TODO: add one-time construction code here
}
CLinkFDoc::~CLinkFDoc()
{
}
BOOL CLinkFDoc::OnNewDocument()
{
if (!CDocument::OnNewDocument())
return FALSE;
// TODO: add reinitialization code here
// (SDI documents will reuse this document)
int i,j,k;
int count=0;
for(i=0;i=4;j--)
{
for(k=0;k<5;k++)
{
ComputerTable[i+k][j-k][count]=true;
PlayerTable[i+k][j-k][count]=true;
}
count++;
}
for(i=0;i<1020;i++)
{
PlayerScore[i]=0;
ComputerScore[i]=0;
}
Over=0;
WinPoint=-1;
return TRUE;
}
/////////////////////////////////////////////////////////////////////////////
// CLinkFDoc serialization
void CLinkFDoc::Serialize(CArchive& ar)
{
if (ar.IsStoring())
{
for(int i=0;i>Board[i][j];
for(i=0;i<1020;i++)
{
ar>>ComputerScore[i];
ar>>PlayerScore[i];
}
for(i=0;i>ComputerTable[i][j][k];
ar>>PlayerTable[i][j][k];
}
ar>>Over;
}
}
/////////////////////////////////////////////////////////////////////////////
// CLinkFDoc diagnostics
#ifdef _DEBUG
void CLinkFDoc::AssertValid() const
{
CDocument::AssertValid();
}
void CLinkFDoc::Dump(CDumpContext& dc) const
{
CDocument::Dump(dc);
}
#endif //_DEBUG
/////////////////////////////////////////////////////////////////////////////
// CLinkFDoc commands
BOOL CLinkFDoc::OnOpenDocument(LPCTSTR lpszPathName)
{
if (!CDocument::OnOpenDocument(lpszPathName))
return FALSE;
WinPoint=-1;
// TODO: Add your specialized creation code here
return TRUE;
}
void CLinkFDoc::DeleteContents()
{
// TODO: Add your specialized code here and/or call the base class
CDocument::DeleteContents();
}
void CLinkFDoc::OnCloseDocument()
{
// TODO: Add your specialized code here and/or call the base class
CDocument::OnCloseDocument();
}