📄 raindoc.h
字号:
// rainDoc.h : interface of the CRainDoc class
//
/////////////////////////////////////////////////////////////////////////////
#if !defined(AFX_RAINDOC_H__997739BE_CEAA_11D2_90C0_000000000007__INCLUDED_)
#define AFX_RAINDOC_H__997739BE_CEAA_11D2_90C0_000000000007__INCLUDED_
#if _MSC_VER >= 1000
#pragma once
#endif // _MSC_VER >= 1000
#include "raincom.h"
#include "rainsock.h"
class CRainDoc: public CDocument
{
protected: // create from serialization only
CRainDoc();
DECLARE_DYNCREATE(CRainDoc)
// rain attributes
public:
CString localUsrName; //user name get in dlg
int rainType; //local,server or client
int rainSource; //random,or from file
int maxStrlen; //use if random
int stepBetweenStr; //how fast,not use if work as client
int stepTime; //how fast
int rainLevel; //how hard
int allStr; //use if random
CString fileName; //use if from file
CRainMSSock server;
CRainCSock client;
ULONG tick_timer; //not use if local
int recordSpeed;
CString recordUsrName;
CString recordCreateTime;
int currentSpeed;
private:
struct rainString
{
char string[RAIN_X];
int strlen;
int whereX,whereY;
int state;
int timer;
ULONG sequence;
};
struct rainString rainStr[RAIN_Y];
int rainState;
int stepBeforeNewStr; //not use if work as client
char usrPressed[RAIN_X];
int usrRightLen;
int maxFitStrAddr;
CString rainMsg;
int rightChar; //only use if local
int rightStr; //only use if local
int totalStr; //not use if work as client
ULONG totalTime; //not use if work as client
int tmpTime; //not use if work as client
int lastNumber; //not use if work as client
//normal time is -1,if 0 rain is over
CStdioFile file ;
int isFileOpened; //flag to show if file is opened
ULONG StrSequence; //not use if local
int demoStep;
int demoTick;
int demoState;
CStdioFile recordFile;
// rain operations
public:
int rainStep();
void rainDemo();
int getDemoStep();
int getDemoState();
int charInput(char aChar);
void setRainMsg(CString msg);
CString getRainMsg();
void setRainState(int state);
void setDemoState(int state);
int getStrState(int i);
CString getStr(int i);
int getStrWhereY(int i);
int getStrWhereX(int i);
int getRainState();
BOOL isFittestStr(int i);
CString getFittestStr();
void initRain();
void strHit();
void countTime();
void closeFile();
int openFile(CString filename);
int getTotalTime();
int getRightStrNum();
int getRightCharNum();
int getTotalStrNum();
void strHitAck(ULONG seq,CString usrName,int flag); //not use if local
void insertStr(char *str,int strlen,int whereX,ULONG seq);
//only use for client
private:
void strFree(int i,int state);
int findUseStr();
int strNew(); // not use if work as client
int readFileStr(char *buffer,int max);
// Overrides
// ClassWizard generated virtual function overrides
//{{AFX_VIRTUAL(CRainDoc)
//}}AFX_VIRTUAL
// Implementation
public:
virtual ~CRainDoc();
#ifdef _DEBUG
virtual void AssertValid() const;
virtual void Dump(CDumpContext& dc) const;
#endif
protected:
// Generated message map functions
protected:
//{{AFX_MSG(CRainDoc)
// NOTE - the ClassWizard will add and remove member functions here.
// DO NOT EDIT what you see in these blocks of generated code !
//}}AFX_MSG
DECLARE_MESSAGE_MAP()
};
/////////////////////////////////////////////////////////////////////////////
//{{AFX_INSERT_LOCATION}}
// Microsoft Developer Studio will insert additional declarations immediately before the previous line.
#endif // !defined(AFX_RAINDOC_H__997739BE_CEAA_11D2_90C0_000000000007__INCLUDED_)
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -