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

📄 boidsconfig.h

📁 3D的Boids效果演示源程序
💻 H
字号:
/*	Filename:		BoidsConfig.h
	Author:			Robert Platt
	Creation date:	23/01/2000
	Modified:		13/05/2000
	Version:		0.54
	Description:	Header file for the boids configuration class.
*/


#include <vector>  // Also set the namespace for the vector.
#include <fstream>
#include <afxwin.h>
#include <afxdlgs.h>


#include "BoidsWin.h"


#ifndef BOIDS_CONFIG_H
#define BOIDS_CONFIG_H


using namespace std;  // Used for the STL Vector.


const int TEXT_BUFFER_SIZE = 256;
const int CONFIG_FIELD_SIZE = 4;


// Record to store all the boid's details.
struct Flyer
{
	int xPos, yPos, zPos;
	int hHeading, vHeading;
	int reqHHeading, reqVHeading;
	int speed, reqSpeed;
};


// Configuration Class for the Boids Simulation.
class BoidsConfig
{
public:
	BoidsConfig( );
	BoidsConfig( vector< Flyer * > &f );  // Constructor.
	void loadConfig( CString f );  // Load in a configuration.
	void scanToNext( ifstream &file );
	int readNextInt( ifstream &file );
	void saveConfig( CString f );  // Save a configuration.
	CString convertInt( int i, bool sign, bool braces );
	int getNFlyers( ) { return nFlyers; };
	vector< Flyer * > getFConfigs( ) { return fConfigs; };

private:
	int nFlyers;
	// An STL vector for the flyers.
	vector< Flyer * > fConfigs;
};


#endif

⌨️ 快捷键说明

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