增加了2个函数
安装法和1.0一样
b_game.h1.0在这里有
#ifndef SOMETHING_H
#define SOMETHING_H
#include<iostream>
#include<iomanip>
#include<string>
#include<cstdlib>
#include<ctime>
#include<windows.h>
#include<conio.h>
#include<fstream>
using namespace std;
struct cdhs//存档结构体
{
void out(int n, string name)//输出存档
{
ofstream cd(&name[0]);
cd << n;
return;
}
void out(long long n, string name)
{
ofstream cd(&name[0]);
cd << n;
return;
}
void out(bool n, string name)
{
ofstream cd(&name[0]);
cd << n;
return;
}
void out(char n, string name)
{
ofstream cd(&name[0]);
cd << n;
return;
}
void out(string n, string name)
{
ofstream cd(&name[0]);
cd << n;
return;
}//重载
void in(int& n, string name)//读入存档
{
ifstream cd(&name[0]);
cd >> n;
return;
}
void in(long long& n, string name)
{
ifstream cd(&name[0]);
cd >> n;
return;
}
void in(bool& n, string name)
{
ifstream cd(&name[0]);
cd >> n;
return;
}
void in(char& n, string name)
{
ifstream cd(&name[0]);
cd >> n;
return;
}
void in(string& n, string name)
{
ifstream cd(&name[0]);
cd >> n;
return;
}//重载
};
//
//
//
//void bout(string n,long long s);//输出
void ckbb();//查看当前b_game.h库版本信息
void color(int c);//颜色
void gs(long long h, long long l, string z);//格式
void ycgb();//隐藏光标
void ydgb(long long h, long long l);//移动光标
//
//
//
void bout(string n, long long s = 50)//输出
{
for (long long i = 0; i < n.size(); i++)
{
cout << n[i];
Sleep(s);
}
return;
}
void ckbb()//查看当前b_game.h库版本信息
{
system("cls");
cout << "库名:b_game.h\n";
cout << "类型:拓展库\n";
cout << "版本号:1.1\n";
return;
}
void color(int c)//颜色
{
SetConsoleTextAttribute(GetStdHandle(STD_OUTPUT_HANDLE), c);
return;
}
void gs(long long h, long long l, string z)//格式
{
for (long long i = 1; i <= h; i++)
cout << "\n";
for (long long i = 1; i <= l; i++)
cout << " ";
cout << z;
return;
}
void ycgb()//隐藏光标
{
CONSOLE_CURSOR_INFO cursor;
cursor.bVisible = FALSE;
cursor.dwSize = sizeof(cursor);
HANDLE handle = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorInfo(handle, &cursor);
return;
}
void ydgb(long long h, long long l)//移动光标
{
COORD pos = { l,h };
HANDLE hOut = GetStdHandle(STD_OUTPUT_HANDLE);
SetConsoleCursorPosition(hOut, pos);
return;
}
#endif