Skip to content

Commit ee535ce

Browse files
authored
更新见说明
1 parent f9eb2e5 commit ee535ce

File tree

10 files changed

+112
-103
lines changed

10 files changed

+112
-103
lines changed

README-EN.md

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@ Of course, you can also set modes, view help, and create archives. These parts a
2020

2121
### V2.3
2222

23+
#### V2.3.5
24+
25+
Archive updated again! Added language options. In addition, if you do not want to use the default archive location, you can also open the archive file using 'main.exe'.
26+
2327
#### V2.3.4
2428

2529
Updated game instructions and added gameplay related introductions. I will update again later.
@@ -54,10 +58,4 @@ Slightly revised RENAME.md.
5458

5559
3. New mode: All in one mode.
5660

57-
--snip--
58-
59-
## Discussion Channel
60-
61-
[github link](https://github.com/c-cpp-a/My-Map/discussions) (github.com)
62-
63-
[luogu link](https://www.luogu.com.cn/blog/somebody66xyyd/my-map) (luogu.com.cn)
61+
--snip--

README.md

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,10 @@
2020

2121
### V2.3
2222

23+
#### V2.3.5
24+
25+
存档再次更新!添加了语言选项。此外,如果你不想使用默认的存档位置的话,也可以将存档文件使用`main.exe`打开。
26+
2327
#### V2.3.4
2428

2529
更新游戏说明,添加了玩法相关的介绍。稍后我会再次更新的。
@@ -147,6 +151,6 @@ This is a new Sandbox game. You can create or destroy rocks here, and you can wa
147151

148152
# 讨论频道
149153

150-
[github 链接](https://github.com/c-cpp-a/My-Map/discussions) (github.com)
154+
[discord链接 discord link](https://discord.gg/hK3P8YaJ) (discord.gg)
151155

152-
[洛谷链接](https://www.luogu.com.cn/blog/somebody66xyyd/my-map) (luogu.com.cn)
156+
[洛谷链接 luogu link](https://www.luogu.com.cn/blog/somebody66xyyd/my-map) (luogu.com.cn)

defines/Eggs.h

Lines changed: 15 additions & 36 deletions
Original file line numberDiff line numberDiff line change
@@ -12,19 +12,23 @@ class People;
1212
class Map;
1313
class Egg{
1414
private:
15-
bool has_ach=false;
16-
bool achs[10]={};
15+
bool has_ach;
16+
unsigned int achs;
1717
public:
18+
Egg():achs(0),has_ach(false){}
1819
int isegg(const int &,People &,Map &);
1920
void check_run(const int &,People &,Map &);
2021
void print_ach();
2122
void imports(ifstream &);
2223
void save(ofstream &);
2324
inline bool is_ach(){
24-
return has_ach;
25+
return achs!=0;
2526
}
26-
inline bool &operator[](size_t i){
27-
return achs[i];
27+
inline bool operator[](size_t i){
28+
return achs&(1<<i);
29+
}
30+
inline void set_ach(size_t i,bool value){
31+
achs|=(1<<i);
2832
}
2933
};
3034
#include "def"
@@ -50,7 +54,7 @@ void Egg::check_run(const int &lang,People &p,Map &h){
5054
switch(isegg(lang,p,h)){
5155
case CHI_egg_1:
5256
{
53-
achs[6]=true;
57+
set_ach(6,1);
5458
::print("恭喜您,发现了彩蛋!\n");
5559
::print(">>>");
5660
string s;
@@ -73,7 +77,7 @@ void Egg::check_run(const int &lang,People &p,Map &h){
7377
break;
7478
case UNABLE_egg_1:
7579
{
76-
achs[7]=true;
80+
set_ach(7,1);
7781
::print("恭喜您,发现了彩蛋!\n");
7882
::print("Congratulations, you found the egg!\n");
7983
::print("<<<");
@@ -97,42 +101,17 @@ void Egg::check_run(const int &lang,People &p,Map &h){
97101
void Egg::print_ach(){
98102
auto y=0;
99103
y=ach_print("achievement",y);
100-
if(achs[0]){
101-
y=ach_print("1.creat your first floor.",y);
102-
}
103-
if(achs[1]){
104-
y=ach_print("2.creat your first rock.",y);
105-
}
106-
if(achs[2]){
107-
y=ach_print("3.creat your first portal.",y);
108-
}
109-
if(achs[3]){
110-
y=ach_print("4.creat your first ball.",y);
111-
}
112-
if(achs[4]){
113-
y=ach_print("5.first access to the portal",y);
114-
}
115-
if(achs[5]){
116-
y=ach_print("6.move your ball the first time.",y);
117-
}
118-
if(achs[6]){
119-
y=ach_print("7.found Chinese egg 1.",y);
120-
}
121-
if(achs[7]){
122-
y=ach_print("8.found [unable] Egg 1.",y);
104+
for(int i=0;i<8;i++){
105+
y=ach_print(achs_print[i],y);
123106
}
124107
}
125108
void Egg::imports(ifstream &fin){
126109
fin >> has_ach;
127-
for(int i=0;i<8;i++){
128-
fin >> achs[i];
129-
}
110+
fin >> achs;
130111
}
131112
void Egg::save(ofstream &fout){
132113
fout << has_ach << endl;
133-
for(int i=0;i<8;i++){
134-
fout << achs[i] << ' ';
135-
}
114+
fout << achs;
136115
fout << endl;
137116
}
138117
#endif

defines/People.h

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -125,15 +125,15 @@ void People::set_f(Map &h,Egg &egg){
125125
auto tmp=check_xy(pos,move_f);
126126
h.change(tmp.x,tmp.y,floors);
127127
doors[tmp.x][tmp.y]=default_node;
128-
if(egg.is_ach()) egg[0]=true;
128+
if(egg.is_ach()) egg.set_ach(0,1);
129129
}
130130
break;
131131
case '2':
132132
{
133133
auto tmp=check_xy(pos,move_f);
134134
h.change(tmp.x,tmp.y,rock);
135135
doors[tmp.x][tmp.y]=default_node;
136-
if(egg.is_ach()) egg[1]=true;
136+
if(egg.is_ach()) egg.set_ach(1,1);
137137
}
138138
break;
139139
case '3':
@@ -161,15 +161,15 @@ void People::set_f(Map &h,Egg &egg){
161161
}
162162
}
163163
doors[tmp.x][tmp.y]=tmp2;
164-
if(egg.is_ach()) egg[2]=true;
164+
if(egg.is_ach()) egg.set_ach(2,1);
165165
}
166166
break;
167167
case '4':
168168
{
169169
auto tmp=check_xy(pos,move_f);
170170
h.change(tmp.x,tmp.y,ball);
171171
doors[tmp.x][tmp.y]=default_node;
172-
if(egg.is_ach()) egg[3]=true;
172+
if(egg.is_ach()) egg.set_ach(3,1);
173173
}
174174
break;
175175
case 'L':case 'l':
@@ -186,7 +186,7 @@ void People::set_f(Map &h,Egg &egg){
186186
auto tmp=pos;
187187
pos.x=doors[tmp.x][tmp.y].x;
188188
pos.y=doors[tmp.x][tmp.y].y;
189-
if(egg.is_ach()) egg[4]=true;
189+
if(egg.is_ach()) egg.set_ach(4,1);
190190
} else if(h[pos.x][pos.y]==ball){
191191
auto tmp=pos;
192192
bool flag=true;
@@ -200,7 +200,7 @@ void People::set_f(Map &h,Egg &egg){
200200
if(flag){
201201
h.change(tmp.x,tmp.y,ball);
202202
h.change(pos.x,pos.y,floors);
203-
if(egg.is_ach()) egg[5]=true;
203+
if(egg.is_ach()) egg.set_ach(5,1);
204204
} else{
205205
pos=check_xy(pos,back(move_f));
206206
}

defines/def

Lines changed: 15 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
/*
2-
* 作者:c_cpp_a(Github)
3-
* 最近更新:2022/12/26
4-
* 功能简述:这是游戏的基本定义部分。负责常量、enum。当然为了游戏的编写方便,这里的显示字符映射使用了std::map
2+
* 作者:C-cpp-a(Github)
3+
* 最近更新:2023/5/9
4+
* 功能简述:这是游戏的基本定义部分。负责常量、enum。当然为了游戏的编写方便,这里的显示字符映射使用了std::unordered_map
55
*/
66
//For some reasons, the English version notes will not be displayed here.
77
#pragma once
@@ -55,16 +55,26 @@ std::unordered_map<std::size_t,char> print_c={//对应元素显示成什么样
5555
const int COLS=100,LINES=50;//游戏的窗口大小
5656
const int ADD_COLS=20,ADD_LINE=10;//成就的新增窗口大小
5757
const int MODE_COUNT=4,LANGUAGE_COUNT=3,DIRECT_COUNT=5;//模式的种数、语言的种数和方向的种数
58-
const char SAVE_NAME[]="data.mymap";//保存文件名(未实装)
58+
char * SAVE_NAME=const_cast<char *>("data.mymap");//保存文件名(默认导入/保存位置为data.mmap)
5959
const int EGG_POS[LANGUAGE_COUNT][10][2]={{5,5},{10,10},{2,2}};//EGG_POS[language][egg_number]={x,y},存储彩蛋的触发坐标
6060
const char mode_content[LANGUAGE_COUNT][MODE_COUNT][101]={//模式的介绍(mode_content[language][mode]=s)
6161
{},//未定义的自然什么都没有啦
6262
{"正常的模式","开发者模式","地狱的模式","清一色模式"},//中文
6363
{"normal","debugger","infernal","all in one color"}//英文
6464
};
65-
const char direct_content[LANGUAGE_COUNT][DIRECT_COUNT][101]={//方向对应的名称
65+
const char direct_content[LANGUAGE_COUNT][DIRECT_COUNT][8]={//方向对应的名称
6666
{},//未定义的自然什么都没有啦
6767
{"?","上","下","左","右"},//中文
6868
{"?","up","down","left","right"}//英文
6969
};
70+
const char achs_print[][64]={
71+
{"1.creat your first floor."},
72+
{"2.creat your first rock."},
73+
{"3.creat your first portal."},
74+
{"4.creat your first ball."},
75+
{"5.first access to the portal"},
76+
{"6.move your ball the first time."},
77+
{"7.found Chinese egg 1."},
78+
{"8.found [unable] Egg 1."}
79+
};
7080
#endif

defines/help_func.h

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -56,5 +56,9 @@ namespace{
5656
break;
5757
}
5858
}
59+
void ShowCursor(bool visible){
60+
CONSOLE_CURSOR_INFO cursor_info={20, visible};
61+
SetConsoleCursorInfo(GetStdHandle(STD_OUTPUT_HANDLE),&cursor_info);
62+
}
5963
}
6064
#endif

0 commit comments

Comments
 (0)