commit c0e47392
Use initializer lists for some contructors
Changed files
| M | README.md before |
| M | source/code/ReadKeyboard.cpp before |
| M | source/code/highscore.cpp before |
diff --git a/README.md b/README.md
index 301fadc..7d5227c 100644
--- a/README.md
+++ b/README.md
@@ -5,7 +5,7 @@ A Tetris Attack Clone under the GPL.
Homepage: <https://blockattack.net><br/>
Source: <https://github.com/blockattack/blockattack-game>
-##Screen shot
+## Screen shot

## Dependencies
@@ -65,7 +65,6 @@ and
docker build -f source/misc/docker/Dockerfile.WindoesBuild . -t blockattack_test
```
-
## Source Structure
This project is a bit unconversionel because I didn't know any better at the time.
diff --git a/source/code/ReadKeyboard.cpp b/source/code/ReadKeyboard.cpp
index 736093a..ee806f5 100644
--- a/source/code/ReadKeyboard.cpp
+++ b/source/code/ReadKeyboard.cpp
@@ -37,9 +37,7 @@ int ReadKeyboard::CharsBeforeCursor() {
return std::distance(text_string.begin(), position);
}
-ReadKeyboard::ReadKeyboard(const char* oldName) {
- maxLength = 16;
- text_string = oldName;
+ReadKeyboard::ReadKeyboard(const char* oldName) : maxLength(16), text_string(oldName) {
position = text_string.end();
}
diff --git a/source/code/highscore.cpp b/source/code/highscore.cpp
index 5a346f3..d12e685 100644
--- a/source/code/highscore.cpp
+++ b/source/code/highscore.cpp
@@ -50,9 +50,7 @@ bool record_sorter (const record& i,const record& j) {
return (i.score > j.score);
}
-Highscore::Highscore(const std::string& type) {
- this->type = type;
- filename = type+".json.dat";
+Highscore::Highscore(const std::string& type) : filename(type+".json.dat"), type(type) {
std::string readFileContent = sago::GetFileContent(filename.c_str());
if (readFileContent.length() > 0) {
try {