algorithminterface.h
来自「巫魔问题求解」· C头文件 代码 · 共 72 行
H
72 行
#pragma once
#include "GameEngine.h"
namespace _server
{
class AlgorithmInterface
{
public:
//Constructor
AlgorithmInterface(GameEngine & ge);
//Destructor
~AlgorithmInterface(void);
private:
//Copy constructor
AlgorithmInterface(const AlgorithmInterface &from);
public:
//The interface provided by server
struct ServerToClient
{
ServerToClient(void);
void Reset(void);
unsigned int mPositionX;
unsigned int mPositionY;
unsigned int mDirection;
unsigned int mShootsLeft;
bool mIsStench;
bool mIsGleam;
bool mIsBreeze;
bool mIsBump;
bool mIsHowl;
bool mIsReset;
};
//The operations available by client
struct ClientToServer
{
ClientToServer(void);
bool Shoot(void);
bool GoAhead(void);
bool TurnLeft(void);
bool TurnRight(void);
bool Escape(void);
AlgorithmInterface *mpAlgorithmInterface;
};
public:
//Update the data
void Update(void);
public:
//references
ServerToClient &TheServerToClient(void);
ClientToServer &TheClientToServer(void);
GameEngine & TheGameEngine(void);
protected:
//Inner Data
GameEngine & m_rGameEngine;
ServerToClient *mpServerToClient;
ClientToServer *mpClientToServer;
};
}
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?