Skip to content

Commit a96ce80

Browse files
committed
Small improvements in code formatting.
1 parent 29224bc commit a96ce80

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

src/anim.cpp

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,7 @@ void print_splash_screen(const std::filesystem::path& assets_dir)
4141

4242
std::cout << '\n' << std::setfill(' ') << std::setw(19);
4343

44-
for (const char& c : "copyright (c) 2021 cpp-gamedev")
45-
{
46-
std::cout << c;
47-
utils::sleep(std::chrono::milliseconds{50});
48-
}
44+
utils::slow_print("copyright (c) 2021 cpp-gamedev", std::chrono::milliseconds{50});
4945
}
5046

5147
void print_move_table(const models::Pokemon& pkmn)

src/anim.hpp

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,8 +1,8 @@
11
#pragma once
22

33
#include <array>
4-
#include<string>
5-
#include<vector>
4+
#include <string>
5+
#include <vector>
66

77
#include "models.hpp"
88

src/main.cpp

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,14 @@
22
#include "models.hpp"
33
#include "utils.hpp"
44

5+
using namespace std::chrono_literals;
6+
57
using namespace anim;
68
using namespace models;
79
using namespace utils;
810

911
int main()
1012
{
11-
constexpr std::chrono::milliseconds delay{1000};
1213
const auto assets_dir = find_upwards("assets");
1314
Manifest manifest = check_manifest(assets_dir.parent_path() / "manifest.json");
1415

@@ -27,15 +28,14 @@ int main()
2728

2829
if (ai.hp > 0)
2930
{
30-
sleep(delay);
31+
sleep(1000ms);
3132
ai.make_move(player, random_range<std::size_t>(1, 4));
3233
clear_screen();
3334
}
34-
3535
}
3636

3737
clear_screen();
38-
slow_print((ai.hp == 0) ? "You Won :)" : "You Lost :(", delay / 20);
38+
slow_print((ai.hp == 0) ? "You Won :)" : "You Lost :(", 50ms);
3939

4040
return EXIT_SUCCESS;
4141
}

0 commit comments

Comments
 (0)