⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 weiqiply.h

📁 此代码是用BCB做的围棋代码
💻 H
字号:
//---------------------------------------------------------------------------
#ifndef weiqiplyH
#define weiqiplyH
//---------------------------------------------------------------------------
#include <Classes.hpp>
#include <Controls.hpp>
#include <StdCtrls.hpp>
#include <Forms.hpp>
#include <Menus.hpp>
#include <ComCtrls.hpp>
#include <ExtCtrls.hpp>
#include <ToolWin.hpp>
#include <Buttons.hpp>
#include <Dialogs.hpp>

#include "weiqibrd.h"
#include <Grids.hpp>

enum TStonePlace { spNormal = 0, spStar, spTop, spBottom, spLeft, spRight, spLeftTop, spLeftBottom, spRightTop, spRightBottom };

struct TStonePlaceToGoTo
{
  int  nX;
  int  nY;
  bool bX;
  bool bY;
};

//---------------------------------------------------------------------------
class TMainFormWeiqi : public TForm
{
__published:	// IDE-managed Components
    TMainMenu *MainMenuWeiqi;
    TMenuItem *MenuConnection;
    TMenuItem *MenuHelp;
    TMenuItem *MenuConnectionConnectWith;
    TMenuItem *MenuConnectionDisconnect;
    TMenuItem *N1;
    TMenuItem *MenuConnectionExit;
    TStatusBar *StatusBarWeiqi;
    TMemo *MemoTip;
    TMenuItem *MenuPlay;
    TMenuItem *MenuPlayGo;
    TMenuItem *MenuPlayUndo;
    TMenuItem *N2;
    TMenuItem *MenuPlayContinue;
    TMenuItem *MenuPlayNewGame;
    TMenuItem *MenuPlayRusume;
    TMenuItem *N3;
    TLabel *LabelChat;
    TImage *ImageFrontier;
    TImageList *ImageListStones;
    TLabel *Label1;
    TLabel *Label2;
    TLabel *Label3;
    TLabel *Label4;
    TLabel *Label5;
    TLabel *Label6;
    TLabel *Label7;
    TLabel *Label8;
    TLabel *Label9;
    TLabel *Label10;
    TLabel *Label11;
    TLabel *Label12;
    TLabel *Label13;
    TLabel *Label14;
    TLabel *Label15;
    TLabel *Label16;
    TLabel *Label17;
    TLabel *Label18;
    TLabel *Label19;
    TLabel *LabelA;
    TLabel *LabelB;
    TLabel *LabelC;
    TLabel *LabelD;
    TLabel *LabelE;
    TLabel *LabelF;
    TLabel *LabelG;
    TLabel *LabelH;
    TLabel *LabelI;
    TLabel *LabelJ;
    TLabel *LabelK;
    TLabel *LabelL;
    TLabel *LabelM;
    TLabel *LabelN;
    TLabel *LabelO;
    TLabel *LabelP;
    TLabel *LabelQ;
    TLabel *LabelR;
    TLabel *LabelS;
    TPanel *Panel1;
    TPanel *PanelWeiqiAspect;
    TImage *ImageStoneBlack;
    TImage *ImageStoneWhite;
    TLabel *LabelNameSideBlack;
    TLabel *LabelNameSideWhite;
    TPanel *PanelCommand;
    TLabel *Label20;
    TAnimate *AnimateConnect;
    TLabel *LabelConnect;
    TSplitter *Splitter1;
    TEdit *EditGo;
    TComboBox *ComboBoxChat;
    TLabel *LabelGo;
    TPanel *Panel2;
    TImageList *ImageListStonesLived;
    void __fastcall MenuConnectionExitClick(TObject *Sender);
    void __fastcall BitBtnExitClick(TObject *Sender);
    void __fastcall FormCreate(TObject *Sender);
    void __fastcall ImageFrontierClick(TObject *Sender);
    void __fastcall ImageFrontierMouseDown(TObject *Sender,
          TMouseButton Button, TShiftState Shift, int X, int Y);
    void __fastcall EditGoKeyPress(TObject *Sender, char &Key);
    void __fastcall FormActivate(TObject *Sender);
private:	// User declarations
    TRect      RectFrontier;
    TColor     OriginalBrushColor;
    TColor     OriginalPenColor;
    TPenMode   OriginalPenMode;
    TPenStyle  OriginalPenStyle;
    int        OriginalPenWidth; // TPen's width

    TPoint     MousePoint;
    TWhichSide WhichSide;
    bool       bTurn;
    TGameType  GameType;
    TStonePlaceToGoTo StonePlaceToGoTo;

    Graphics::TBitmap *BitmapNormalCross;
    Graphics::TBitmap *BitmapStarCross;
    Graphics::TBitmap *BitmapTopCross;
    Graphics::TBitmap *BitmapBottomCross;
    Graphics::TBitmap *BitmapLeftCross;
    Graphics::TBitmap *BitmapRightCross;
    Graphics::TBitmap *BitmapLeftTopCross;
    Graphics::TBitmap *BitmapRightTopCross;
    Graphics::TBitmap *BitmapLeftBottomCross;
    Graphics::TBitmap *BitmapRightBottomCross;
    Graphics::TBitmap *BitmapStoneBlack;
    Graphics::TBitmap *BitmapStoneWhite;
    Graphics::TBitmap *BitmapStoneNewBlack;
    Graphics::TBitmap *BitmapStoneNewWhite;

private:
    TStonePlace __fastcall GetDeletedStonePlace( int X, int Y );

public:		// User declarations
    __fastcall TMainFormWeiqi(TComponent* Owner);
    bool __fastcall DrawStone( TWhichSide WhichSide, int X, int Y );
    bool __fastcall GetStoneCoordination();
    bool __fastcall SetStoneCoordination( TWhichSide WhichSide, int X, int Y );
    bool __fastcall GetPlaceToGoTo();
    bool __fastcall ReceivePlaceToGoTo();
    bool __fastcall RedrawFrontier( int order, int X, int Y );
};
//---------------------------------------------------------------------------
extern PACKAGE TMainFormWeiqi *MainFormWeiqi;
//---------------------------------------------------------------------------
#endif

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -