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

📄 auditorysystem.h

📁 2002年
💻 H
字号:
#ifndef __AUDITORYSYSTEM_H__
#define __AUDITORYSYSTEM_H__

#include "types.h"
#include "smp_datastruct.h"
#include "bitaudio.h"

const int MAXAUDIOMESG = 8096;
const int CP_max_msgdata = 10;

enum MsgDataType{
	Msg_INT,
	Msg_ShortFloat,
	Msg_LongFloat
};

enum Msg_Type{
	Msg_MyPlayerPos = 12,
	Msg_TheirPlayerPos = 23,
	Msg_BallPos = 7,
	Msg_BallVel = 51,
	Msg_Pass = 73,
	Msg_Ballcontroller = 74,
};

class MsgData{
public:
	MsgData(float data = 0, MsgDataType precision = Msg_ShortFloat){ this->data =data; this->precision = precision;}
	MsgData(int data){ this->data =(float)data; this->precision = Msg_INT;}
	MsgDataType precision;
	float data;
	void operator =(float d){ this->data = d;}
};


class AuditoryProcessV7 : public CBitAuditory{
protected:
	char auditorybuffer[MAXAUDIOMESG];
	char saybuffer[MAXAUDIOMESG];
	int  p_auditorybuffer;
	float msgData[CP_max_msgdata];
	int MsgDataNum;
	int MsgNo;

//ciphertext
	inline int  ciphertext(char m);
	inline char deciphertext(int e);
	Time LastSpeakingTime;

public:
	AuditoryProcessV7();
/*********	AddMsg	*****************************/	
	bool SumMsg();
	void ResetBuffer();
/**********	SendMsg	****************************/
	void SendMsg();
	int encrypt(int data);
	int decrypt(int data);
	void encipher(char* buffer, int len);
	void decipher(char* buffer, int len);
/***********	Strategy	****************/
	bool IsCaptain(UNum NO);
	bool CanSpeak(bool is_begin);
	void Communication(bool is_begin);
};

class AuditoryProcessV8 : public AuditoryProcessV7{
protected:
	Index<UNum, SP_team_size> broaded_players;
	bool selfannounced;
	bool AttentionBall();

public:
	void CommunicationV8();
	void Make_attention();
};

#endif //__AUDITORYSYSTEM_H__

⌨️ 快捷键说明

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