mywall.h

来自「一款45度2D游戏地图编辑器和大家一起分享啊!」· C头文件 代码 · 共 59 行

H
59
字号
#pragma once
#include <set>
#include <vector>

//原始的东西才好用,add by ajohn
struct WallConfig
{
	WallConfig()
	{}
	WallConfig(int p)
	{
		id = p;
	}
	int id;  //图片号码
	bool edit; //是否被边际?
	int offx; //x偏移量
	int offy; //y偏移量
	int centerx;
	int centery;
	int projectnumber;
	WallConfig& operator = (const WallConfig& t)
	{
		this->id = t.id;
		this->edit = t.edit;
		this->offx = t.offx;
		this->offy = t.offy;
		this->centerx = t.centerx;
		this->centery = t.centery;
		this->projectnumber = t.projectnumber;
		this->project = t.project;
		return *this;
	}
	BOOL operator == (const WallConfig& t)const
	{
		return id == t.id;
	}
	BOOL operator<(const WallConfig& t)const
	{
		return id<t.id;
	}
	BOOL operator>(const WallConfig& t)const
	{
		return id>t.id;
	}
	std::vector<CPoint> project; //投影区域
};
class CMyWall
{
public:
	CMyWall(void);
	~CMyWall(void);
	void LoadFile(CString file = ".\\config\\map\\wall.config");//读文件
	void SaveFile(CString file = ".\\config\\map\\wall.config");//写文件
	bool Insert(WallConfig& t);
	bool find(int id,WallConfig*& p);
	int number; //设定了多少个描述
	std::set<WallConfig> wallconfig;
};

⌨️ 快捷键说明

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