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

📄 cgpturnrightnode.cpp

📁 C人工智能游戏开发的一些实例源代码 C Game development in artificial intelligence source code of some examples
💻 CPP
字号:
//GPExample
//Copyright John Manslow
//29/09/2001

////////////////////////////////////////////////////////////
//Only when compiling under Windows
#include "stdafx.h"
#define new DEBUG_NEW
////////////////////////////////////////////////////////////

#include "math.h"
#include "CGPTurnRightNode.h"
#include "CGPNode.h"
#include "CGP.h"
#include "assert.h"

extern void TurnRight(void);

extern CGPNode **pPrototypeList;
extern unsigned long ulNumberOfPrototypes;

CGPTurnRightNode TurnRightPrototype;

CGPTurnRightNode::CGPTurnRightNode()
{
	nType=11;
	pChildren=NULL;
	ulNumberOfChildren=0;
	sprintf(psName,"TurnRightNode");
	nIsPrototype=1-AddToPrototypeList();
	dPrior=0.1;
}

CGPTurnRightNode::~CGPTurnRightNode()
{
}

CGPNode *CGPTurnRightNode::pGetCopy(CGP* pGP)
{
	CGPTurnRightNode *pNewNode=new CGPTurnRightNode;
	assert(!(pNewNode==NULL));
	return (CGPNode*)pNewNode;
}

double CGPTurnRightNode::dEvaluate(void)
{
	//This function makes the agent turn right 90 degrees
	TurnRight();
	return 0.0;
}

char* CGPTurnRightNode::psGetString(char* pString)
{
	if(pString!=NULL && strlen(pString)<10000)
	{
		sprintf(pString,"%s TurnRight()",pString);
	}
	return pString;
}

⌨️ 快捷键说明

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