Moved header's includes into separete header file.

This commit is contained in:
2023-08-02 23:01:19 +03:00
parent 7edca0b5e6
commit 7669dff7a6
9 changed files with 25 additions and 10 deletions

View File

@@ -1,8 +1,6 @@
// CGame.cpp // CGame.cpp
// //
#include "CGame.h" #include "CGame.h"
#include "CUserInput.h"
#include <random>
void CGame::Init() void CGame::Init()
{ {
@@ -43,7 +41,11 @@ void CGame::Start()
do do
{ {
PrintGameHeader(); PrintGameHeader();
#ifdef _DEBUG
ShowGuessedNumber(true);
#else
ShowGuessedNumber(false); ShowGuessedNumber(false);
#endif // DEBUG
PrintSteps(); PrintSteps();
ret = GetNumber(step); ret = GetNumber(step);
switch (ret) switch (ret)

View File

@@ -1,7 +1,7 @@
// CGame.h // CGame.h
// //
#pragma once #pragma once
#include "defines.h" #include "headers.h"
#include "CUserInput.h" #include "CUserInput.h"
#include "CStep.h" #include "CStep.h"

View File

@@ -1,7 +1,7 @@
// CStep.h // CStep.h
// //
#pragma once #pragma once
#include <vector> #include "headers.h"
class CStep class CStep
{ {

View File

@@ -1,11 +1,7 @@
// CUserInput.h // CUserInput.h
// //
#pragma once #pragma once
#include "defines.h" #include "headers.h"
#include <iostream>
#include <string>
#include <vector>
#include <cwctype>
class CUserInput class CUserInput
{ {

View File

@@ -142,6 +142,7 @@
<ClInclude Include="CStep.h" /> <ClInclude Include="CStep.h" />
<ClInclude Include="CUserInput.h" /> <ClInclude Include="CUserInput.h" />
<ClInclude Include="defines.h" /> <ClInclude Include="defines.h" />
<ClInclude Include="headers.h" />
</ItemGroup> </ItemGroup>
<Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" /> <Import Project="$(VCTargetsPath)\Microsoft.Cpp.targets" />
<ImportGroup Label="ExtensionTargets"> <ImportGroup Label="ExtensionTargets">

View File

@@ -47,5 +47,8 @@
<ClInclude Include="defines.h"> <ClInclude Include="defines.h">
<Filter>Header Files</Filter> <Filter>Header Files</Filter>
</ClInclude> </ClInclude>
<ClInclude Include="headers.h">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup> </ItemGroup>
</Project> </Project>

View File

@@ -1,6 +1,6 @@
// bulls-and-cows.cpp // bulls-and-cows.cpp
// //
#include <Windows.h> #include "headers.h"
#include "..\..\..\MyFunctions\SetUserLocale.h" #include "..\..\..\MyFunctions\SetUserLocale.h"
#include "CGame.h" #include "CGame.h"

View File

@@ -1,3 +1,5 @@
// defines.h
//
#pragma once #pragma once
#define VERSION 0.3 #define VERSION 0.3

View File

@@ -0,0 +1,11 @@
// headers.h
//
#pragma once
#include <Windows.h>
#include <iostream>
#include <random>
#include <string>
#include <vector>
#include <cwctype>
#include "defines.h"