Compare commits
13 Commits
Menu_Featu
...
aa06318c07
Author | SHA1 | Date | |
---|---|---|---|
aa06318c07
|
|||
7695efa5d3
|
|||
c38f134254
|
|||
99c644bffb
|
|||
4602cbe187
|
|||
0a1f3d1e26
|
|||
4cf45f75bc
|
|||
4bf1447673
|
|||
27b684c550
|
|||
47b6a82be8
|
|||
af5b4ceb66
|
|||
36558c0c7c
|
|||
2d9d1d1eb3
|
@@ -7,4 +7,8 @@ indent_style = space
|
||||
trim_trailing_whitespace = true
|
||||
|
||||
[*.{cc,cpp,hpp,h}]
|
||||
insert_final_newline = true
|
||||
insert_final_newline = true
|
||||
|
||||
[makefile]
|
||||
indent_size = 4
|
||||
indent_style = tab
|
3
.gitignore
vendored
3
.gitignore
vendored
@@ -1,3 +1,4 @@
|
||||
.vscode/
|
||||
*.exe
|
||||
*.txt
|
||||
*.txt
|
||||
chess
|
8
.idea/.gitignore
generated
vendored
8
.idea/.gitignore
generated
vendored
@@ -1,8 +0,0 @@
|
||||
# Default ignored files
|
||||
/shelf/
|
||||
/workspace.xml
|
||||
# Editor-based HTTP Client requests
|
||||
/httpRequests/
|
||||
# Datasource local storage ignored files
|
||||
/dataSources/
|
||||
/dataSources.local.xml
|
2
.idea/TurboSchach.iml
generated
2
.idea/TurboSchach.iml
generated
@@ -1,2 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<module classpath="CIDR" type="CPP_MODULE" version="4" />
|
580
.idea/editor.xml
generated
580
.idea/editor.xml
generated
@@ -1,580 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="BackendCodeEditorSettings">
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppClangFormat/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/EditorConfig/EnableClangFormatSupport/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_BINARY_EXPRESSIONS_CHAIN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_CALLS_CHAIN/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXPRESSION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_FOR_STMT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTIPLE_DECLARATION/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_TERNARY/@EntryValue" value="ALIGN_ALL" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_CLASS_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_DECLARATIONS/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_BLANK_LINES_IN_CODE/@EntryValue" value="2" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/KEEP_USER_LINEBREAKS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CASE_FROM_SWITCH/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_COMMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INT_ALIGN_EQ/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SIMPLE_BLOCK_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COMMA_IN_TEMPLATE_PARAMS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_SEMICOLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_SEMICOLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_UNARY_OPERATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_ARRAY_ACCESS_BRACKETS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_METHOD_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_INITIALIZER_BRACES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPECIAL_ELSE_IF_TREATMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_CAST_EXPRESSION_PARENTHESES/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_BINARY_OPSIGN/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_TERNARY_OPSIGNS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TYPE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/OTHER_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CASE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DECLARATION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_FUNCTION_DEFINITION/@EntryValue" value="1" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_WHILE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_ELSE_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_CATCH_ON_NEW_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_INDENTATION/@EntryValue" value="All" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_ARGUMENT/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_EXTENDS_LIST/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_PARAMETER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_ARGUMENT/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ALIGN_MULTILINE_TYPE_PARAMETER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BLANK_LINES_AROUND_DECLARATIONS/@EntryValue" value="0" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_ACCESS_SPECIFIERS_FROM_CLASS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_CLASS_MEMBERS_FROM_ACCESS_SPECIFIERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/LINE_BREAK_AFTER_COLON_IN_MEMBER_INITIALIZER_LISTS/@EntryValue" value="ON_SINGLE_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/MEMBER_INITIALIZER_LIST_STYLE/@EntryValue" value="DO_NOT_CHANGE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/PLACE_NAMESPACE_DEFINITIONS_ON_SAME_LINE/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_COLON_IN_BITFIELD_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_EXTENDS_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_FOR_COLON/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_FOR_COLON/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_PTR_IN_NESTED_DECLARATOR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBER/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_DATA_MEMBERS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_AFTER_REF_IN_METHOD/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_PTR_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_ABSTRACT_DECL/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBER/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_DATA_MEMBERS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_REF_IN_METHOD/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BEFORE_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_BETWEEN_CLOSING_ANGLE_BRACKETS_IN_TEMPLATE_ARGS/@EntryValue" value="true" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_ARGS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_TEMPLATE_PARAMS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_DECLARATION_PARENTHESES/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/SPACE_WITHIN_EMPTY_BLOCKS/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_INVOCATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_INVOCATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_AFTER_DECLARATION_LPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_BEFORE_DECLARATION_RPAR/@EntryValue" value="false" type="bool" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_ARGUMENTS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/WRAP_PARAMETERS_STYLE/@EntryValue" value="WRAP_IF_LONG" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/BREAK_TEMPLATE_DECLARATION/@EntryValue" value="LINE_BREAK" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/NAMESPACE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/FREE_BLOCK_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INVOCABLE_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/ANONYMOUS_METHOD_DECLARATION_BRACES/@EntryValue" value="END_OF_LINE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INITIALIZER_BRACES/@EntryValue" value="END_OF_LINE_NO_SPACE" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_STYLE/@EntryValue" value="Space" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/INDENT_SIZE/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/CONTINUOUS_LINE_INDENT/@EntryValue" value="Double" type="string" />
|
||||
<option name="/Default/CodeStyle/CodeFormatting/CppFormatting/TAB_WIDTH/@EntryValue" value="4" type="int" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexedValue" value="ERROR" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexedValue" value="SUGGESTION" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexedValue" value="WARNING" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexedValue" value="HINT" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexedValue" value="DO_NOT_SHOW" type="string" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSmartPointerVsMakeFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCStyleCast/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionalStyleCast/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReinterpretCastFromVoidPtr/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConvertingConstructor/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExplicitConversionOperator/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDiscardedPostfixOperatorResult/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstValueFunctionReturnType/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeConst/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberFunctionMayBeStatic/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMayBeConst/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConst/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVariableCanBeMadeConstexpr/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterMayBeConstPtrOrRef/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPassValueParameterByConstReference/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppThrowExpressionCanBeReplacedWithRethrow/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroConstantCanBeReplacedWithNullptr/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCompileTimeConstantCanBeReplacedWithBooleanConstant/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIfCanBeReplacedByConstexprIf/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IfStdIsConstantEvaluatedCanBeReplaced/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StdIsConstantEvaluatedWillAlwaysEvaluateToConstant/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=ConstevalIfIsAlwaysConstant/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassCanBeFinal/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStructuredBinding/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseTypeTraitAlias/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAlgorithmWithCount/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseRangeAlgorithm/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseElementsView/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseStdSize/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForLoopCanBeReplacedWithWhile/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppJoinDeclarationAndAssignment/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceTieWithStructuredBinding/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReplaceMemsetWithZeroInitialization/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAssociativeContains/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseEraseAlgorithm/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseFamiliarTemplateSyntaxForGenericLambdas/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScope/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTooWideScopeInitStatement/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantNamespaceDefinition/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineFunctionDefinitionInHeaderFile/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonInlineVariableDefinitionInHeaderFile/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionIsNotImplemented/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrivateSpecialMemberFunctionIsNotImplemented/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHiddenFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHidingFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPolymorphicClassWithNonVirtualPublicDestructor/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractClassWithoutSpecifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompleteSwitchStatement/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultCaseNotHandledInSwitchStatement/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyErroneousEmptyStatements/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExpressionWithoutSideEffects/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNoDiscardExpression/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionResultShouldBeUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingKeywordThrow/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTypeWithoutTypenameKeyword/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDependentTemplateWithoutTemplateKeyword/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppImplicitDefaultConstructorNotAvailable/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeedsConstructorBecauseOfUninitializedMember/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedNonStaticDataMember/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRangeBasedForIncompatibleReference/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppZeroValuedExpressionUsedAsNullPointer/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUnintendedObjectSlicing/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPossiblyUninitializedMember/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorDisambiguatedAsFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionInFinalClass/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMustBePublicVirtualToImplementInterface/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationSpecifierWithoutDeclarators/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEmptyDeclaration/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesLocal/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclarationHidesUncapturedLocal/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMismatchedClassTags/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUsingResultOfAssignmentAsCondition/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIntegralToPointerConversion/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerToIntegralConversion/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIncompatiblePointerConversion/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPointerConversionDropsQualifiers/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStringLiteralToCharPointerConversion/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNonExceptionSafeResourceAcquisition/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVirtualFunctionCallInsideCtor/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractVirtualFunctionCallInCtor/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInvalidLineContinuation/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfBadFormat/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfRiskyFormat/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfMissedArg/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrintfExtraArg/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatBadCode/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatLegacyCode/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatMixedArgs/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooFewArgs/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBoostFormatTooManyArgs/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedEntity/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMissingIncludeGuard/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenSyntaxError/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUnresolvedReference/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDoxygenUndocumentedParameter/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeletingVoidPointer/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppBooleanIncrementExpression/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeprecatedRegisterStorageClassSpecifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppIdenticalOperandsInBinaryExpression/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEqualOperandsInBinaryExpression/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedefinitionOfDefaultArgumentInOverrideFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnamedNamespaceInHeaderFile/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNamesMismatch/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultedSpecialMemberFunctionIsImplicitlyDeleted/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNodiscardFunctionWithoutReturnValue/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantComplexityInComparison/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAbstractFinalClass/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSpecialFunctionWithoutNoexceptSpecification/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnsignedZeroComparison/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterLiteral/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMultiCharacterWideLiteral/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantQualifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantAccessSpecifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAccessSpecifierWithNoDeclarations/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTypenameKeyword/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateKeyword/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeyword/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElseKeywordInsideCompoundStatement/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantControlFlowJump/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyStatement/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantEmptyDeclaration/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantParentheses/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantLambdaParameterList/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantCastExpression/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppHeaderHasBeenAlreadyIncluded/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateArgumentsCanBeDeduced/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantTemplateArguments/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticSpecifierOnAnonymousNamespaceMember/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnMemberAllocationFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantStaticSpecifierOnThreadLocalLocalVariable/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassAccessSpecifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantInlineSpecifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConstSpecifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBooleanExpressionArgument/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantVoidArgumentList/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantMemberInitializer/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantBaseClassInitializer/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConstParameterInDeclaration/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppVolatileParameterInDeclaration/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalFunctionInFinalClass/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFinalNonOverridingVirtualFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantElaboratedTypeSpecifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantDereferencingAndTakingAddress/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantConditionalExpression/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConditionalExpressionCanBeSimplified/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantExportKeyword/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRedundantZeroInitializerInAggregateInitialization/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUserDefinedLiteralSuffixDoesNotStartWithUnderscore/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassIsIncomplete/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterShadowing/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMutableSpecifierOnReferenceMember/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultInitializationWithNoUserConstructor/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppExplicitSpecializationInNonNamespaceScope/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnionMemberOfReferenceType/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUninitializedDependentBaseClass/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderIsNotIncluded/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppPrecompiledHeaderNotFound/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCoroutineCallResolveError/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppAwaiterTypeIsNotClass/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppOutParameterMustBeWritten/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWarningDirective/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticAssertFailure/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEvaluationFailure/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTypeAliasNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppConceptNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppClassNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnumeratorNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLambdaCaptureNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableWithNonTrivialDtorIsNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppParameterNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTemplateParameterNeverUsed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityAssignedButNoRead/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEntityUsedOnlyInUnevaluatedContext/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLocalVariableMightNotBeInitialized/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppObjectMemberMightNotBeInitialized/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppSomeObjectMembersMightNotBeInitialized/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDeclaratorUsedBeforeInitialization/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnusedIncludeDirective/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppNotAllPathsReturnValue/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CDeclarationWithImplicitIntType/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppFunctionDoesntReturnValue/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppReturnNoValueInNonVoidFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppCVQualifierCanNotBeAppliedToReference/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDereferenceOperatorLimitExceeded/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppForwardEnumDeclarationWithoutUnderlyingType/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaRegionDirective/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnmatchedPragmaEndRegionDirective/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppStaticDataMemberInUnnamedStruct/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDefaultIsUsedAsIdentifier/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppLongFloat/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtReinterpretCastFromNullptr/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtBindingRValueToLvalueReference/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtAddressOfClassRValue/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtDoubleUserConversionInCopyInit/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtCopyElisionInCopyInitDeclarator/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMsExtNotInitializedStaticConstLocalVar/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppRemoveRedundantBraces/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceIfStatementBraces/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceForStatementBraces/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceWhileStatementBraces/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceDoStatementBraces/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongIncludesOrder/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppWrongSlashesInIncludeDirective/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceNestedNamespacesStyle/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceTypeAliasCodeStyle/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceFunctionDeclarationStyle/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppMemberInitializersOrder/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingFunctionStyle/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceOverridingDestructorStyle/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAuto/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUseAutoForNumeric/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersPlacement/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppEnforceCVQualifiersOrder/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppUnnecessaryWhitespace/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppTabsAreDisallowed/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantConditions/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANullDereference/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFANotInitializedField/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALoopConditionNotUpdated/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFADeletedPointer/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAMemoryLeak/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInvalidatedMemory/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesScope/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFALocalValueEscapesFunction/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantParameter/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAConstantFunctionResult/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAArrayIndexOutOfBounds/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableCode/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreachableFunctionCall/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAEndlessLoop/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAInfiniteRecursion/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnusedValue/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFAUnreadVariable/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppDFATimeOver/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CppInconsistentNaming/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=StringLiteralTypo/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=CommentTypo/@EntryIndexRemoved" />
|
||||
<option name="/Default/CodeInspection/Highlighting/InspectionSeverities/=IdentifierTypo/@EntryIndexRemoved" />
|
||||
</component>
|
||||
</project>
|
8
.idea/modules.xml
generated
8
.idea/modules.xml
generated
@@ -1,8 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="ProjectModuleManager">
|
||||
<modules>
|
||||
<module fileurl="file://$PROJECT_DIR$/.idea/TurboSchach.iml" filepath="$PROJECT_DIR$/.idea/TurboSchach.iml" />
|
||||
</modules>
|
||||
</component>
|
||||
</project>
|
6
.idea/vcs.xml
generated
6
.idea/vcs.xml
generated
@@ -1,6 +0,0 @@
|
||||
<?xml version="1.0" encoding="UTF-8"?>
|
||||
<project version="4">
|
||||
<component name="VcsDirectoryMappings">
|
||||
<mapping directory="" vcs="Git" />
|
||||
</component>
|
||||
</project>
|
@@ -127,6 +127,54 @@ ChessPiecePosition ChessPiece::GetPosition() {
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets all chess piece positions of the chess piece which are still protective for the king.
|
||||
* Any position between the attacker chess piece and the current chess piece is protective for the king.
|
||||
* The position is also protective for the king if the chess piece can beat the attacker chess piece.
|
||||
* @param chessboard A pointer to the chessboard.
|
||||
* @param positions A set of positions the chess piece can move next (also positions are not protective).
|
||||
* @return A set of chess piece positions which are still protective for the king.
|
||||
*/
|
||||
std::set<ChessPiecePosition> ChessPiece::GetProtectivePositions(Chessboard* chessboard, std::set<ChessPiecePosition> positions) {
|
||||
ChessPiece* chessPieceKing = chessboard->GetChessPieceKing(this->GetColor());
|
||||
std::set<ChessPiecePosition> protectivePositions;
|
||||
|
||||
for (ChessPiece* chessPiece : chessboard->GetChessPieces()) {
|
||||
if (chessPiece->GetColor() != this->GetColor()) {
|
||||
std::set<ChessPiecePosition> positionsStay = chessPiece->GetNextPositions(chessboard, {});
|
||||
std::set<ChessPiecePosition> positionsMove = chessPiece->GetNextPositions(chessboard, {this->GetPosition()});
|
||||
|
||||
if (positionsStay.count(chessPieceKing->GetPosition()) == 0 && positionsMove.count(chessPieceKing->GetPosition()) == 1) {
|
||||
|
||||
// the position is protective if the current chess piece can beat the attacker chess piece.
|
||||
if (positions.count(chessPiece->GetPosition()) == 1) {
|
||||
protectivePositions.insert(chessPiece->GetPosition());
|
||||
}
|
||||
|
||||
// every position between the current chess piece and the attacker chess piece is also protective.
|
||||
std::string step = ChessPiecePosition::GetStep(chessPiece->GetPosition(), chessPieceKing->GetPosition());
|
||||
|
||||
if (step.empty()) {
|
||||
continue;
|
||||
}
|
||||
|
||||
ChessPiecePosition currentPosition = chessPiece->GetPosition();
|
||||
ChessPiecePosition* nextPosition = ¤tPosition;
|
||||
|
||||
while (nextPosition = nextPosition->NextFromString(step)) {
|
||||
if (nextPosition->ToString() == this->GetPosition().ToString()) {
|
||||
break;
|
||||
} else if (positions.count(*nextPosition) == 1) {
|
||||
protectivePositions.insert(*nextPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return protectivePositions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a set of all positions along the rank.
|
||||
* @param chessboard A pointer to the chessboard.
|
||||
@@ -300,7 +348,7 @@ void ChessPiece::SetPosition(ChessPiecePosition position) {
|
||||
*/
|
||||
void ChessPiece::UpdateNextPositions(Chessboard* chessboard) {
|
||||
if (this->IsProtective(chessboard)) {
|
||||
this->SetNextPositions({});
|
||||
this->SetNextPositions(this->GetProtectivePositions(chessboard, this->GetNextPositions(chessboard)));
|
||||
} else {
|
||||
this->SetNextPositions(this->GetNextPositions(chessboard));
|
||||
}
|
||||
|
@@ -14,6 +14,8 @@ class ChessPiece {
|
||||
ChessPieceColor _color;
|
||||
std::vector<ChessPiecePosition> _positions;
|
||||
std::set<ChessPiecePosition> _positions_next;
|
||||
std::set<ChessPiecePosition> GetProtectivePositions(Chessboard* chessboard, std::set<ChessPiecePosition> positions);
|
||||
bool IsProtective(Chessboard* chessboard);
|
||||
|
||||
protected:
|
||||
char _char = '\0';
|
||||
@@ -46,7 +48,6 @@ class ChessPiece {
|
||||
bool IsKing();
|
||||
bool IsKnight();
|
||||
bool IsPawn();
|
||||
bool IsProtective(Chessboard* chessboard);
|
||||
bool IsQueen();
|
||||
bool IsRook();
|
||||
void SetPosition(ChessPiecePosition position);
|
||||
|
171
ChessPieces/ChessPieceMove.cpp
Normal file
171
ChessPieces/ChessPieceMove.cpp
Normal file
@@ -0,0 +1,171 @@
|
||||
#include "../ChessPieces/ChessPieceMove.hpp"
|
||||
|
||||
/**
|
||||
* Creates a new move of a chess piece that uses the short algebraic notation.
|
||||
* @param move The move that uses the short algebraic notation.
|
||||
*/
|
||||
ChessPieceMove::ChessPieceMove(std::string move) {
|
||||
move = this->Normalize(move);
|
||||
|
||||
if (this->IsValidShortNotation(move)) {
|
||||
this->_move = move;
|
||||
this->ParseShortNotation();
|
||||
} else {
|
||||
throw std::invalid_argument("invalid move notation");
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the move is a valid move that uses the short algebraic notation.
|
||||
* @return Status whether the move is a valid move that uses the short algebraic notation.
|
||||
*/
|
||||
bool ChessPieceMove::IsValidShortNotation(std::string move) {
|
||||
if (move.empty()) {
|
||||
return std::regex_match(this->_move, this->_notation);
|
||||
} else {
|
||||
return std::regex_match(move, this->_notation);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Normalizes the move which, if valid, can then be parsed.
|
||||
* @param move The move to be normalized.
|
||||
* @return The normalized move which, if valid, can then be parsed.
|
||||
*/
|
||||
std::string ChessPieceMove::Normalize(std::string move) {
|
||||
std::replace(move.begin(), move.end(), 'O', '0'); // castling: portable game notation to algebraic notation
|
||||
std::replace(move.begin(), move.end(), 'S', 'N'); // german notation to english notation (knight)
|
||||
std::replace(move.begin(), move.end(), 'L', 'B'); // german notation to english notation (bishop)
|
||||
std::replace(move.begin(), move.end(), 'T', 'R'); // german notation to english notation (queen)
|
||||
return move;
|
||||
}
|
||||
|
||||
/**
|
||||
* Parses a move that uses the short algebraic notation.
|
||||
*/
|
||||
void ChessPieceMove::ParseShortNotation() {
|
||||
std::smatch parts;
|
||||
std::regex_search(this->_move, parts, this->_notation);
|
||||
this->_chessPiece = parts[1].str();
|
||||
this->_fromPositionFile = parts[2].str();
|
||||
this->_fromPositionRank = parts[3].str();
|
||||
this->_capture = parts[4].str();
|
||||
this->_toPositionFile = parts[5].str();
|
||||
this->_toPositionRank = parts[6].str();
|
||||
this->_promotion = parts[7].str();
|
||||
this->_castling = parts[8].str();
|
||||
this->_draw = parts[9].str();
|
||||
this->_additional = parts[10].str();
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the chess piece char of the move.
|
||||
* @return The chess piece char of the move.
|
||||
*/
|
||||
char ChessPieceMove::GetChessPieceChar() {
|
||||
return this->_chessPiece.empty() ? 'P' : this->_chessPiece[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the file part of the source position.
|
||||
* @return The file part of the source position.
|
||||
*/
|
||||
char ChessPieceMove::GetFromPositionFile() {
|
||||
return this->_fromPositionFile.empty() ? '\0' : this->_fromPositionFile[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the rank part of the source position.
|
||||
* @return The rank part of the source position.
|
||||
*/
|
||||
int ChessPieceMove::GetFromPositionRank() {
|
||||
return this->_fromPositionRank.empty() ? 0 : stoi(this->_fromPositionRank);
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the chess piece character of the promotion.
|
||||
* @return The chess piece character of the promotion.
|
||||
*/
|
||||
char ChessPieceMove::GetPromotionChessPieceChar() {
|
||||
return this->_promotion.empty() ? '\0' : this->_promotion[this->_promotion.length() - 1];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the file part of the target position.
|
||||
* @return The file part of the target position.
|
||||
*/
|
||||
char ChessPieceMove::GetToPositionFile() {
|
||||
return this->_toPositionFile.empty() ? '\0' : this->_toPositionFile[0];
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the rank part of the target position.
|
||||
* @return The rank part of the target position.
|
||||
*/
|
||||
int ChessPieceMove::GetToPositionRank() {
|
||||
return this->_toPositionRank.empty() ? 0 : stoi(this->_toPositionRank);
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the move is a move with capture.
|
||||
* @return Status whether the move is a move with capture.
|
||||
*/
|
||||
bool ChessPieceMove::IsCapture() {
|
||||
return this->_capture == "x" ? true : false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the move results in a check.
|
||||
* @return Status whether the move results in a check.
|
||||
*/
|
||||
bool ChessPieceMove::IsCheck() {
|
||||
return this->_additional == "+";
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the move results in a checkmate.
|
||||
* @return Status whether the move results in a checkmate.
|
||||
*/
|
||||
bool ChessPieceMove::IsCheckmate() {
|
||||
return this->_additional == "++" || this->_additional == "#";
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the move is a offer for a draw.
|
||||
* @return Status whether the move is a offer for a draw.
|
||||
*/
|
||||
bool ChessPieceMove::IsDrawOffer() {
|
||||
return this->_draw == "(=)";
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the move is an "en passant" by pawn.
|
||||
* @return Status whether the move is an "en passant" by pawn.
|
||||
*/
|
||||
bool ChessPieceMove::IsEnPassant() {
|
||||
return this->_additional == "e.p.";
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the move is the long castling (castling queenside).
|
||||
* @return Status whether the move is the long castling (castling queenside).
|
||||
*/
|
||||
bool ChessPieceMove::IsLongCastling() {
|
||||
return this->_castling == "0-0-0";
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the move is the short castling (castling kingside).
|
||||
* @return Status whether the move is the short castling (castling kingside).
|
||||
*/
|
||||
bool ChessPieceMove::IsShortCastling() {
|
||||
return this->_castling == "0-0";
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the move of the chess piece as string value.
|
||||
* @return The move of the chess piece as string value.
|
||||
*/
|
||||
std::string ChessPieceMove::ToString() {
|
||||
return (this->IsValidShortNotation()) ? this->_move : "";
|
||||
}
|
42
ChessPieces/ChessPieceMove.hpp
Normal file
42
ChessPieces/ChessPieceMove.hpp
Normal file
@@ -0,0 +1,42 @@
|
||||
#ifndef ChessPieceMove_H
|
||||
#define ChessPieceMove_H
|
||||
|
||||
#include <regex>
|
||||
|
||||
class ChessPieceMove {
|
||||
private:
|
||||
std::string _chessPiece;
|
||||
std::string _fromPositionFile;
|
||||
std::string _fromPositionRank;
|
||||
std::string _capture;
|
||||
std::string _toPositionFile;
|
||||
std::string _toPositionRank;
|
||||
std::string _promotion;
|
||||
std::string _castling;
|
||||
std::string _draw;
|
||||
std::string _additional;
|
||||
std::string _move;
|
||||
const std::regex _notation = std::regex("^(?:([RNBQKP]?)([a-h]?)([1-8]?)(x?)([a-h])([1-8])((?:[=])?[QRBN])?|(0-0(?:-0)?)|(\\(=\\)))([+#!?]| e.p.)*$");
|
||||
std::string Normalize(std::string move);
|
||||
void ParseShortNotation();
|
||||
|
||||
public:
|
||||
ChessPieceMove(std::string move);
|
||||
bool IsValidShortNotation(std::string move = "");
|
||||
char GetChessPieceChar();
|
||||
char GetFromPositionFile();
|
||||
int GetFromPositionRank();
|
||||
bool IsCapture();
|
||||
char GetToPositionFile();
|
||||
int GetToPositionRank();
|
||||
char GetPromotionChessPieceChar();
|
||||
bool IsShortCastling();
|
||||
bool IsLongCastling();
|
||||
bool IsDrawOffer();
|
||||
bool IsCheck();
|
||||
bool IsCheckmate();
|
||||
bool IsEnPassant();
|
||||
std::string ToString();
|
||||
};
|
||||
|
||||
#endif
|
@@ -56,18 +56,18 @@ std::string ChessPiecePosition::GetDifference(ChessPiecePosition fromPosition, C
|
||||
} else {
|
||||
std::string difference;
|
||||
|
||||
if (toPosition.GetFile() < fromPosition.GetFile()) {
|
||||
difference.append(std::string(1, ChessPiecePosition::_MOVE_LEFT) + std::to_string(fromPosition.GetFile() - toPosition.GetFile()));
|
||||
} else if (toPosition.GetFile() > fromPosition.GetFile()) {
|
||||
difference.append(std::string(1, ChessPiecePosition::_MOVE_RIGHT) + std::to_string(toPosition.GetFile() - fromPosition.GetFile()));
|
||||
}
|
||||
|
||||
if (toPosition.GetRank() < fromPosition.GetRank()) {
|
||||
difference.append(std::string(1, ChessPiecePosition::_MOVE_BOTTOM) + std::to_string(fromPosition.GetRank() - toPosition.GetRank()));
|
||||
} else if (toPosition.GetRank() > fromPosition.GetRank()) {
|
||||
difference.append(std::string(1, ChessPiecePosition::_MOVE_TOP) + std::to_string(toPosition.GetRank() - fromPosition.GetRank()));
|
||||
}
|
||||
|
||||
if (toPosition.GetFile() < fromPosition.GetFile()) {
|
||||
difference.append(std::string(1, ChessPiecePosition::_MOVE_LEFT) + std::to_string(fromPosition.GetFile() - toPosition.GetFile()));
|
||||
} else if (toPosition.GetFile() > fromPosition.GetFile()) {
|
||||
difference.append(std::string(1, ChessPiecePosition::_MOVE_RIGHT) + std::to_string(toPosition.GetFile() - fromPosition.GetFile()));
|
||||
}
|
||||
|
||||
return difference;
|
||||
}
|
||||
}
|
||||
|
@@ -34,7 +34,33 @@ std::set<ChessPiecePosition> King::GetNextPositions(Chessboard* chessboard, std:
|
||||
ChessPieceColor opponentColor = (this->GetColor() == ChessPieceColor::Black) ? ChessPieceColor::White : ChessPieceColor::Black;
|
||||
|
||||
if (chessboard->IsPositionUnderAttack(*nextPosition, opponentColor) == false) {
|
||||
positions.insert(*nextPosition);
|
||||
bool isUnderAttackAfterMove = false;
|
||||
|
||||
// Positions are ignored which are still under attack after the king has moved.
|
||||
// There are fields under attack which are in the shadow of the king.
|
||||
for (ChessPiece* chessPiece : chessboard->GetChessPieces()) {
|
||||
if (chessPiece && chessPiece->GetColor() != this->GetColor()) {
|
||||
if (chessPiece->GetNextPositions().count(this->GetPosition()) == 1) {
|
||||
if (chessPiece->GetNextPositions(chessboard, {this->GetPosition(), *nextPosition}).count(*nextPosition) == 1) {
|
||||
isUnderAttackAfterMove = true;
|
||||
break;
|
||||
}
|
||||
} else if (chessPiece->IsKing()) {
|
||||
for (std::string nextMove : {"T1", "T1L1", "T1R1", "R1", "L1", "B1", "B1L1", "B1R1"}) {
|
||||
ChessPiecePosition* nextPositionKing = chessPiece->GetPosition().NextFromString(nextMove);
|
||||
|
||||
if (nextPositionKing && *nextPosition == *nextPositionKing) {
|
||||
isUnderAttackAfterMove = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isUnderAttackAfterMove == false) {
|
||||
positions.insert(*nextPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -21,148 +21,70 @@ std::set<ChessPiecePosition> Pawn::GetNextPositions(Chessboard* chessboard, std:
|
||||
std::set<ChessPiecePosition> positions;
|
||||
ChessPiecePosition currentPosition = this->GetPosition();
|
||||
ChessPiecePosition* nextPosition = ¤tPosition;
|
||||
std::vector<std::string> nextDiagonalPositions;
|
||||
std::string moveDifferenceOpponent;
|
||||
|
||||
if (this->GetColor() == ChessPieceColor::Black) {
|
||||
if (this->GetColor() == ChessPieceColor::White) {
|
||||
nextDiagonalPositions = {"T1L1", "T1R1"};
|
||||
moveDifferenceOpponent = "B2";
|
||||
} else {
|
||||
nextDiagonalPositions = {"B1L1", "B1R1"};
|
||||
moveDifferenceOpponent = "T2";
|
||||
}
|
||||
|
||||
// 3.7.1. The pawn may move forward to the square immediately in front of it on the same file, provided that this square is unoccupied.
|
||||
// 3.7.2. On its first move the pawn may move as in 3.7.1 or alternatively it may advance two squares along the same file, provided that both squares are unoccupied.
|
||||
for (int move = 1; move <= 2; move++) {
|
||||
nextPosition = nextPosition->NextBottom();
|
||||
std::string stepVertical = nextDiagonalPositions[0].substr(0, 2);
|
||||
|
||||
if (nextPosition) {
|
||||
if (chessboard->IsEmptyField(nextPosition) == false) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (move == 1) {
|
||||
positions.insert(*nextPosition);
|
||||
} else if (move == 2 && this->IsFirstMove()) {
|
||||
positions.insert(*nextPosition);
|
||||
}
|
||||
} else {
|
||||
// 3.7.1. The pawn may move forward to the square immediately in front of it on the same file, provided that this square is unoccupied.
|
||||
// 3.7.2. On its first move the pawn may move as in 3.7.1 or alternatively it may advance two squares along the same file, provided that both squares are unoccupied.
|
||||
for (int move = 1; move <= 2; move++) {
|
||||
if (nextPosition = nextPosition->NextFromString(stepVertical)) {
|
||||
if (chessboard->IsEmptyField(nextPosition) == false) {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 3.7.3. the pawn may move to a square occupied by an opponent's piece diagonally in front of it on an adjacent file, capturing that piece.
|
||||
for (std::string move : {"B1L1", "B1R1"}) {
|
||||
if (move == 1 || (move == 2 && this->IsFirstMove())) {
|
||||
positions.insert(*nextPosition);
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 3.7.3. the pawn may move to a square occupied by an opponent's piece diagonally in front of it on an adjacent file, capturing that piece.
|
||||
for (std::string moveDiagonal : nextDiagonalPositions) {
|
||||
nextPosition = ¤tPosition;
|
||||
nextPosition = nextPosition->NextFromString(moveDiagonal);
|
||||
|
||||
if (nextPosition && chessboard->IsEmptyField(nextPosition) == false) {
|
||||
ChessPiece* chessPiece = chessboard->GetChessPiece(nextPosition);
|
||||
|
||||
if (chessPiece->GetColor() != this->GetColor()) {
|
||||
positions.insert(*nextPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3.7.3.1. A pawn occupying a square on the same rank as and on an adjacent file to an opponent's pawn which has just advanced two squares
|
||||
// in one move from its original square may capture this opponent's pawn as though the latter had been moved only one square.
|
||||
// 3.7.3.2. This capture is only legal on the move following this advance and is called an "en passant" capture.
|
||||
if (chessboard->HasMoves()) {
|
||||
std::pair<ChessPiecePosition, ChessPiecePosition> lastMovePositions = chessboard->GetLastMovePositions();
|
||||
std::string moveDifference = ChessPiecePosition::GetDifference(lastMovePositions.first, lastMovePositions.second);
|
||||
|
||||
for (std::string nextDiagonalPosition : nextDiagonalPositions) {
|
||||
nextPosition = ¤tPosition;
|
||||
nextPosition = nextPosition->NextFromString(move);
|
||||
std::string stepDiagonal = nextDiagonalPosition.substr(2, 2);
|
||||
nextPosition = nextPosition->NextFromString(stepDiagonal);
|
||||
|
||||
if (nextPosition && chessboard->IsEmptyField(nextPosition) == false) {
|
||||
ChessPiece* chessPiece = chessboard->GetChessPiece(nextPosition);
|
||||
|
||||
if (chessPiece->GetColor() != this->GetColor()) {
|
||||
positions.insert(*nextPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
if (chessPiece->IsPawn() && chessPiece->GetColor() != this->GetColor()) {
|
||||
if (chessPiece->GetNumberOfMoves() == 1 && moveDifference == moveDifferenceOpponent && chessPiece->GetPosition() == lastMovePositions.second) {
|
||||
ChessPiecePosition* diagonalPosition = currentPosition.NextFromString(nextDiagonalPosition);
|
||||
|
||||
// 3.7.3.1. A pawn occupying a square on the same rank as and on an adjacent file to an opponent's pawn which has just advanced two squares
|
||||
// in one move from its original square may capture this opponent's pawn as though the latter had been moved only one square.
|
||||
// 3.7.3.2. This capture is only legal on the move following this advance and is called an "en passant" capture.
|
||||
if (chessboard->GetCountMoves() > 0) {
|
||||
std::pair<ChessPiecePosition, ChessPiecePosition> lastMove = chessboard->GetLastMove();
|
||||
std::string moveDifference = ChessPiecePosition::GetDifference(lastMove.first, lastMove.second);
|
||||
ChessPiecePosition* leftPosition = currentPosition.NextLeft();
|
||||
ChessPiecePosition* rightPosition = currentPosition.NextRight();
|
||||
|
||||
if (leftPosition && chessboard->IsEmptyField(leftPosition) == false) {
|
||||
ChessPiece* chessPiece = chessboard->GetChessPiece(leftPosition);
|
||||
|
||||
if (chessPiece->GetColor() != this->GetColor() && chessPiece->IsPawn()) {
|
||||
if (chessPiece->GetNumberOfMoves() == 1 && moveDifference == "T2" && chessPiece->GetPosition() == lastMove.second) {
|
||||
ChessPiecePosition* bottomLeftPosition = currentPosition.NextFromString("B1L1");
|
||||
|
||||
if (bottomLeftPosition && chessboard->IsEmptyField(bottomLeftPosition)) {
|
||||
positions.insert(*bottomLeftPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rightPosition && chessboard->IsEmptyField(rightPosition) == false) {
|
||||
ChessPiece* chessPiece = chessboard->GetChessPiece(rightPosition);
|
||||
|
||||
if (chessPiece->GetColor() != this->GetColor() && chessPiece->IsPawn()) {
|
||||
if (chessPiece->GetNumberOfMoves() == 1 && moveDifference == "T2" && chessPiece->GetPosition() == lastMove.second) {
|
||||
ChessPiecePosition* bottomRightPosition = currentPosition.NextFromString("B1R1");
|
||||
|
||||
if (bottomRightPosition && chessboard->IsEmptyField(bottomRightPosition)) {
|
||||
positions.insert(*bottomRightPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
} else if (this->GetColor() == ChessPieceColor::White) {
|
||||
|
||||
// 3.7.1. The pawn may move forward to the square immediately in front of it on the same file, provided that this square is unoccupied.
|
||||
// 3.7.2. On its first move the pawn may move as in 3.7.1 or alternatively it may advance two squares along the same file, provided that both squares are unoccupied.
|
||||
for (int move = 1; move <= 2; move++) {
|
||||
nextPosition = nextPosition->NextTop();
|
||||
|
||||
if (nextPosition) {
|
||||
if (chessboard->IsEmptyField(nextPosition) == false) {
|
||||
break;
|
||||
}
|
||||
|
||||
if (move == 1) {
|
||||
positions.insert(*nextPosition);
|
||||
} else if (move == 2 && this->IsFirstMove()) {
|
||||
positions.insert(*nextPosition);
|
||||
}
|
||||
} else {
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// 3.7.3. the pawn may move to a square occupied by an opponent's piece diagonally in front of it on an adjacent file, capturing that piece.
|
||||
for (std::string move : {"T1L1", "T1R1"}) {
|
||||
nextPosition = ¤tPosition;
|
||||
nextPosition = nextPosition->NextFromString(move);
|
||||
|
||||
if (nextPosition && chessboard->IsEmptyField(nextPosition) == false) {
|
||||
ChessPiece* chessPiece = chessboard->GetChessPiece(nextPosition);
|
||||
|
||||
if (chessPiece->GetColor() != this->GetColor()) {
|
||||
positions.insert(*nextPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// 3.7.3.1. A pawn occupying a square on the same rank as and on an adjacent file to an opponent's pawn which has just advanced two squares
|
||||
// in one move from its original square may capture this opponent's pawn as though the latter had been moved only one square.
|
||||
// 3.7.3.2. This capture is only legal on the move following this advance and is called an "en passant" capture.
|
||||
if (chessboard->GetCountMoves() > 0) {
|
||||
std::pair<ChessPiecePosition, ChessPiecePosition> lastMove = chessboard->GetLastMove();
|
||||
std::string moveDifference = ChessPiecePosition::GetDifference(lastMove.first, lastMove.second);
|
||||
ChessPiecePosition* leftPosition = currentPosition.NextLeft();
|
||||
ChessPiecePosition* rightPosition = currentPosition.NextRight();
|
||||
|
||||
if (leftPosition && chessboard->IsEmptyField(leftPosition) == false) {
|
||||
ChessPiece* chessPiece = chessboard->GetChessPiece(leftPosition);
|
||||
|
||||
if (chessPiece->GetColor() != this->GetColor() && chessPiece->IsPawn()) {
|
||||
if (chessPiece->GetNumberOfMoves() == 1 && moveDifference == "B2" && chessPiece->GetPosition() == lastMove.second) {
|
||||
ChessPiecePosition* topLeftPosition = currentPosition.NextFromString("T1L1");
|
||||
|
||||
if (topLeftPosition && chessboard->IsEmptyField(topLeftPosition)) {
|
||||
positions.insert(*topLeftPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (rightPosition && chessboard->IsEmptyField(rightPosition) == false) {
|
||||
ChessPiece* chessPiece = chessboard->GetChessPiece(rightPosition);
|
||||
|
||||
if (chessPiece->GetColor() != this->GetColor() && chessPiece->IsPawn()) {
|
||||
if (chessPiece->GetNumberOfMoves() == 1 && moveDifference == "B2" && chessPiece->GetPosition() == lastMove.second) {
|
||||
ChessPiecePosition* topRightPosition = currentPosition.NextFromString("T1R1");
|
||||
|
||||
if (topRightPosition && chessboard->IsEmptyField(topRightPosition)) {
|
||||
positions.insert(*topRightPosition);
|
||||
if (diagonalPosition && chessboard->IsEmptyField(diagonalPosition)) {
|
||||
positions.insert(*diagonalPosition);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
@@ -111,6 +111,16 @@ void Chessboard::draw (const std::vector<std::vector<char>>& chessboard) {
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
// ToDo:
|
||||
// Methode um mögliche Züge anzuzeigen
|
||||
// Rochade
|
||||
// Mate
|
||||
// Schachmate
|
||||
// En Passond
|
||||
// Restlichen moves
|
||||
// Angabe mit Menü Optionen als Zahlen
|
||||
// Figuren wählen mit Schachnotation
|
||||
|
||||
void Chessboard::init() {
|
||||
Chessboard::initPieces();
|
||||
}
|
||||
@@ -194,6 +204,9 @@ char Chessboard::getCorrectPiece(char pieceIdentifier) {
|
||||
|
||||
//
|
||||
void Chessboard::move(std::string move) {
|
||||
// ToDo:
|
||||
// add move to history queue
|
||||
|
||||
std::vector<std::string> splitMove;
|
||||
|
||||
if (move.find('#') != std::string::npos) {
|
||||
|
10
Chessboard.h
10
Chessboard.h
@@ -111,6 +111,16 @@ class Chessboard {
|
||||
|
||||
void draw (const std::vector<std::vector<char>>& chessboard);
|
||||
|
||||
// ToDo:
|
||||
// Methode um mögliche Züge anzuzeigen
|
||||
// Rochade
|
||||
// Mate
|
||||
// Schachmate
|
||||
// En Passond
|
||||
// Restlichen moves
|
||||
// Angabe mit Menü Optionen als Zahlen
|
||||
// Figuren wählen mit Schachnotation
|
||||
|
||||
void init();
|
||||
|
||||
void initPieces();
|
||||
|
@@ -1,56 +1,307 @@
|
||||
#include <memory>
|
||||
#include <set>
|
||||
#include "../Chessboard/Chessboard.hpp"
|
||||
#include "../ChessPieces/ChessPiece.hpp"
|
||||
#include "../ChessPieces/Knight.hpp"
|
||||
#include "../ChessPieces/Bishop.hpp"
|
||||
#include "../ChessPieces/King.hpp"
|
||||
#include "../ChessPieces/Pawn.hpp"
|
||||
#include "../ChessPieces/Queen.hpp"
|
||||
#include "../ChessPieces/Rook.hpp"
|
||||
#include "../ChessPieces/Queen.hpp"
|
||||
#include "../ChessPieces/Bishop.hpp"
|
||||
#include "../ChessPieces/Knight.hpp"
|
||||
#include "../ChessPieces/ChessPiece.hpp"
|
||||
|
||||
void Chessboard::InitializeStartBoard() {
|
||||
Chessboard::InitializeBoard(defaultBoard);
|
||||
/**
|
||||
* Gets the current player.
|
||||
* @return A pointer to the current player.
|
||||
*/
|
||||
Player* Chessboard::GetCurrentPlayer() {
|
||||
return this->currentPlayer;
|
||||
}
|
||||
|
||||
void Chessboard::InitializeBoard(std::set<Board_ChessPiece> board) {
|
||||
for (const auto& piece : board) {
|
||||
ChessPiecePosition pos = ChessPiecePosition(piece.position.first, piece.position.second);
|
||||
ChessPieceColor color = (piece.color == 0) ? ChessPieceColor::Black : ChessPieceColor::White;
|
||||
/**
|
||||
* Gets the history of all moves.
|
||||
* @return The history of all moves.
|
||||
*/
|
||||
std::vector<ChessPieceMove> Chessboard::GetHistoryMoves() {
|
||||
return this->_historyMoves;
|
||||
}
|
||||
|
||||
switch (piece.type) {
|
||||
case 'R':
|
||||
SetChessPiece(new Rook(color, pos));
|
||||
break;
|
||||
case 'N':
|
||||
SetChessPiece(new Knight(color, pos));
|
||||
break;
|
||||
case 'B':
|
||||
SetChessPiece(new Bishop(color, pos));
|
||||
break;
|
||||
case 'Q':
|
||||
SetChessPiece(new Queen(color, pos));
|
||||
break;
|
||||
case 'K':
|
||||
SetChessPiece(new King(color, pos));
|
||||
break;
|
||||
case 'P':
|
||||
SetChessPiece(new Pawn(color, pos));
|
||||
break;
|
||||
default:
|
||||
std::cout << "Invalid ChessPieceType!" << std::endl;
|
||||
return;
|
||||
}
|
||||
/**
|
||||
* Gets the history of all positions.
|
||||
* @return The history of all positions.
|
||||
*/
|
||||
std::vector<std::pair<ChessPiecePosition, ChessPiecePosition>> Chessboard::GetHistoryPositions() {
|
||||
return this->_historyPositions;
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets the opponent player.
|
||||
* @return A pointer to the opponent player.
|
||||
*/
|
||||
Player* Chessboard::GetOpponentPlayer() {
|
||||
if (this->GetCurrentPlayer()->GetColor() == ChessPieceColor::Black) {
|
||||
return this->GetPlayer(ChessPieceColor::White);
|
||||
} else {
|
||||
return this->GetPlayer(ChessPieceColor::Black);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Gets a player by the specified color.
|
||||
* @return Player* A pointer to the player with the specified color.
|
||||
*/
|
||||
Player* Chessboard::GetPlayer(ChessPieceColor color) {
|
||||
if (color == ChessPieceColor::Black) {
|
||||
return std::get<ChessPieceColor::Black>(this->players);
|
||||
} else {
|
||||
return std::get<ChessPieceColor::White>(this->players);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether moves have already been made.
|
||||
* @return Status whether moves have already been made.
|
||||
*/
|
||||
bool Chessboard::HasMoves() {
|
||||
return this->_historyMoves.size() > 0;
|
||||
}
|
||||
|
||||
/**
|
||||
* Load the chessboard from a PGN file.
|
||||
* @param filePath The file path of the PGN file to load.
|
||||
* @return The status whether the PGN file was loaded successfully.
|
||||
*/
|
||||
bool Chessboard::ImportFilePGN(std::string filePath) {
|
||||
std::ifstream pgnFile(filePath);
|
||||
std::regex rgxMetaInfo = std::regex("^[\\[]([A-Za-z]+) [\"](.*)[\"][\\]]$");
|
||||
std::regex rgxMoveInfo = std::regex("(?:([RNBQKP]?)([a-h]?)([1-8]?)(x?)([a-h])([1-8])((?:[=])?[QRBN])?|(O-O(?:-O)?)|(\\(=\\)))([+#!?]| e.p.)*");
|
||||
|
||||
if (pgnFile.is_open()) {
|
||||
Player* playerWhite;
|
||||
Player* playerBlack;
|
||||
int expectedNumberOfMoves = 0;
|
||||
std::vector<std::string> moves;
|
||||
|
||||
for(std::string line; getline(pgnFile, line);) {
|
||||
std::smatch parts;
|
||||
|
||||
if (std::regex_search(line, parts, rgxMetaInfo)) {
|
||||
std::string metaName = parts[1].str();
|
||||
std::string metaValue = parts[2].str();
|
||||
|
||||
if (metaName == "White") {
|
||||
playerWhite = new Player(metaValue);
|
||||
playerWhite->SetColor(ChessPieceColor::White);
|
||||
} else if (metaName == "Black") {
|
||||
playerBlack = new Player(metaValue);
|
||||
playerBlack->SetColor(ChessPieceColor::Black);
|
||||
} else if (metaName == "PlyCount") {
|
||||
expectedNumberOfMoves = std::stoi(metaValue);
|
||||
}
|
||||
} else {
|
||||
for (std::sregex_iterator rgxIterator = std::sregex_iterator(line.begin(), line.end(), rgxMoveInfo); rgxIterator != std::sregex_iterator(); ++rgxIterator) {
|
||||
parts = *rgxIterator;
|
||||
moves.push_back(parts[0].str());
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
pgnFile.close();
|
||||
|
||||
if (expectedNumberOfMoves != moves.size()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
this->players = {playerBlack, playerWhite};
|
||||
|
||||
for (std::string move : moves) {
|
||||
this->MoveChessPiece(move);
|
||||
}
|
||||
|
||||
return true;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the king of the current player is in checkmate.
|
||||
* @return Status whether the king of the current player is in checkmate.
|
||||
*/
|
||||
bool Chessboard::IsCheckmate() {
|
||||
int numberOfAttackers = 0;
|
||||
|
||||
if (this->IsInCheck() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ChessPiece* chessPieceKing = this->GetChessPieceKing(this->GetCurrentPlayer()->GetColor());
|
||||
|
||||
if (chessPieceKing == nullptr) {
|
||||
throw std::domain_error("king is missing");
|
||||
}
|
||||
|
||||
// it is not checkmate if the king can move to another position.
|
||||
if (chessPieceKing->GetNextPositions().size() > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
for (ChessPiece* chessPieceOpponent : this->GetChessPieces()) {
|
||||
if (chessPieceOpponent->GetColor() == this->GetOpponentPlayer()->GetColor()) {
|
||||
if (chessPieceOpponent->GetNextPositions().count(chessPieceKing->GetPosition()) == 1) {
|
||||
bool isDefensibleAttack = false;
|
||||
numberOfAttackers++;
|
||||
|
||||
// the attacker can be removed directly by another chess piece.
|
||||
for (ChessPiece* chessPieceCurrent : this->GetChessPieces()) {
|
||||
if (chessPieceCurrent->GetColor() == this->GetCurrentPlayer()->GetColor()) {
|
||||
if (chessPieceCurrent->GetNextPositions().count(chessPieceOpponent->GetPosition()) == 1) {
|
||||
isDefensibleAttack = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// the attacker is defensible.
|
||||
if (isDefensibleAttack == true) {
|
||||
std::cout << isDefensibleAttack << std::endl;
|
||||
continue;
|
||||
}
|
||||
|
||||
// check if a chess piece can move between the attacker and king.
|
||||
std::string step = ChessPiecePosition::GetStep(chessPieceOpponent->GetPosition(), chessPieceKing->GetPosition());
|
||||
|
||||
// there is no direct way between attacker and king. so the attacker is the knight.
|
||||
// in this case we can not defend the attack by moving a chess piece between attacker and king.
|
||||
if (step.empty()) {
|
||||
return true;
|
||||
}
|
||||
|
||||
ChessPiecePosition currentPosition = chessPieceOpponent->GetPosition();
|
||||
ChessPiecePosition* nextPosition = ¤tPosition;
|
||||
|
||||
while (nextPosition = nextPosition->NextFromString(step)) {
|
||||
if (*nextPosition == chessPieceKing->GetPosition()) break;
|
||||
|
||||
for (ChessPiece* chessPieceCurrent : this->GetChessPieces()) {
|
||||
if (chessPieceCurrent->GetColor() == this->GetCurrentPlayer()->GetColor()) {
|
||||
if (chessPieceCurrent->GetNextPositions().count(*nextPosition) == 1) {
|
||||
isDefensibleAttack = true;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (isDefensibleAttack == false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return numberOfAttackers > 1;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the king of the current player is in check.
|
||||
* @return Status whether the king of the current player is in check.
|
||||
*/
|
||||
bool Chessboard::IsInCheck() {
|
||||
ChessPieceColor currentPlayerColor = this->GetCurrentPlayer()->GetColor();
|
||||
ChessPiece* chessPieceKing = this->GetChessPieceKing(currentPlayerColor);
|
||||
|
||||
if (chessPieceKing == nullptr) {
|
||||
throw std::domain_error("king is missing");
|
||||
}
|
||||
|
||||
// 3.9 The king in check:
|
||||
// 3.9.1 The king is said to be "in check" if it is attacked by one or more of the opponent's pieces, even if such pieces are
|
||||
// constrained from moving to the square occupied by the king because they would then leave or place their own king in check.
|
||||
// 3.9.2 No piece can be moved that will either expose the king of the same colour to check or leave that king in check.
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->GetColor() == this->GetOpponentPlayer()->GetColor()) {
|
||||
if (field.second->GetNextPositions().count(chessPieceKing->GetPosition()) == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* Status whether the match ends with a draw because of stalemate.
|
||||
* @return Status whether the match ends with a draw because of stalemate.
|
||||
*/
|
||||
bool Chessboard::IsStalemate() {
|
||||
ChessPieceColor currentPlayerColor = this->GetCurrentPlayer()->GetColor();
|
||||
ChessPieceColor opponentPlayerColor = this->GetOpponentPlayer()->GetColor();
|
||||
ChessPiece* chessPieceKing = this->GetChessPieceKing(currentPlayerColor);
|
||||
|
||||
if (chessPieceKing == nullptr) {
|
||||
throw std::domain_error("king is missing");
|
||||
}
|
||||
|
||||
// 5.2.1 The game is drawn when the player to move has no legal move and his/her king is not in check.
|
||||
// The game is said to end in "stalemate". This immediately ends the game.
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->GetColor() == currentPlayerColor) {
|
||||
if (field.second->GetNextPositions().size() > 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (this->IsInCheck()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets a chess piece on the chessboard.
|
||||
* If there is already a chess piece on the field, the chess piece will be deleted.
|
||||
* @param chesspiece A pointer to the chess piece which is to be set.
|
||||
*/
|
||||
void Chessboard::SetChessPiece(ChessPiece* chesspiece) {
|
||||
this->chessboard[chesspiece->GetPosition()] = chesspiece;
|
||||
}
|
||||
|
||||
/*void Chessboard::SetChessPiece(std::unique_ptr<ChessPiece> piece) {
|
||||
this->chessboard[piece->GetPosition()] = piece.release();
|
||||
}*/
|
||||
/**
|
||||
* Sets the move to the history.
|
||||
* @param move The move to be added to the history.
|
||||
*/
|
||||
void Chessboard::SetToHistory(ChessPieceMove move) {
|
||||
this->_historyMoves.push_back(move);
|
||||
}
|
||||
|
||||
/**
|
||||
* Sets the source and target position to the history.
|
||||
* @param fromPosition The source position to be added to the history.
|
||||
* @param toPosition The target position to be added to the history.
|
||||
*/
|
||||
void Chessboard::SetToHistory(ChessPiecePosition fromPosition, ChessPiecePosition toPosition) {
|
||||
this->_historyPositions.push_back({fromPosition, toPosition});
|
||||
}
|
||||
|
||||
/**
|
||||
* Switches the current player.
|
||||
*/
|
||||
void Chessboard::SwitchCurrentPlayer() {
|
||||
this->currentPlayer = this->GetOpponentPlayer();
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
void Chessboard::RemoveChessPiece(ChessPiecePosition position) {
|
||||
if (this->chessboard.count(position) == 1) {
|
||||
delete this->chessboard[position];
|
||||
this->chessboard.erase(position);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
bool Chessboard::IsEmptyField(ChessPiecePosition* position) {
|
||||
return (this->chessboard.count(*position) == 0);
|
||||
@@ -60,41 +311,214 @@ ChessPiece* Chessboard::GetChessPiece(ChessPiecePosition* position) {
|
||||
return this->chessboard.at(*position);
|
||||
}
|
||||
|
||||
void Chessboard::MoveChessPiece(std::string move) {
|
||||
if (move.length() == 5) {
|
||||
ChessPiecePosition* fromPosition = new ChessPiecePosition(move.substr(0, 2));
|
||||
ChessPiecePosition* toPosition = new ChessPiecePosition(move.substr(3, 2));
|
||||
|
||||
ChessPiece* piece = this->GetChessPiece(fromPosition);
|
||||
|
||||
if (piece->GetColor() != this->GetCurrentPlayer()->GetColor()) {
|
||||
return; // wrong player
|
||||
}
|
||||
bool Chessboard::MoveCastling(ChessPieceColor color, bool shortCastling) {
|
||||
ChessPiecePosition fromPositionKing = (color == ChessPieceColor::White) ? ChessPiecePosition("E1") : ChessPiecePosition("E8");
|
||||
ChessPiecePosition fromPositionRook = (color == ChessPieceColor::White) ? ChessPiecePosition(shortCastling ? "H1" : "A1") : ChessPiecePosition(shortCastling ? "H8" : "A8");
|
||||
ChessPiecePosition toPositionKing = (color == ChessPieceColor::White) ? ChessPiecePosition(shortCastling ? "G1" : "C1") : ChessPiecePosition(shortCastling ? "G8" : "C8");
|
||||
ChessPiecePosition toPositionRook = (color == ChessPieceColor::White) ? ChessPiecePosition(shortCastling ? "F1" : "D1") : ChessPiecePosition(shortCastling ? "F8" : "D8");
|
||||
|
||||
if (piece->GetNextPositions().count(*toPosition) == 1) {
|
||||
this->chessboard[*toPosition] = this->chessboard[*fromPosition];
|
||||
this->chessboard.erase(*fromPosition);
|
||||
piece->SetPosition(*toPosition);
|
||||
this->SetToHistory(*fromPosition, *toPosition);
|
||||
ChessPiece* chessPieceRook = this->GetChessPiece(&fromPositionRook);
|
||||
ChessPiece* chessPieceKing = this->GetChessPiece(&fromPositionKing);
|
||||
|
||||
if (chessPieceKing == nullptr || chessPieceRook == nullptr) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (chessPieceKing->IsKing() == false || chessPieceRook->IsRook() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
if (chessPieceKing->IsFirstMove() == false || chessPieceRook->IsFirstMove() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
std::string step = ChessPiecePosition::GetStep(chessPieceKing->GetPosition(), toPositionKing);
|
||||
ChessPiecePosition currentPosition = chessPieceKing->GetPosition();
|
||||
ChessPiecePosition* nextPosition = ¤tPosition;
|
||||
while (nextPosition = nextPosition->NextFromString(step)) {
|
||||
if (this->IsEmptyField(nextPosition)) {
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->GetColor() != color) {
|
||||
if (field.second->GetNextPositions().count(*nextPosition) == 0) {
|
||||
continue;
|
||||
} else {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
if (nextPosition->ToString() == toPositionKing.ToString()) {
|
||||
break;
|
||||
}
|
||||
} else {
|
||||
return; // wrong or invalid move
|
||||
return false;
|
||||
}
|
||||
}
|
||||
|
||||
this->chessboard[toPositionKing] = chessPieceKing;
|
||||
this->chessboard.erase(chessPieceKing->GetPosition());
|
||||
this->SetToHistory(chessPieceKing->GetPosition(), toPositionKing);
|
||||
chessPieceKing->SetPosition(toPositionKing);
|
||||
this->chessboard[toPositionRook] = chessPieceRook;
|
||||
this->chessboard.erase(chessPieceRook->GetPosition());
|
||||
this->SetToHistory(chessPieceRook->GetPosition(), toPositionRook);
|
||||
chessPieceRook->SetPosition(toPositionRook);
|
||||
return true;
|
||||
}
|
||||
|
||||
void Chessboard::MoveChessPiece(std::string move) {
|
||||
ChessPieceMove chessPieceMove = ChessPieceMove(move);
|
||||
|
||||
if (chessPieceMove.IsValidShortNotation() == false) {
|
||||
return;
|
||||
}
|
||||
|
||||
if (chessPieceMove.IsShortCastling()) {
|
||||
this->MoveCastling(this->GetCurrentPlayer()->GetColor(), true);
|
||||
} else if (chessPieceMove.IsLongCastling()) {
|
||||
this->MoveCastling(this->GetCurrentPlayer()->GetColor(), false);
|
||||
} else if (chessPieceMove.IsDrawOffer()) {
|
||||
// Remis
|
||||
} else {
|
||||
ChessPiece* chessPiece = nullptr;
|
||||
ChessPiecePosition toChessPiecePosition = ChessPiecePosition(chessPieceMove.GetToPositionFile(), chessPieceMove.GetToPositionRank());
|
||||
char fromPositionFile = chessPieceMove.GetFromPositionFile();
|
||||
int fromPositionRank = chessPieceMove.GetFromPositionRank();
|
||||
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->GetColor() == this->GetCurrentPlayer()->GetColor()) {
|
||||
if (field.second->GetChar() == chessPieceMove.GetChessPieceChar() && field.second->GetNextPositions().count(toChessPiecePosition) == 1) {
|
||||
|
||||
if (fromPositionFile >= 'a' && fromPositionFile <= 'h') {
|
||||
if (field.second->GetPosition().GetFile() == std::toupper(fromPositionFile)) {
|
||||
chessPiece = field.second;
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
if (fromPositionRank >= 1 && fromPositionRank <= 8) {
|
||||
if (field.second->GetPosition().GetRank() == fromPositionRank) {
|
||||
chessPiece = field.second;
|
||||
break;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
chessPiece = field.second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (chessPiece) {
|
||||
if (this->IsEmptyField(&toChessPiecePosition) == false) {
|
||||
this->RemoveChessPiece(toChessPiecePosition);
|
||||
this->chessboard[toChessPiecePosition] = this->chessboard[chessPiece->GetPosition()];
|
||||
this->chessboard.erase(chessPiece->GetPosition());
|
||||
this->SetToHistory(chessPiece->GetPosition(), toChessPiecePosition);
|
||||
chessPiece->SetPosition(toChessPiecePosition);
|
||||
} else {
|
||||
if (chessPiece->IsPawn()) {
|
||||
if (chessPiece->GetColor() == ChessPieceColor::White) {
|
||||
std::string difference = ChessPiecePosition::GetDifference(chessPiece->GetPosition(), toChessPiecePosition);
|
||||
|
||||
if (difference == "T1L1" || difference == "T1R1") {
|
||||
ChessPiecePosition currentPosition = toChessPiecePosition;
|
||||
ChessPiecePosition* nextPosition = ¤tPosition;
|
||||
|
||||
if (nextPosition = nextPosition->NextBottom()) {
|
||||
if (this->IsEmptyField(nextPosition) == false) {
|
||||
ChessPiece* chessPieceRemove = this->GetChessPiece(nextPosition);
|
||||
|
||||
if (chessPieceRemove->GetColor() != chessPiece->GetColor() && chessPieceRemove->IsPawn()) {
|
||||
this->chessboard[toChessPiecePosition] = this->chessboard[chessPiece->GetPosition()];
|
||||
this->chessboard.erase(chessPiece->GetPosition());
|
||||
this->SetToHistory(chessPiece->GetPosition(), toChessPiecePosition);
|
||||
chessPiece->SetPosition(toChessPiecePosition);
|
||||
this->RemoveChessPiece(chessPieceRemove->GetPosition());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->chessboard[toChessPiecePosition] = this->chessboard[chessPiece->GetPosition()];
|
||||
this->chessboard.erase(chessPiece->GetPosition());
|
||||
this->SetToHistory(chessPiece->GetPosition(), toChessPiecePosition);
|
||||
chessPiece->SetPosition(toChessPiecePosition);
|
||||
}
|
||||
} else if (chessPiece->GetColor() == ChessPieceColor::Black) {
|
||||
std::string difference = ChessPiecePosition::GetDifference(chessPiece->GetPosition(), toChessPiecePosition);
|
||||
|
||||
if (difference == "B1L1" || difference == "B1R1") {
|
||||
ChessPiecePosition currentPosition = toChessPiecePosition;
|
||||
ChessPiecePosition* nextPosition = ¤tPosition;
|
||||
|
||||
if (nextPosition = nextPosition->NextTop()) {
|
||||
if (this->IsEmptyField(nextPosition) == false) {
|
||||
ChessPiece* chessPieceRemove = this->GetChessPiece(nextPosition);
|
||||
|
||||
if (chessPieceRemove->GetColor() != chessPiece->GetColor() && chessPieceRemove->IsPawn()) {
|
||||
this->chessboard[toChessPiecePosition] = this->chessboard[chessPiece->GetPosition()];
|
||||
this->chessboard.erase(chessPiece->GetPosition());
|
||||
this->SetToHistory(chessPiece->GetPosition(), toChessPiecePosition);
|
||||
chessPiece->SetPosition(toChessPiecePosition);
|
||||
this->RemoveChessPiece(chessPieceRemove->GetPosition());
|
||||
}
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->chessboard[toChessPiecePosition] = this->chessboard[chessPiece->GetPosition()];
|
||||
this->chessboard.erase(chessPiece->GetPosition());
|
||||
this->SetToHistory(chessPiece->GetPosition(), toChessPiecePosition);
|
||||
chessPiece->SetPosition(toChessPiecePosition);
|
||||
}
|
||||
}
|
||||
} else {
|
||||
this->chessboard[toChessPiecePosition] = this->chessboard[chessPiece->GetPosition()];
|
||||
this->chessboard.erase(chessPiece->GetPosition());
|
||||
this->SetToHistory(chessPiece->GetPosition(), toChessPiecePosition);
|
||||
chessPiece->SetPosition(toChessPiecePosition);
|
||||
}
|
||||
}
|
||||
|
||||
if (chessPieceMove.GetPromotionChessPieceChar() != '\0') {
|
||||
ChessPieceColor color = chessPiece->GetColor();
|
||||
this->RemoveChessPiece(toChessPiecePosition);
|
||||
|
||||
switch (chessPieceMove.GetPromotionChessPieceChar()) {
|
||||
case 'R':
|
||||
this->chessboard[toChessPiecePosition] = new Rook(color, toChessPiecePosition);
|
||||
break;
|
||||
case 'B':
|
||||
this->chessboard[toChessPiecePosition] = new Bishop(color, toChessPiecePosition);
|
||||
break;
|
||||
case 'N':
|
||||
this->chessboard[toChessPiecePosition] = new Knight(color, toChessPiecePosition);
|
||||
break;
|
||||
case 'Q':
|
||||
this->chessboard[toChessPiecePosition] = new Queen(color, toChessPiecePosition);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
this->SetToHistory(chessPieceMove);
|
||||
this->UpdateChessPieces();
|
||||
this->SwitchCurrentPlayer();
|
||||
}
|
||||
|
||||
void Chessboard::SetToHistory(ChessPiecePosition fromPosition, ChessPiecePosition toPosition) {
|
||||
this->history.push_back({fromPosition, toPosition});
|
||||
}
|
||||
|
||||
|
||||
int Chessboard::GetCountMoves() {
|
||||
return this->history.size();
|
||||
return this->_historyPositions.size();
|
||||
}
|
||||
|
||||
std::pair<ChessPiecePosition, ChessPiecePosition> Chessboard::GetLastMove() {
|
||||
return this->history.back();
|
||||
std::pair<ChessPiecePosition, ChessPiecePosition> Chessboard::GetLastMovePositions() {
|
||||
return this->_historyPositions.back();
|
||||
}
|
||||
|
||||
std::vector<ChessPiece*> Chessboard::GetChessPieces() {
|
||||
@@ -107,157 +531,9 @@ std::vector<ChessPiece*> Chessboard::GetChessPieces() {
|
||||
return chessPieces;
|
||||
}
|
||||
|
||||
bool Chessboard::IsCheck() {
|
||||
ChessPiece* chessPieceKing = this->GetChessPieceKing(this->GetCurrentPlayer()->GetColor());
|
||||
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->GetColor() == this->GetOpponentPlayer()->GetColor()) {
|
||||
if (field.second->GetNextPositions().count(chessPieceKing->GetPosition()) == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Chessboard::IsCheckmate() {
|
||||
|
||||
if (this->IsCheck() == false) {
|
||||
return false;
|
||||
}
|
||||
|
||||
ChessPiece* chessPieceKing = this->GetChessPieceKing(this->GetCurrentPlayer()->GetColor());
|
||||
|
||||
if (chessPieceKing->GetNextPositions().size() > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
|
||||
int cntAttacker = 0;
|
||||
|
||||
for (ChessPiece* chessPieceOpponent : this->GetChessPieces()) {
|
||||
if (chessPieceOpponent->GetColor() == this->GetOpponentPlayer()->GetColor()) {
|
||||
if (chessPieceOpponent->GetNextPositions().count(chessPieceKing->GetPosition()) == 1) { // Is an attacker
|
||||
cntAttacker++;
|
||||
|
||||
bool deniable = false;
|
||||
|
||||
// remove attacker
|
||||
for (ChessPiece* chessPieceCurrent : this->GetChessPieces()) {
|
||||
if (chessPieceCurrent->GetColor() == this->GetCurrentPlayer()->GetColor()) {
|
||||
if (chessPieceCurrent->GetNextPositions().count(chessPieceOpponent->GetPosition()) == 1) {
|
||||
deniable = true; // blocked attack because current player can remove attacker
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (deniable == false) {
|
||||
return true;
|
||||
}
|
||||
|
||||
// move between attacker and king
|
||||
// this is not possible for pawn, knight and king because they beat on next field.
|
||||
|
||||
std::string step = ChessPiecePosition::GetStep(chessPieceOpponent->GetPosition(), chessPieceKing->GetPosition());
|
||||
|
||||
ChessPiecePosition currentPosition = chessPieceOpponent->GetPosition();
|
||||
ChessPiecePosition* nextPosition = ¤tPosition;
|
||||
deniable = false;
|
||||
|
||||
while (nextPosition = nextPosition->NextFromString(step)) {
|
||||
for (ChessPiece* chessPieceCurrent : this->GetChessPieces()) {
|
||||
if (chessPieceCurrent->GetColor() == this->GetCurrentPlayer()->GetColor()) {
|
||||
if (chessPieceCurrent->GetNextPositions().count(*nextPosition) == 1) {
|
||||
deniable = true; // blocked attack because current player can block between attacker and king
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (deniable == false) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
if (cntAttacker > 1) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
bool Chessboard::IsStalemate() {
|
||||
ChessPieceColor currentColor = this->GetCurrentPlayer()->GetColor();
|
||||
ChessPieceColor opponentColor = this->GetOpponentPlayer()->GetColor();
|
||||
ChessPiece* chessPieceKing;
|
||||
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->IsKing() && field.second->GetColor() == currentColor) {
|
||||
chessPieceKing = field.second;
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
// Der König hat aber auch keine validen Züge mehr.
|
||||
if (chessPieceKing->GetNextPositions().size() > 0) {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Man hat selbst keine Figuren mehr welche noch ziehen könnten.
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->GetColor() == currentColor) {
|
||||
if (field.second->GetNextPositions().size() > 0) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
// König wird nicht direkt attackiert.
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->GetColor() == opponentColor) {
|
||||
if (field.second->GetNextPositions().count(chessPieceKing->GetPosition()) == 1) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the current player.
|
||||
*/
|
||||
Player* Chessboard::GetCurrentPlayer() {
|
||||
return this->currentPlayer;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the opponent player.
|
||||
*/
|
||||
Player* Chessboard::GetOpponentPlayer() {
|
||||
if (this->GetCurrentPlayer()->GetColor() == ChessPieceColor::Black) {
|
||||
return this->GetPlayer(ChessPieceColor::White);
|
||||
} else {
|
||||
return this->GetPlayer(ChessPieceColor::Black);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Get a player by color.
|
||||
* @return Player* The player who is associated with the given color.
|
||||
*/
|
||||
Player* Chessboard::GetPlayer(ChessPieceColor color) {
|
||||
if (color == ChessPieceColor::Black) {
|
||||
return std::get<ChessPieceColor::Black>(this->players);
|
||||
} else {
|
||||
return std::get<ChessPieceColor::White>(this->players);
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* Set the players to the chessboard.
|
||||
@@ -281,16 +557,7 @@ void Chessboard::SetPlayers(Player* playerA, Player* playerB) {
|
||||
this->currentPlayer = this->GetPlayer(ChessPieceColor::White);
|
||||
}
|
||||
|
||||
/**
|
||||
* Switch the current player.
|
||||
*/
|
||||
void Chessboard::SwitchCurrentPlayer() {
|
||||
if (this->GetCurrentPlayer()->GetColor() == ChessPieceColor::White) {
|
||||
this->currentPlayer = this->GetPlayer(ChessPieceColor::Black);
|
||||
} else {
|
||||
this->currentPlayer = this->GetPlayer(ChessPieceColor::White);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
/**
|
||||
* Update the next positions of all chess pieces.
|
||||
@@ -313,15 +580,31 @@ void Chessboard::UpdateChessPieces() {
|
||||
*/
|
||||
bool Chessboard::IsPositionUnderAttack(ChessPiecePosition position, ChessPieceColor color) {
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->GetColor() == color && field.second->GetNextPositions().count(position) == 1) {
|
||||
if (field.second->IsPawn() == false && field.second->GetColor() == color && field.second->GetNextPositions().count(position) == 1) {
|
||||
return true;
|
||||
}
|
||||
}
|
||||
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
if (field.second->IsPawn() && field.second->GetColor() == color) {
|
||||
std::string difference = ChessPiecePosition::GetDifference(field.second->GetPosition(), position);
|
||||
if (color == ChessPieceColor::White && (difference == "T1L1" || difference == "T1R1")) {
|
||||
return true;
|
||||
} else if (color == ChessPieceColor::Black && (difference == "B1L1" || difference == "B1R1")) {
|
||||
return true;
|
||||
} else {
|
||||
continue;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
return false;
|
||||
}
|
||||
|
||||
Chessboard::~Chessboard() {
|
||||
delete this->players.first;
|
||||
delete this->players.second;
|
||||
|
||||
for (std::pair<ChessPiecePosition, ChessPiece*> field : this->chessboard) {
|
||||
delete field.second;
|
||||
}
|
||||
@@ -339,3 +622,44 @@ ChessPiece* Chessboard::GetChessPieceKing(ChessPieceColor color) {
|
||||
|
||||
return chessPieceKing;
|
||||
}
|
||||
|
||||
|
||||
|
||||
bool Chessboard::ExportFilePGN(std::string filePath) {
|
||||
std::string moveList;
|
||||
std::vector<ChessPieceMove> moves = this->GetHistoryMoves();
|
||||
|
||||
time_t timestamp = time(NULL);
|
||||
struct tm datetime = *localtime(×tamp);
|
||||
char output[50];
|
||||
strftime(output, 50, "%Y.%m.%d", &datetime);
|
||||
|
||||
/**
|
||||
|
||||
[Result "1/2-1/2"]
|
||||
|
||||
[ECO "A29"]
|
||||
[WhiteElo "2750"]
|
||||
[BlackElo "2595"]
|
||||
[PlyCount "155"]
|
||||
*/
|
||||
|
||||
moveList.append("[Date \"").append(output).append("\"]").append("\n");
|
||||
moveList.append("[White \"").append(this->GetPlayer(ChessPieceColor::White)->GetName()).append("\"]").append("\n");
|
||||
moveList.append("[Black \"").append(this->GetPlayer(ChessPieceColor::Black)->GetName()).append("\"]").append("\n");
|
||||
|
||||
|
||||
for (int moveIndex = 0; moveIndex < moves.size() - 1; moveIndex++) {
|
||||
if (moveIndex % 6 == 0) {
|
||||
moveList.append("\n");
|
||||
}
|
||||
if (moveIndex % 2 == 0) {
|
||||
moveList.append(std::to_string((moveIndex / 2) + 1)).append(".");
|
||||
}
|
||||
moveList.append(" ").append(moves[moveIndex].ToString()).append(" ");
|
||||
}
|
||||
|
||||
std::cout << moveList;
|
||||
return true;
|
||||
|
||||
}
|
||||
|
@@ -1,95 +1,49 @@
|
||||
#ifndef Chessboard_H
|
||||
#define Chessboard_H
|
||||
|
||||
#include <ctime>
|
||||
#include <fstream>
|
||||
#include <iostream>
|
||||
#include <map>
|
||||
#include <random>
|
||||
#include <regex>
|
||||
#include <string>
|
||||
#include <utility>
|
||||
#include <vector>
|
||||
#include <set>
|
||||
#include <memory>
|
||||
#include "../Player/Player.hpp"
|
||||
#include "../ChessPieces/ChessPieceColor.hpp"
|
||||
#include "../ChessPieces/ChessPieceMove.hpp"
|
||||
#include "../ChessPieces/ChessPiecePosition.hpp"
|
||||
|
||||
class ChessPiece;
|
||||
|
||||
class Chessboard {
|
||||
private:
|
||||
std::vector<ChessPieceMove> _historyMoves;
|
||||
std::vector<std::pair<ChessPiecePosition, ChessPiecePosition>> _historyPositions;
|
||||
std::map<ChessPiecePosition, ChessPiece*> chessboard;
|
||||
std::vector<std::pair<ChessPiecePosition, ChessPiecePosition>> history;
|
||||
std::pair<Player*, Player*> players;
|
||||
Player* currentPlayer;
|
||||
void RemoveChessPiece(ChessPiecePosition position);
|
||||
|
||||
public:
|
||||
struct Board_ChessPiece {
|
||||
int color;
|
||||
char type;
|
||||
std::pair<char, int> position;
|
||||
|
||||
Board_ChessPiece(const int& c, const char& t, std::pair<char,int> p) : color(c), type(t), position(p) {}
|
||||
|
||||
bool operator<(const Board_ChessPiece& other) const {
|
||||
if (position != other.position) {
|
||||
return position < other.position;
|
||||
}
|
||||
if (color != other.color) {
|
||||
return color < other.color;
|
||||
}
|
||||
return type < other.type;
|
||||
}
|
||||
};
|
||||
inline static const std::set<Board_ChessPiece> defaultBoard = {
|
||||
{0, 'P', {'A', 7}},
|
||||
{0, 'P', {'B', 7}},
|
||||
{0, 'P', {'C', 7}},
|
||||
{0, 'P', {'D', 7}},
|
||||
{0, 'P', {'E', 7}},
|
||||
{0, 'P', {'F', 7}},
|
||||
{0, 'P', {'G', 7}},
|
||||
{0, 'P', {'H', 7}},
|
||||
{0, 'R', {'A', 8}},
|
||||
{0, 'K', {'B', 8}},
|
||||
{0, 'B', {'C', 8}},
|
||||
{0, 'Q', {'D', 8}},
|
||||
{0, 'K', {'E', 8}},
|
||||
{0, 'B', {'F', 8}},
|
||||
{0, 'K', {'G', 8}},
|
||||
{0, 'R', {'H', 8}},
|
||||
|
||||
{1, 'P', {'A', 2}},
|
||||
{1, 'P', {'B', 2}},
|
||||
{1, 'P', {'C', 2}},
|
||||
{1, 'P', {'D', 2}},
|
||||
{1, 'P', {'E', 2}},
|
||||
{1, 'P', {'F', 2}},
|
||||
{1, 'P', {'G', 2}},
|
||||
{1, 'P', {'H', 2}},
|
||||
{1, 'R', {'A', 1}},
|
||||
{1, 'N', {'B', 1}},
|
||||
{1, 'B', {'C', 1}},
|
||||
{1, 'Q', {'D', 1}},
|
||||
{1, 'K', {'E', 1}},
|
||||
{1, 'B', {'F', 1}},
|
||||
{1, 'K', {'G', 1}},
|
||||
{1, 'R', {'H', 1}}
|
||||
};
|
||||
~Chessboard();
|
||||
void InitializeStartBoard();
|
||||
void InitializeBoard(std::set<Board_ChessPiece> board);
|
||||
//void SetChessPiece(std::unique_ptr<ChessPiece> piece);
|
||||
std::vector<ChessPieceMove> GetHistoryMoves();
|
||||
std::vector<std::pair<ChessPiecePosition, ChessPiecePosition>> GetHistoryPositions();
|
||||
void SetChessPiece(ChessPiece* chesspiece);
|
||||
bool IsEmptyField(ChessPiecePosition* position);
|
||||
ChessPiece* GetChessPiece(ChessPiecePosition* position);
|
||||
std::vector<ChessPiece*> GetChessPieces();
|
||||
void UpdateChessPieces();
|
||||
void MoveChessPiece(std::string move);
|
||||
bool MoveCastling(ChessPieceColor color, bool shortCastling);
|
||||
void SetToHistory(ChessPieceMove move);
|
||||
void SetToHistory(ChessPiecePosition fromPosition, ChessPiecePosition toPosition);
|
||||
int GetCountMoves();
|
||||
std::pair<ChessPiecePosition, ChessPiecePosition> GetLastMove();
|
||||
bool HasMoves();
|
||||
std::pair<ChessPiecePosition, ChessPiecePosition> GetLastMovePositions();
|
||||
bool IsCheckmate();
|
||||
bool IsCheck();
|
||||
bool IsInCheck();
|
||||
bool IsStalemate();
|
||||
bool IsPositionUnderAttack(ChessPiecePosition position, ChessPieceColor color);
|
||||
Player* GetCurrentPlayer();
|
||||
@@ -98,6 +52,8 @@ class Chessboard {
|
||||
void SwitchCurrentPlayer();
|
||||
Player* GetPlayer(ChessPieceColor color);
|
||||
ChessPiece* GetChessPieceKing(ChessPieceColor color);
|
||||
bool ImportFilePGN(std::string filePath);
|
||||
bool ExportFilePGN(std::string filePath);
|
||||
};
|
||||
|
||||
#endif
|
||||
|
@@ -1 +1 @@
|
||||
//#include "../Chessboard/ChessboardVisualizer.hpp"
|
||||
#include "../Chessboard/ChessboardVisualizer.hpp"
|
||||
|
@@ -1,4 +1,4 @@
|
||||
/*#ifndef ChessboardVisualizer_H
|
||||
#ifndef ChessboardVisualizer_H
|
||||
#define ChessboardVisualizer_H
|
||||
|
||||
#include "../ChessPieces/ChessPiece.hpp"
|
||||
@@ -10,4 +10,4 @@ class ChessboardVisualizer {
|
||||
virtual void Draw(Chessboard* chessboard) = 0;
|
||||
};
|
||||
|
||||
#endif*/
|
||||
#endif
|
||||
|
@@ -1,9 +1,7 @@
|
||||
#include "../Chessboard/ChessboardVisualizerGraphic.hpp"
|
||||
#include "../ChessPieces/ChessPiecePosition.hpp"
|
||||
#include "../Visualizer/HistorieVisualizer.hpp"
|
||||
#include "../Visualizer/BaseVisualizer.hpp"
|
||||
|
||||
/*void ChessboardVisualizerGraphic::SetConsoleColor(Colors foreground, Colors background) {
|
||||
void ChessboardVisualizerGraphic::SetConsoleColor(Colors foreground, Colors background) {
|
||||
const std::string SEQ_FOREGROUND = "\x1b[3";
|
||||
const std::string SEQ_FOREGROUND_LIGHT = "\x1b[9";
|
||||
const std::string SEQ_BACKGROUND = "\x1b[4";
|
||||
@@ -66,252 +64,105 @@
|
||||
}
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::temp(Chessboard* chessboard) {
|
||||
for (int rank = 8; rank >= 1; rank--) {
|
||||
if (rank == 8) GenerateTopOrBottomBorder(true);
|
||||
|
||||
std::vector<std::string> temp;
|
||||
|
||||
for (int heightOfField = 0; heightOfField < 3; heightOfField++) {
|
||||
for (char file = 'A'; file <= 'H'; file++) {
|
||||
if (file == 'A') {
|
||||
temp.push_back((heightOfField == 1) ? " " + std::to_string(rank) + " " : " ");
|
||||
temp.push_back(ChessboardVisualizerGraphic::VERTICAL_LINE);
|
||||
}
|
||||
|
||||
temp.push_back(GenerateBoardField(chessboard, file, rank, heightOfField));
|
||||
|
||||
if (file == 'H') {
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
temp.push_back(ChessboardVisualizerGraphic::VERTICAL_LINE);
|
||||
}
|
||||
}
|
||||
AddRowToBoard(temp);
|
||||
temp.clear();
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
}
|
||||
if (rank == 1) GenerateTopOrBottomBorder(false);
|
||||
}
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::AddMenusToChessboard() {
|
||||
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::GenerateChessboard(Chessboard* chessboard) {
|
||||
ClearTerminal();
|
||||
|
||||
board.clear();
|
||||
|
||||
GeneratePlayers(chessboard);
|
||||
|
||||
temp(chessboard);
|
||||
|
||||
AddMenusToChessboard();
|
||||
|
||||
/*HistorieVisualizer history = HistorieVisualizer(15, 3, "Me", "Me");
|
||||
|
||||
std::vector<std::vector<std::string>> historyDisplayVector = history.GetDisplayVector();
|
||||
std::vector<std::vector<std::string>> currentBoard = board;
|
||||
|
||||
for (size_t i = 0; i < historyDisplayVector.size(); i++) {
|
||||
for (size_t j = 0; j < historyDisplayVector[i].size(); j++) {
|
||||
board[i].push_back(" " + historyDisplayVector[i][j]);
|
||||
}
|
||||
}*/
|
||||
|
||||
|
||||
|
||||
/*this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
DrawFromVector();
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::Draw(Chessboard* chessboard) {
|
||||
ClearTerminal();
|
||||
std::cout << "\033[2J"; // clear the console
|
||||
|
||||
DrawPlayers(chessboard);
|
||||
std::cout << std::endl;
|
||||
std::cout << " " << chessboard->GetPlayer(ChessPieceColor::White)->GetName() << " vs. " << chessboard->GetPlayer(ChessPieceColor::Black)->GetName();
|
||||
std::cout << std::endl;
|
||||
|
||||
for (int rank = 8; rank >= 1; rank--) {
|
||||
if (rank == 8) DrawTopOrBottomBorder(true);
|
||||
|
||||
for (int heightOfField = 0; heightOfField < 3; heightOfField++) {
|
||||
for (char file = 'A'; file <= 'H'; file++) {
|
||||
if (file == 'A') {
|
||||
(heightOfField == 1) ? std::cout << " " << rank << " " : std::cout << " ";
|
||||
std::cout << ChessboardVisualizerGraphic::VERTICAL_LINE;
|
||||
if (rank == 8) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (i == 0) {
|
||||
std::cout << " " << " " << " ";
|
||||
std::cout << "\u2554";
|
||||
}
|
||||
|
||||
DrawBoardField(chessboard, file, rank, heightOfField);
|
||||
|
||||
if (file == 'H') {
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
std::cout << ChessboardVisualizerGraphic::VERTICAL_LINE;
|
||||
std::cout << "\u2550" << "\u2550" << "\u2550" << "\u2550" << "\u2550" << "\u2550" << "\u2550";
|
||||
if (i == 7) {
|
||||
std::cout << "\u2557";
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
for (int i = 0; i < 3; i++) {
|
||||
for (char file = 'A'; file <= 'H'; file++) {
|
||||
if (i == 1) {
|
||||
if (file == 'A') {
|
||||
std::cout << " " << rank << " ";
|
||||
std::cout << "\u2551";
|
||||
}
|
||||
} else {
|
||||
if (file == 'A') {
|
||||
std::cout << " " << " " << " ";
|
||||
std::cout << "\u2551";
|
||||
}
|
||||
}
|
||||
if (file % 2 == (rank % 2)) {
|
||||
this->SetConsoleColor(BLACK, WHITE);
|
||||
|
||||
if (i == 1) {
|
||||
ChessPiecePosition* position = new ChessPiecePosition(file, rank);
|
||||
|
||||
if (chessboard->IsEmptyField(position)) {
|
||||
std::cout << " ";
|
||||
} else {
|
||||
ChessPiece* piece = chessboard->GetChessPiece(position);
|
||||
std::cout << " " << piece->GetUnicode() << " ";
|
||||
}
|
||||
} else {
|
||||
std::cout << " ";
|
||||
}
|
||||
} else {
|
||||
this->SetConsoleColor(WHITE, BLACK);
|
||||
|
||||
if (i == 1) {
|
||||
ChessPiecePosition* position = new ChessPiecePosition(file, rank);
|
||||
|
||||
if (chessboard->IsEmptyField(position)) {
|
||||
std::cout << " ";
|
||||
} else {
|
||||
ChessPiece* piece = chessboard->GetChessPiece(position);
|
||||
std::cout << " " << piece->GetUnicode() << " ";
|
||||
}
|
||||
} else {
|
||||
std::cout << " ";
|
||||
}
|
||||
}
|
||||
if (file == 'H') {
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
std::cout << "\u2551";
|
||||
}
|
||||
}
|
||||
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
if (rank == 1) DrawTopOrBottomBorder(false);
|
||||
if (rank == 1) {
|
||||
for (int i = 0; i < 8; i++) {
|
||||
if (i == 0) {
|
||||
std::cout << " " << " " << " ";
|
||||
std::cout << "\u255A";
|
||||
}
|
||||
std::cout << "\u2550" << "\u2550" << "\u2550" << "\u2550" << "\u2550" << "\u2550" << "\u2550";
|
||||
if (i == 7) {
|
||||
std::cout << "\u255D";
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
for (char file = 'A'; file <= 'H'; file++) {
|
||||
if (file == 'A') {
|
||||
std::cout << " ";
|
||||
std::cout << " ";
|
||||
}
|
||||
std::cout << " " << file << " ";
|
||||
if (file == 'H') {
|
||||
std::cout << " ";
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::GenerateTopOrBottomBorder(bool top) {
|
||||
std::vector<std::string> temp;
|
||||
|
||||
temp.push_back(" ");
|
||||
|
||||
std::string left = (top) ? ChessboardVisualizerGraphic::TOP_LEFT_CORNER : ChessboardVisualizerGraphic::BOTTOM_LEFT_CORNER;
|
||||
temp.push_back(left);
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
temp.push_back(ChessboardVisualizerGraphic::HORIZONTAL_LINE + ChessboardVisualizerGraphic::HORIZONTAL_LINE + ChessboardVisualizerGraphic::HORIZONTAL_LINE + ChessboardVisualizerGraphic::HORIZONTAL_LINE + ChessboardVisualizerGraphic::HORIZONTAL_LINE + ChessboardVisualizerGraphic::HORIZONTAL_LINE + ChessboardVisualizerGraphic::HORIZONTAL_LINE);
|
||||
}
|
||||
|
||||
std::string right = (top) ? ChessboardVisualizerGraphic::TOP_RIGHT_CORNER : ChessboardVisualizerGraphic::BOTTOM_RIGHT_CORNER;
|
||||
temp.push_back(right);
|
||||
|
||||
AddRowToBoard(temp);
|
||||
if (!top) GenerateFiles();
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::DrawTopOrBottomBorder(bool top) {
|
||||
std::cout << " ";
|
||||
|
||||
std::string left = (top) ? ChessboardVisualizerGraphic::TOP_LEFT_CORNER : ChessboardVisualizerGraphic::BOTTOM_LEFT_CORNER;
|
||||
std::cout << left;
|
||||
|
||||
for (int i = 0; i < 8; i++) {
|
||||
std::cout << ChessboardVisualizerGraphic::HORIZONTAL_LINE << ChessboardVisualizerGraphic::HORIZONTAL_LINE << ChessboardVisualizerGraphic::HORIZONTAL_LINE << ChessboardVisualizerGraphic::HORIZONTAL_LINE << ChessboardVisualizerGraphic::HORIZONTAL_LINE << ChessboardVisualizerGraphic::HORIZONTAL_LINE << ChessboardVisualizerGraphic::HORIZONTAL_LINE;
|
||||
}
|
||||
|
||||
std::string right = (top) ? ChessboardVisualizerGraphic::TOP_RIGHT_CORNER : ChessboardVisualizerGraphic::BOTTOM_RIGHT_CORNER;
|
||||
std::cout << right;
|
||||
|
||||
std::cout << std::endl;
|
||||
if (!top) DrawFiles();
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::GenerateFiles() {
|
||||
std::vector<std::string> temp;
|
||||
|
||||
for (char file = 'A'; file <= 'H'; file++) {
|
||||
if (file == 'A') {
|
||||
temp.push_back(" ");
|
||||
}
|
||||
|
||||
temp.push_back(" " + std::string(1, file) + " ");
|
||||
|
||||
if (file == 'H') {
|
||||
temp.push_back(" ");
|
||||
}
|
||||
}
|
||||
AddRowToBoard(temp);
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::DrawFiles() {
|
||||
for (char file = 'A'; file <= 'H'; file++) {
|
||||
if (file == 'A') {
|
||||
std::cout << " ";
|
||||
}
|
||||
|
||||
std::cout << " " << file << " ";
|
||||
|
||||
if (file == 'H') {
|
||||
std::cout << " ";
|
||||
}
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
std::string ChessboardVisualizerGraphic::GenerateBoardField(Chessboard* chessboard, char file, int rank, int height) {
|
||||
if (height == 1) {
|
||||
ChessPiecePosition* position = new ChessPiecePosition(file, rank);
|
||||
|
||||
if (chessboard->IsEmptyField(position)) {
|
||||
return " ";
|
||||
} else {
|
||||
ChessPiece* piece = chessboard->GetChessPiece(position);
|
||||
return " " + piece->GetUnicode() + " ";
|
||||
}
|
||||
} else {
|
||||
return " ";
|
||||
}
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::DrawBoardField(Chessboard* chessboard, char file, int rank, int height) {
|
||||
if (file % 2 == (rank % 2)) {
|
||||
this->SetConsoleColor(BLACK, WHITE);
|
||||
} else {
|
||||
this->SetConsoleColor(WHITE, BLACK);
|
||||
}
|
||||
|
||||
if (height == 1) {
|
||||
ChessPiecePosition* position = new ChessPiecePosition(file, rank);
|
||||
|
||||
if (chessboard->IsEmptyField(position)) {
|
||||
std::cout << " ";
|
||||
} else {
|
||||
ChessPiece* piece = chessboard->GetChessPiece(position);
|
||||
std::cout << " " << piece->GetUnicode() << " ";
|
||||
}
|
||||
} else {
|
||||
std::cout << " ";
|
||||
}
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::ClearTerminal() {
|
||||
//std::cout << "\033[2J"; // clear the console
|
||||
system("cls");
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::GeneratePlayers(Chessboard* chessboard) {
|
||||
std::vector<std::string> temp;
|
||||
temp.push_back(" ");
|
||||
temp.push_back(chessboard->GetPlayer(ChessPieceColor::White)->GetName() + " vs. " + chessboard->GetPlayer(ChessPieceColor::Black)->GetName());
|
||||
AddRowToBoard(temp);
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::DrawPlayers(Chessboard* chessboard) {
|
||||
std::cout << " ";
|
||||
std::cout << chessboard->GetPlayer(ChessPieceColor::White)->GetName() + " vs. " + chessboard->GetPlayer(ChessPieceColor::Black)->GetName();
|
||||
std::cout << std::endl;
|
||||
}
|
||||
|
||||
void ChessboardVisualizerGraphic::AddRowToBoard(const std::vector<std::string>& row) {
|
||||
board.push_back(row);
|
||||
}
|
||||
|
||||
// board[2] bis board[25] Feld des Schachbretts
|
||||
// in vectoren von 2 bis 25 index von 2 bis 9
|
||||
void ChessboardVisualizerGraphic::DrawFromVector() {
|
||||
size_t lengthOfBoard = BaseVisualizer::GetSumAllCharsFromVector(board[1]);
|
||||
for (int row = 0; row < board.size(); ++row) {
|
||||
for (int column = 0; column < board[row].size(); ++column) {
|
||||
if (row >= 2 && row <= 25 && column >= 2 && column <= 9) {
|
||||
bool isSecondRowOfField = (row % 3 == 2);
|
||||
bool isBlackWhite = (column % 2 == row % 2);
|
||||
|
||||
if ((row - 1) % 3 == 0) { // Change after 3 rows
|
||||
if (isSecondRowOfField) {
|
||||
this->SetConsoleColor(isBlackWhite ? WHITE : BLACK, isBlackWhite ? BLACK : WHITE);
|
||||
} else {
|
||||
this->SetConsoleColor(isBlackWhite ? BLACK : WHITE, isBlackWhite ? WHITE : BLACK);
|
||||
}
|
||||
} else {
|
||||
if (isSecondRowOfField) {
|
||||
this->SetConsoleColor(isBlackWhite ? BLACK : WHITE, isBlackWhite ? WHITE : BLACK);
|
||||
} else {
|
||||
this->SetConsoleColor(isBlackWhite ? WHITE : BLACK, isBlackWhite ? BLACK : WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
//std::cout << std::setw(lengthOfBoard) << board[row][column];
|
||||
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
}
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}*/
|
@@ -1,48 +1,21 @@
|
||||
/*#ifndef ChessboardVisualizerGraphic_H
|
||||
#ifndef ChessboardVisualizerGraphic_H
|
||||
#define ChessboardVisualizerGraphic_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include "../Chessboard/ChessboardVisualizer.hpp"*/
|
||||
#include "../Chessboard/ChessboardVisualizer.hpp"
|
||||
|
||||
/*enum Colors {
|
||||
enum Colors {
|
||||
BLACK = 0, RED = 1, GREEN = 2, YELLOW = 3, BLUE = 4, MAGENTA = 5, CYAN = 6, WHITE = 7,
|
||||
LIGHT_BLACK = 10, LIGHT_RED = 11, LIGHT_GREEN = 12, LIGHT_YELLOW = 13, LIGHT_BLUE = 14,
|
||||
LIGHT_MAGENTA = 15, LIGHT_CYAN = 16, LIGHT_WHITE = 17, DEFAULT = 9
|
||||
};*/
|
||||
|
||||
/*class ChessboardVisualizerGraphic : public ChessboardVisualizer {
|
||||
protected:
|
||||
inline static const std::string TOP_LEFT_CORNER = "\u2554";
|
||||
inline static const std::string TOP_RIGHT_CORNER = "\u2557";
|
||||
inline static const std::string HORIZONTAL_LINE = "\u2550";
|
||||
inline static const std::string VERTICAL_LINE = "\u2551";
|
||||
inline static const std::string BOTTOM_LEFT_CORNER = "\u255A";
|
||||
inline static const std::string BOTTOM_RIGHT_CORNER = "\u255D";
|
||||
};
|
||||
|
||||
class ChessboardVisualizerGraphic : public ChessboardVisualizer {
|
||||
private:
|
||||
std::vector<std::vector<std::string>> board;
|
||||
void ClearTerminal();
|
||||
void DrawTopOrBottomBorder(bool top);
|
||||
void GenerateTopOrBottomBorder(bool top);
|
||||
void DrawPlayers(Chessboard* chessboard);
|
||||
void GeneratePlayers(Chessboard* chessboard);
|
||||
std::string GenerateBoardField(Chessboard* chessboard, char file, int rank, int height);
|
||||
void DrawBoardField(Chessboard* chessboard, char file, int rank, int height);
|
||||
void DrawFiles();
|
||||
void GenerateFiles();
|
||||
//void SetConsoleColor(Colors foreground, Colors background);
|
||||
void SetColorsForField();
|
||||
void temp(Chessboard* chessboard);
|
||||
void AddMenusToChessboard();
|
||||
void SetConsoleColor(Colors foreground, Colors background);
|
||||
|
||||
public:
|
||||
ChessboardVisualizerGraphic() = default;
|
||||
void Draw(Chessboard* chessboard);
|
||||
void GenerateChessboard(Chessboard* chessboard);
|
||||
void DrawFromVector();
|
||||
void AddRowToBoard(const std::vector<std::string>& row);
|
||||
};
|
||||
|
||||
#endif
|
||||
*/
|
@@ -1,7 +1,7 @@
|
||||
#include "../Chessboard/ChessboardVisualizerText.hpp"
|
||||
#include "../ChessPieces/ChessPiecePosition.hpp"
|
||||
|
||||
/*void ChessboardVisualizerText::Draw(Chessboard* chessboard) {
|
||||
void ChessboardVisualizerText::Draw(Chessboard* chessboard) {
|
||||
std::cout << "\033[2J"; // clear the console
|
||||
|
||||
std::cout << std::endl;
|
||||
@@ -89,4 +89,3 @@
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
*/
|
@@ -1,4 +1,4 @@
|
||||
/*#ifndef ChessboardVisualizerText_H
|
||||
#ifndef ChessboardVisualizerText_H
|
||||
#define ChessboardVisualizerText_H
|
||||
|
||||
#include "../Chessboard/ChessboardVisualizer.hpp"
|
||||
@@ -13,4 +13,3 @@ class ChessboardVisualizerText : public ChessboardVisualizer {
|
||||
};
|
||||
|
||||
#endif
|
||||
*/
|
34
README.md
34
README.md
@@ -92,28 +92,30 @@
|
||||
|
||||
## ToDo
|
||||
- Speicherfunktion
|
||||
- ToDos abarbeiten
|
||||
- Anleitung schreiben
|
||||
- Befehlen während des Spiel implementieren
|
||||
- Bewegen funktioniert nicht -> Fixen!!!!
|
||||
- Historie -> Spielzüge speichern und anzeigen
|
||||
- Meldung für falschen Zug (Fehlermeldungen beim Spielen)
|
||||
- Nach Beenden nicht Pfad in Anzeige stehen lassen
|
||||
- Dark Mode
|
||||
|
||||
## Erledigt
|
||||
- Schachnotation (Lange)
|
||||
- Menü (ASCII Art of TurboSchach)
|
||||
- Startmenü
|
||||
- Spielmenü mit Historie, Kommand
|
||||
- Plattformunabhängiges CMD clearing vor dem Zeichnen
|
||||
- Spezialbewegung (Rochade, Umwandlung, En passant)
|
||||
|
||||
## Build
|
||||
## Kompilieren und Ausführen
|
||||
Um TurboSchach kompilieren zu können wird mindestens C++ 17 benötigt.
|
||||
|
||||
### Windows
|
||||
|
||||
```
|
||||
g++ -o chess.exe main.cpp ChessPieces/*.cpp Chessboard/*.cpp Player/*.cpp Visualizer/*.cpp
|
||||
g++ -std=c++17 -o chess.exe main.cpp ChessPieces/*.cpp Chessboard/*.cpp Player/*.cpp
|
||||
./chess.exe
|
||||
```
|
||||
|
||||
## Voraussetzungen
|
||||
### Linux und MacOS
|
||||
|
||||
- C++ 17
|
||||
```
|
||||
# compile the project
|
||||
make
|
||||
|
||||
# run the project
|
||||
make run
|
||||
|
||||
# remove all output files
|
||||
make clean
|
||||
```
|
@@ -1,259 +0,0 @@
|
||||
#include "BaseVisualizer.hpp"
|
||||
|
||||
void BaseVisualizer::ClearTerminal() {
|
||||
//std::cout << "\033[2J";
|
||||
system("cls");
|
||||
}
|
||||
|
||||
std::vector<std::vector<std::string>>* BaseVisualizer::GetDisplayVector() {
|
||||
return &display_vector;
|
||||
}
|
||||
|
||||
size_t BaseVisualizer::CountVisibleCharacters(const std::string& str) {
|
||||
size_t count = 0;
|
||||
size_t i = 0;
|
||||
|
||||
while (i < str.size()) {
|
||||
if (str[i] == '\x1B' && i + 1 < str.size() && str[i + 1] == '[') {
|
||||
// ANSI-Escape-Sequenz erkennen und überspringen
|
||||
i += 2; // Überspringe '\x1B['
|
||||
while (i < str.size() && !std::isalpha(str[i])) {
|
||||
++i; // Fortsetzung der Sequenz überspringen
|
||||
}
|
||||
if (i < str.size() && std::isalpha(str[i])) {
|
||||
++i; // Buchstaben am Ende der Sequenz überspringen
|
||||
}
|
||||
} else {
|
||||
// UTF-8 Startbytes zählen (kein Fortsetzungsbyte)
|
||||
if ((str[i] & 0b11000000) != 0b10000000) {
|
||||
++count;
|
||||
}
|
||||
++i;
|
||||
}
|
||||
}
|
||||
|
||||
return count;
|
||||
}
|
||||
|
||||
size_t BaseVisualizer::GetSumAllCharsFromVector(const std::vector<std::string>& vec) {
|
||||
size_t sum = 0;
|
||||
for (const std::string& str : vec) {
|
||||
sum += CountVisibleCharacters(str);
|
||||
}
|
||||
return sum;
|
||||
}
|
||||
|
||||
void BaseVisualizer::GenerateEmptyLine(const int lengthOfMenu, const bool single) {
|
||||
std::string result = "";
|
||||
for (int i = 0; i < lengthOfMenu; ++i) {
|
||||
if (i == 0) {
|
||||
result += ((single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE);
|
||||
} else if (i == lengthOfMenu-1) {
|
||||
result += ((single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE);
|
||||
} else {
|
||||
result += " ";
|
||||
}
|
||||
}
|
||||
display_vector.push_back({result});
|
||||
}
|
||||
|
||||
// ToDo: Auf Max länge bringen
|
||||
void BaseVisualizer::GenerateBoxMenuLine(const size_t length, const std::string& str, const bool single, const size_t padding) {
|
||||
std::string result = ((single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE) + std::string(padding, ' ') + str;
|
||||
while (CountVisibleCharacters(result) < length-1) {
|
||||
result += " ";
|
||||
}
|
||||
display_vector.push_back({result.append(((single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE))});
|
||||
}
|
||||
|
||||
void BaseVisualizer::GenerateCenteredString(const size_t widthOfMenu, const std::string& str, const bool single) {
|
||||
std::string result = (single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE;
|
||||
|
||||
float newLength = widthOfMenu - CountVisibleCharacters(str) - 2;
|
||||
|
||||
int firstHalfLength = std::floor(newLength / 2);
|
||||
int secondHalfLength = std::ceil(newLength / 2);
|
||||
|
||||
for (int i = 0; i < firstHalfLength; ++i) {
|
||||
result += " ";
|
||||
}
|
||||
|
||||
result += str;
|
||||
|
||||
for (int i = 0; i < secondHalfLength; ++i) {
|
||||
result += " ";
|
||||
}
|
||||
|
||||
display_vector.push_back({result+ ((single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE)});
|
||||
}
|
||||
|
||||
void BaseVisualizer::DisplayElement() {
|
||||
int temp;
|
||||
for (const auto& row : display_vector) {
|
||||
for (const auto& cell : row) {
|
||||
std::cout << cell;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
std::cout << "\x1B[u";
|
||||
//std::cout << "Select option" << std::endl;
|
||||
std::cin >> temp;
|
||||
}
|
||||
|
||||
size_t BaseVisualizer::CalculateMaxMenuWidth(const size_t longestStringLength, const size_t padding) {
|
||||
return longestStringLength + 2*padding + 2;
|
||||
}
|
||||
|
||||
void BaseVisualizer::GenerateTopBottomBorder(const size_t totalLength, const bool top, const bool single) {
|
||||
std::string result = (top) ? ((single) ? BaseVisualizer::TOP_LEFT_CORNER_SINGLE : BaseVisualizer::TOP_LEFT_CORNER) : ((single) ? BaseVisualizer::BOTTOM_LEFT_CORNER_SINGLE : BaseVisualizer::BOTTOM_LEFT_CORNER);
|
||||
for (size_t i = 0; i < totalLength-2; ++i) {
|
||||
result += (single) ? BaseVisualizer::HORIZONTAL_LINE_SINGLE : BaseVisualizer::HORIZONTAL_LINE;
|
||||
}
|
||||
display_vector.push_back({result + ((top) ? ((single) ? BaseVisualizer::TOP_RIGHT_CORNER_SINGLE : BaseVisualizer::TOP_RIGHT_CORNER) : ((single) ? BaseVisualizer::BOTTOM_RIGHT_CORNER_SINGLE : BaseVisualizer::BOTTOM_RIGHT_CORNER))});
|
||||
}
|
||||
|
||||
void BaseVisualizer::AddEmptyLines(const size_t lines, const size_t length, const bool sinlge) {
|
||||
for (size_t i = 0; i < lines; ++i) {
|
||||
BaseVisualizer::GenerateEmptyLine(length, sinlge);
|
||||
}
|
||||
}
|
||||
|
||||
void BaseVisualizer::GenerateTableTopBottom(const size_t totalLength, const bool top, const bool single) {
|
||||
int firstHalfLength = std::floor(totalLength / 2);
|
||||
|
||||
std::string result = (top) ? ((single) ? BaseVisualizer::TOP_LEFT_CORNER_SINGLE : BaseVisualizer::TOP_LEFT_CORNER) : ((single) ? BaseVisualizer::BOTTOM_LEFT_CORNER_SINGLE : BaseVisualizer::BOTTOM_LEFT_CORNER);
|
||||
|
||||
for (size_t i = 0; i < firstHalfLength-1; ++i) {
|
||||
result += (single) ? BaseVisualizer::HORIZONTAL_LINE_SINGLE : BaseVisualizer::HORIZONTAL_LINE;
|
||||
}
|
||||
|
||||
result += (top) ? ((single) ? BaseVisualizer::TOP_CROSS_SINGLE : BaseVisualizer::TOP_CROSS) : ((single) ? BaseVisualizer::BOTTOM_CROSS_SINGLE : BaseVisualizer::BOTTOM_CROSS);
|
||||
|
||||
for (size_t i = 0; i < firstHalfLength-1; ++i) {
|
||||
result += (single) ? BaseVisualizer::HORIZONTAL_LINE_SINGLE : BaseVisualizer::HORIZONTAL_LINE;
|
||||
}
|
||||
|
||||
display_vector.push_back({result + ((top) ? ((single) ? BaseVisualizer::TOP_RIGHT_CORNER_SINGLE : BaseVisualizer::TOP_RIGHT_CORNER) : ((single) ? BaseVisualizer::BOTTOM_RIGHT_CORNER_SINGLE : BaseVisualizer::BOTTOM_RIGHT_CORNER))});
|
||||
}
|
||||
|
||||
void BaseVisualizer::GenerateTableLine(const float length, const std::vector<std::string>& str, const bool single) {
|
||||
int firstHalfLength = std::floor(length / 2);
|
||||
std::string result = ((single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE);
|
||||
std::string temp;
|
||||
|
||||
for (size_t i = 0; i < 2; ++i) {
|
||||
temp += " " + str[i];
|
||||
|
||||
while (CountVisibleCharacters(temp) < firstHalfLength-1) {
|
||||
temp += " ";
|
||||
}
|
||||
temp += ((single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE);
|
||||
result += temp;
|
||||
temp = "";
|
||||
}
|
||||
display_vector.push_back({result});
|
||||
}
|
||||
|
||||
void BaseVisualizer::GenerateTableSeperator(const float length, const bool single) {
|
||||
int firstHalfLength = std::floor(length / 2);
|
||||
std::string result = ((single) ? BaseVisualizer::RIGHT_CROSS_SINGLE : BaseVisualizer::RIGHT_CROSS);
|
||||
std::string temp;
|
||||
|
||||
for (size_t i = 0; i < 2; ++i) {
|
||||
while (CountVisibleCharacters(temp) < firstHalfLength-1) {
|
||||
temp += ((single) ? BaseVisualizer::HORIZONTAL_LINE_SINGLE : BaseVisualizer::HORIZONTAL_LINE);
|
||||
}
|
||||
temp += (i != 1) ? ((single) ? BaseVisualizer::CROSS_SINGLE : BaseVisualizer::CROSS) : "";
|
||||
result += temp;
|
||||
temp = "";
|
||||
}
|
||||
result += ((single) ? BaseVisualizer::LEFT_CROSS_SINGLE : BaseVisualizer::LEFT_CROSS);
|
||||
|
||||
display_vector.push_back({result});
|
||||
}
|
||||
|
||||
void BaseVisualizer::GenerateBoxSeperator(const float length, const bool single) {
|
||||
std::string result = ((single) ? BaseVisualizer::RIGHT_CROSS_SINGLE : BaseVisualizer::RIGHT_CROSS);
|
||||
|
||||
while (CountVisibleCharacters(result) < length-1) {
|
||||
result += ((single) ? BaseVisualizer::HORIZONTAL_LINE_SINGLE : BaseVisualizer::HORIZONTAL_LINE);
|
||||
}
|
||||
|
||||
result += ((single) ? BaseVisualizer::LEFT_CROSS_SINGLE : BaseVisualizer::LEFT_CROSS);
|
||||
|
||||
display_vector.push_back({result});
|
||||
}
|
||||
|
||||
void BaseVisualizer::SetConsoleColor(Colors foreground, Colors background) {
|
||||
const std::string SEQ_FOREGROUND = "\x1b[3";
|
||||
const std::string SEQ_FOREGROUND_LIGHT = "\x1b[9";
|
||||
const std::string SEQ_BACKGROUND = "\x1b[4";
|
||||
const std::string SEQ_BACKGROUND_LIGHT = "\x1b[10";
|
||||
|
||||
// set foreground color
|
||||
switch (foreground) {
|
||||
case BLACK:
|
||||
case RED:
|
||||
case GREEN:
|
||||
case YELLOW:
|
||||
case BLUE:
|
||||
case MAGENTA:
|
||||
case CYAN:
|
||||
case WHITE:
|
||||
std::cout << SEQ_FOREGROUND << foreground << "m";
|
||||
break;
|
||||
case LIGHT_BLACK:
|
||||
case LIGHT_RED:
|
||||
case LIGHT_GREEN:
|
||||
case LIGHT_YELLOW:
|
||||
case LIGHT_BLUE:
|
||||
case LIGHT_MAGENTA:
|
||||
case LIGHT_CYAN:
|
||||
case LIGHT_WHITE:
|
||||
std::cout << SEQ_FOREGROUND_LIGHT << foreground << "m";
|
||||
break;
|
||||
case DEFAULT:
|
||||
default:
|
||||
std::cout << SEQ_FOREGROUND << foreground << "m";
|
||||
break;
|
||||
}
|
||||
|
||||
// set background color
|
||||
switch (background) {
|
||||
case BLACK:
|
||||
case RED:
|
||||
case GREEN:
|
||||
case YELLOW:
|
||||
case BLUE:
|
||||
case MAGENTA:
|
||||
case CYAN:
|
||||
case WHITE:
|
||||
std::cout << SEQ_BACKGROUND << background << "m";
|
||||
break;
|
||||
case LIGHT_BLACK:
|
||||
case LIGHT_RED:
|
||||
case LIGHT_GREEN:
|
||||
case LIGHT_YELLOW:
|
||||
case LIGHT_BLUE:
|
||||
case LIGHT_MAGENTA:
|
||||
case LIGHT_CYAN:
|
||||
case LIGHT_WHITE:
|
||||
std::cout << SEQ_BACKGROUND_LIGHT << background << "m";
|
||||
break;
|
||||
case DEFAULT:
|
||||
default:
|
||||
std::cout << SEQ_BACKGROUND << background << "m";
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
||||
size_t BaseVisualizer::FindMaxLength(const std::vector<std::string> vec) {
|
||||
size_t max = 0;
|
||||
size_t currentLength = 0;
|
||||
for (const std::string& str : vec) {
|
||||
currentLength = CountVisibleCharacters(str);
|
||||
(currentLength > max) ? max = CountVisibleCharacters(str) : max;
|
||||
}
|
||||
return max;
|
||||
}
|
||||
|
@@ -1,99 +0,0 @@
|
||||
#ifndef BASEVISUALIZER_H
|
||||
#define BASEVISUALIZER_H
|
||||
|
||||
#include <string>
|
||||
#include <vector>
|
||||
#include <cmath>
|
||||
#include <iostream>
|
||||
|
||||
enum Colors {
|
||||
BLACK = 0, RED = 1, GREEN = 2, YELLOW = 3, BLUE = 4, MAGENTA = 5, CYAN = 6, WHITE = 7,
|
||||
LIGHT_BLACK = 10, LIGHT_RED = 11, LIGHT_GREEN = 12, LIGHT_YELLOW = 13, LIGHT_BLUE = 14,
|
||||
LIGHT_MAGENTA = 15, LIGHT_CYAN = 16, LIGHT_WHITE = 17, DEFAULT = 9
|
||||
};
|
||||
|
||||
class BaseVisualizer {
|
||||
protected:
|
||||
inline static const std::string TOP_LEFT_CORNER = "\u2554";
|
||||
inline static const std::string TOP_RIGHT_CORNER = "\u2557";
|
||||
inline static const std::string HORIZONTAL_LINE = "\u2550";
|
||||
inline static const std::string VERTICAL_LINE = "\u2551";
|
||||
inline static const std::string BOTTOM_LEFT_CORNER = "\u255A";
|
||||
inline static const std::string BOTTOM_RIGHT_CORNER = "\u255D";
|
||||
inline static const std::string RIGHT_CROSS = "\u2560";
|
||||
inline static const std::string LEFT_CROSS = "\u2563";
|
||||
inline static const std::string CROSS = "\u256C";
|
||||
inline static const std::string TOP_CROSS = "\u2566";
|
||||
inline static const std::string BOTTOM_CROSS = "\u2569";
|
||||
|
||||
inline static const std::string TOP_LEFT_CORNER_SINGLE = "\u250C";
|
||||
inline static const std::string TOP_RIGHT_CORNER_SINGLE = "\u2510";
|
||||
inline static const std::string HORIZONTAL_LINE_SINGLE = "\u2500";
|
||||
inline static const std::string VERTICAL_LINE_SINGLE = "\u2502";
|
||||
inline static const std::string BOTTOM_LEFT_CORNER_SINGLE = "\u2514";
|
||||
inline static const std::string BOTTOM_RIGHT_CORNER_SINGLE = "\u2518";
|
||||
inline static const std::string RIGHT_CROSS_SINGLE = "\u251C";
|
||||
inline static const std::string LEFT_CROSS_SINGLE = "\u2524";
|
||||
inline static const std::string CROSS_SINGLE = "\u253C";
|
||||
inline static const std::string TOP_CROSS_SINGLE = "\u252C";
|
||||
inline static const std::string BOTTOM_CROSS_SINGLE = "\u2534";
|
||||
|
||||
const size_t MAX_MENU_WIDTH;
|
||||
const size_t PADDING;
|
||||
|
||||
std::vector<std::vector<std::string>> display_vector;
|
||||
|
||||
void GenerateEmptyLine(const int lengthOfMenu, const bool single);
|
||||
void GenerateBoxMenuLine(const size_t length, const std::string& str, const bool single, const size_t padding);
|
||||
void GenerateCenteredString(const size_t widthOfMenu, const std::string& str, const bool single);
|
||||
size_t CalculateMaxMenuWidth(const size_t longestStringLength, const size_t padding);
|
||||
size_t FindMaxLength(const std::vector<std::string> vec);
|
||||
void GenerateTopBottomBorder(const size_t totalLength, const bool top, const bool single);
|
||||
void AddEmptyLines(const size_t lines, const size_t length, const bool sinlge);
|
||||
void GenerateTableTopBottom(const size_t totalLength, const bool top, const bool single);
|
||||
void GenerateTableLine(const float length, const std::vector<std::string>& str, const bool single);
|
||||
void GenerateTableSeperator(const float length, const bool single);
|
||||
void GenerateBoxSeperator(const float length, const bool single);
|
||||
void SetConsoleColor(Colors foreground, Colors background);
|
||||
|
||||
static size_t GetSumAllCharsFromVector(const std::vector<std::string>& vec);
|
||||
static size_t CountVisibleCharacters(const std::string& str);
|
||||
|
||||
private:
|
||||
virtual void GenerateElement() = 0;
|
||||
|
||||
public:
|
||||
virtual ~BaseVisualizer() = default;
|
||||
static void ClearTerminal();
|
||||
void DisplayElement();
|
||||
std::vector<std::vector<std::string>>* GetDisplayVector();
|
||||
BaseVisualizer(size_t longestStringLength, size_t padding) : MAX_MENU_WIDTH(BaseVisualizer::CalculateMaxMenuWidth(longestStringLength, padding)), PADDING(padding) {}
|
||||
};
|
||||
|
||||
#endif //BASEVISUALIZER_H
|
||||
|
||||
/**
|
||||
*
|
||||
ChessboardVisualizer.cpp
|
||||
HistorieVisualizer.cpp
|
||||
CommandVisualizer.cpp
|
||||
|
||||
PlayVisualizer.cpp {
|
||||
ChessboardVisualizer.display_vector
|
||||
|
||||
|
||||
HistorieVisualizer.display_vector;
|
||||
|
||||
CommandVisualizer.display_vector;
|
||||
|
||||
st::cout << ChessboardVisualizer.display_vector[i] (isEmpty) ? << std:endl : << Padding << Menus.display_vector[i] << std:endl;
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
*/
|
@@ -1,166 +0,0 @@
|
||||
#include "ChessboardVisualizer.hpp"
|
||||
|
||||
size_t ChessboardVisualizer::GetMaxBoardWidth() {
|
||||
std::string temp;
|
||||
|
||||
temp.append(3, ' ');
|
||||
|
||||
temp += BaseVisualizer::TOP_LEFT_CORNER;
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int j = 0; j < 7; j++) {
|
||||
temp += BaseVisualizer::HORIZONTAL_LINE;
|
||||
}
|
||||
}
|
||||
temp += BaseVisualizer::TOP_RIGHT_CORNER;
|
||||
|
||||
return BaseVisualizer::CountVisibleCharacters(temp);
|
||||
}
|
||||
|
||||
void ChessboardVisualizer::GenerateTopBottomBorder(bool top, bool single) {
|
||||
std::string temp;
|
||||
|
||||
temp.append(3, ' '); // ToDo: Padding?
|
||||
|
||||
temp += (top)
|
||||
? ((single)
|
||||
? BaseVisualizer::TOP_LEFT_CORNER_SINGLE
|
||||
: BaseVisualizer::TOP_LEFT_CORNER)
|
||||
: ((single)
|
||||
? BaseVisualizer::BOTTOM_LEFT_CORNER_SINGLE
|
||||
: BaseVisualizer::BOTTOM_LEFT_CORNER);
|
||||
for (int i = 0; i < 8; i++) {
|
||||
for (int j = 0; j < 7; j++) {
|
||||
temp += (single) ? BaseVisualizer::HORIZONTAL_LINE_SINGLE : BaseVisualizer::HORIZONTAL_LINE;
|
||||
}
|
||||
}
|
||||
display_vector.push_back({temp + ((top) ? ((single) ? BaseVisualizer::TOP_RIGHT_CORNER_SINGLE : BaseVisualizer::TOP_RIGHT_CORNER) : ((single) ? BaseVisualizer::BOTTOM_RIGHT_CORNER_SINGLE : BaseVisualizer::BOTTOM_RIGHT_CORNER))});
|
||||
}
|
||||
|
||||
void ChessboardVisualizer::GenerateElement() {
|
||||
BaseVisualizer::ClearTerminal();
|
||||
|
||||
GeneratePlayers();
|
||||
|
||||
GenerateChessboard();
|
||||
|
||||
//GenerateDisplayVector();
|
||||
}
|
||||
|
||||
void ChessboardVisualizer::GeneratePlayers() {
|
||||
std::string result;
|
||||
result.append(3, ' ');
|
||||
display_vector.push_back({result + CHESSBOARD->GetPlayer(ChessPieceColor::White)->GetName()
|
||||
+ " vs. " + CHESSBOARD->GetPlayer(ChessPieceColor::Black)->GetName()});
|
||||
}
|
||||
|
||||
void ChessboardVisualizer::GenerateChessboard() {
|
||||
std::vector<std::string> temp;
|
||||
for (int rank = 8; rank >= 1; rank--) {
|
||||
if (rank == 8) GenerateTopBottomBorder(true, true);
|
||||
for (int heightOfField = 0; heightOfField < 3; heightOfField++) {
|
||||
for (char file = 'A'; file <= 'H'; file++) {
|
||||
if (file == 'A') {
|
||||
temp.push_back((heightOfField == 1) ? " " + std::to_string(rank) + " " : std::string(3, ' '));
|
||||
temp.push_back(BaseVisualizer::VERTICAL_LINE_SINGLE);
|
||||
}
|
||||
|
||||
temp.push_back(GenerateBoardField(file, rank, heightOfField));
|
||||
|
||||
if (file == 'H') {
|
||||
temp.push_back(BaseVisualizer::VERTICAL_LINE_SINGLE);
|
||||
}
|
||||
}
|
||||
display_vector.push_back(temp);
|
||||
temp.clear();
|
||||
}
|
||||
if (rank == 1) {
|
||||
GenerateTopBottomBorder(false, true);
|
||||
GenerateFiles();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string ChessboardVisualizer::GenerateBoardField(char file, int rank, int height) {
|
||||
ChessPiecePosition* position = new ChessPiecePosition(file, rank);
|
||||
if (height == 1 && !CHESSBOARD->IsEmptyField(position)) {
|
||||
ChessPiece* piece = CHESSBOARD->GetChessPiece(position);
|
||||
return std::string(3, ' ') + piece->GetUnicode() + std::string(3, ' ');
|
||||
}
|
||||
return std::string(7, ' ');
|
||||
}
|
||||
|
||||
void ChessboardVisualizer::GenerateFiles() {
|
||||
std::string temp;
|
||||
|
||||
for (char file = 'A'; file <= 'H'; file++) {
|
||||
if (file == 'A') {
|
||||
temp += (std::string(4, ' '));
|
||||
}
|
||||
|
||||
temp += (std::string(3, ' ') + std::string(1, file) + std::string(3, ' '));
|
||||
|
||||
if (file == 'H') {
|
||||
temp += " ";
|
||||
}
|
||||
}
|
||||
display_vector.push_back({temp});
|
||||
}
|
||||
|
||||
|
||||
// board[2] bis board[25] Feld des Schachbretts
|
||||
// in vectoren von 2 bis 25 index von 2 bis 9
|
||||
void ChessboardVisualizer::DisplayElement() {
|
||||
size_t size;
|
||||
std::string temp;
|
||||
for (int row = 0; row < display_vector.size(); ++row) {
|
||||
for (int column = 0; column < display_vector[row].size(); ++column) {
|
||||
if (row >= 2 && row <= 25 && column >= 2 && column <= 9) {
|
||||
bool isSecondRowOfField = (row % 3 == 2);
|
||||
bool isBlackWhite = (column % 2 == row % 2);
|
||||
|
||||
if ((row - 1) % 3 == 0) { // Change after 3 rows
|
||||
if (isSecondRowOfField) {
|
||||
this->SetConsoleColor(isBlackWhite ? WHITE : BLACK, isBlackWhite ? BLACK : WHITE);
|
||||
} else {
|
||||
this->SetConsoleColor(isBlackWhite ? BLACK : WHITE, isBlackWhite ? WHITE : BLACK);
|
||||
}
|
||||
} else {
|
||||
if (isSecondRowOfField) {
|
||||
this->SetConsoleColor(isBlackWhite ? BLACK : WHITE, isBlackWhite ? WHITE : BLACK);
|
||||
} else {
|
||||
this->SetConsoleColor(isBlackWhite ? WHITE : BLACK, isBlackWhite ? BLACK : WHITE);
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << display_vector[row][column];
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
}
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
/*void ChessboardVisualizer::GenerateDisplayVector() {
|
||||
std::string temp;
|
||||
size_t size;
|
||||
|
||||
for (auto& row : draw_vector) {
|
||||
if (row.size() > 1) {
|
||||
for (const auto& element : row) {
|
||||
temp += element;
|
||||
}
|
||||
display_vector.push_back(FillStringToMaxLength(temp));
|
||||
temp = "";
|
||||
} else {
|
||||
display_vector.push_back(FillStringToMaxLength(row[0]));
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
std::string ChessboardVisualizer::FillStringToMaxLength(std::string& str) {
|
||||
size_t size = BaseVisualizer::CountVisibleCharacters(str);
|
||||
return ((size == MAX_MENU_WIDTH)
|
||||
? str
|
||||
: str.append(std::string(MAX_MENU_WIDTH - size, ' ')));
|
||||
}*/
|
@@ -1,32 +0,0 @@
|
||||
#ifndef CHESSBOARDVISUALIZER_HPP
|
||||
#define CHESSBOARDVISUALIZER_HPP
|
||||
|
||||
#include "BaseVisualizer.hpp"
|
||||
#include "../Chessboard/Chessboard.hpp"
|
||||
#include "../Chesspieces/Chesspiece.hpp"
|
||||
|
||||
class ChessboardVisualizer : public BaseVisualizer {
|
||||
|
||||
private:
|
||||
Chessboard* CHESSBOARD;
|
||||
std::vector<std::vector<std::string>> draw_vector;
|
||||
|
||||
static size_t GetMaxBoardWidth();
|
||||
|
||||
void GenerateTopBottomBorder(bool top, bool single);
|
||||
void GenerateElement() override;
|
||||
void GeneratePlayers();
|
||||
void GenerateChessboard();
|
||||
void GenerateFiles();
|
||||
std::string GenerateBoardField(char file, int rank, int height);
|
||||
void GenerateDisplayVector();
|
||||
std::string FillStringToMaxLength(std::string& str);
|
||||
|
||||
public:
|
||||
ChessboardVisualizer(Chessboard* chessboard, size_t padding) : BaseVisualizer(ChessboardVisualizer::GetMaxBoardWidth(), padding), CHESSBOARD(chessboard) {
|
||||
ChessboardVisualizer::GenerateElement();
|
||||
};
|
||||
void DisplayElement();
|
||||
};
|
||||
|
||||
#endif //CHESSBOARDVISUALIZER_HPP
|
@@ -1,13 +0,0 @@
|
||||
#include "CommandMenuVisualizer.hpp"
|
||||
|
||||
void CommandMenuVisualizer::GenerateElement() {
|
||||
BaseVisualizer::display_vector.push_back({"Commands"});
|
||||
BaseVisualizer::GenerateTopBottomBorder(MAX_MENU_WIDTH, true, true);
|
||||
for (const auto& content : menuContent) {
|
||||
BaseVisualizer::GenerateBoxMenuLine(MAX_MENU_WIDTH, content, true, PADDING);
|
||||
}
|
||||
BaseVisualizer::GenerateBoxSeperator(MAX_MENU_WIDTH, true);
|
||||
std::string str_temp = ((CHESSBOARD->GetCurrentPlayer()->GetColor() == ChessPieceColor::White) ? "White" : "Black");
|
||||
BaseVisualizer::GenerateBoxMenuLine(MAX_MENU_WIDTH, "Move [" + str_temp + "] : " + "\x1B[s", true, true);
|
||||
BaseVisualizer::GenerateTopBottomBorder(MAX_MENU_WIDTH, false, true);
|
||||
}
|
@@ -1,30 +0,0 @@
|
||||
#ifndef COMMANDMENUVISUALIZER_HPP
|
||||
#define COMMANDMENUVISUALIZER_HPP
|
||||
|
||||
#include "BaseVisualizer.hpp"
|
||||
#include "../Chessboard/Chessboard.hpp"
|
||||
|
||||
class CommandMenuVisualizer : public BaseVisualizer {
|
||||
private:
|
||||
inline static const std::vector<std::string> menuContent = {
|
||||
"To execute command: $<command_no>",
|
||||
"",
|
||||
"1 - Instructions",
|
||||
"2 - Save",
|
||||
"3 - Exit",
|
||||
"",
|
||||
"8 - Resign",
|
||||
"9 - Draw"
|
||||
};
|
||||
|
||||
Chessboard* CHESSBOARD;
|
||||
|
||||
void GenerateElement() override;
|
||||
|
||||
public:
|
||||
CommandMenuVisualizer(Chessboard* chessboard, size_t padding) : BaseVisualizer(CommandMenuVisualizer::FindMaxLength(menuContent), padding), CHESSBOARD(chessboard) {
|
||||
CommandMenuVisualizer::GenerateElement();
|
||||
}
|
||||
};
|
||||
|
||||
#endif //COMMANDMENUVISUALIZER_HPP
|
@@ -1,16 +0,0 @@
|
||||
#include "HistorieVisualizer.hpp"
|
||||
|
||||
void HistorieVisualizer::GenerateElement() {
|
||||
BaseVisualizer::display_vector.push_back({"Historie"});
|
||||
BaseVisualizer::GenerateTableTopBottom(MAX_MENU_WIDTH, true, true);
|
||||
|
||||
BaseVisualizer::GenerateTableLine(MAX_MENU_WIDTH, {HistorieVisualizer::PLAYER1, HistorieVisualizer::PLAYER2}, true);
|
||||
BaseVisualizer::BaseVisualizer::GenerateTableSeperator(MAX_MENU_WIDTH, true);
|
||||
|
||||
// ToDo: History einlesen und anzeigen lassenF
|
||||
for (size_t i = 0; i < 5; i++) {
|
||||
BaseVisualizer::GenerateTableLine(MAX_MENU_WIDTH, {"", ""}, true);
|
||||
}
|
||||
|
||||
BaseVisualizer::GenerateTableTopBottom(MAX_MENU_WIDTH, false, true);
|
||||
}
|
@@ -1,28 +0,0 @@
|
||||
#ifndef HISTORIEVISUALIZER_HPP
|
||||
#define HISTORIEVISUALIZER_HPP
|
||||
|
||||
#include "BaseVisualizer.hpp"
|
||||
#include "../Chessboard/Chessboard.hpp"
|
||||
|
||||
class HistorieVisualizer : public BaseVisualizer {
|
||||
private:
|
||||
const std::string PLAYER1;
|
||||
const std::string PLAYER2;
|
||||
|
||||
std::vector<std::vector<std::string>> histories;
|
||||
Chessboard* CHESSBOARD;
|
||||
|
||||
void GenerateElement() override;
|
||||
|
||||
public:
|
||||
HistorieVisualizer(Chessboard* chessbord,const size_t menuWidth, const size_t padding) :
|
||||
BaseVisualizer(menuWidth, padding), histories(5, std::vector<std::string>(2, "")),
|
||||
CHESSBOARD(chessbord),
|
||||
PLAYER1(chessbord->GetPlayer(ChessPieceColor::White)->GetName()),
|
||||
PLAYER2(chessbord->GetPlayer(ChessPieceColor::Black)->GetName())
|
||||
{
|
||||
HistorieVisualizer::GenerateElement();
|
||||
};
|
||||
};
|
||||
|
||||
#endif //HISTORIEVISUALIZER_HPP
|
@@ -1,13 +0,0 @@
|
||||
#include "InstructionsVisualizer.hpp"
|
||||
|
||||
void InstructionsVisualizer::GenerateElement() {
|
||||
BaseVisualizer::GenerateTopBottomBorder(MAX_MENU_WIDTH, true, false);
|
||||
BaseVisualizer::AddEmptyLines(5, MAX_MENU_WIDTH, false);
|
||||
for (const auto& content : menuContent) {
|
||||
BaseVisualizer::GenerateBoxMenuLine(MAX_MENU_WIDTH, content, false, PADDING);
|
||||
}
|
||||
BaseVisualizer::AddEmptyLines(2, MAX_MENU_WIDTH, false);
|
||||
BaseVisualizer::GenerateBoxMenuLine(MAX_MENU_WIDTH, "Enter any key to return to menu: \x1B[s", false, PADDING);
|
||||
BaseVisualizer::AddEmptyLines(5, MAX_MENU_WIDTH, false);
|
||||
BaseVisualizer::GenerateTopBottomBorder(MAX_MENU_WIDTH, false, false);
|
||||
}
|
@@ -1,19 +0,0 @@
|
||||
#ifndef INSTRUCTIONSVISUALIZER_HPP
|
||||
#define INSTRUCTIONSVISUALIZER_HPP
|
||||
|
||||
#include "BaseVisualizer.hpp"
|
||||
|
||||
class InstructionsVisualizer : public BaseVisualizer {
|
||||
private:
|
||||
inline static const std::vector<std::string> menuContent = {
|
||||
"Hier kommt noch eine Anleitung"
|
||||
};
|
||||
void GenerateElement() override;
|
||||
|
||||
public:
|
||||
InstructionsVisualizer() : BaseVisualizer(60, 4) {
|
||||
InstructionsVisualizer::GenerateElement();
|
||||
};
|
||||
};
|
||||
|
||||
#endif //INSTRUCTIONSVISUALIZER_HPP
|
@@ -1,103 +0,0 @@
|
||||
#include "PlayingViewVisualizer.hpp"
|
||||
#include "ChessboardVisualizer.hpp"
|
||||
#include "HistorieVisualizer.hpp"
|
||||
#include "CommandMenuVisualizer.hpp"
|
||||
|
||||
void PlayingViewVisualizer::GenerateElement() {
|
||||
position_vector.clear();
|
||||
display_vector.clear();
|
||||
ChessboardVisualizer chessboardVisualizer = ChessboardVisualizer(CHESSBOARD, 2);
|
||||
HistorieVisualizer historieVisualizer = HistorieVisualizer(CHESSBOARD, 32, 2);
|
||||
CommandMenuVisualizer cmdMenuVisualizer = CommandMenuVisualizer(CHESSBOARD, 2);
|
||||
|
||||
GeneratePositionVector(chessboardVisualizer.GetDisplayVector(), historieVisualizer.GetDisplayVector(), cmdMenuVisualizer.GetDisplayVector());
|
||||
|
||||
BaseVisualizer::GenerateTopBottomBorder(MAX_MENU_WIDTH, true, false);
|
||||
BaseVisualizer::GenerateEmptyLine(MAX_MENU_WIDTH, false);
|
||||
|
||||
std::vector<std::string> temp;
|
||||
|
||||
//((single) ? BaseVisualizer::VERTICAL_LINE_SINGLE : BaseVisualizer::VERTICAL_LINE) + std::string(padding, ' ')
|
||||
|
||||
for (const auto& row : position_vector) {
|
||||
display_vector.push_back(row);
|
||||
}
|
||||
|
||||
BaseVisualizer::GenerateEmptyLine(MAX_MENU_WIDTH, false);
|
||||
BaseVisualizer::GenerateTopBottomBorder(MAX_MENU_WIDTH, false, false);
|
||||
//size_t maxWidth = BaseVisualizer::FindMaxLength(chessboardVisualizer.display_vector);
|
||||
|
||||
}
|
||||
|
||||
void PlayingViewVisualizer::GeneratePositionVector(
|
||||
std::vector<std::vector<std::string>>* chessboard_display_vector,
|
||||
std::vector<std::vector<std::string>>* historie_display_vector,
|
||||
std::vector<std::vector<std::string>>* command_menu_display_vector)
|
||||
{
|
||||
for (size_t i = 0; i < chessboard_display_vector->size(); ++i) {
|
||||
size_t test;
|
||||
std::vector<std::string> temp;
|
||||
temp.push_back({BaseVisualizer::VERTICAL_LINE + " "});
|
||||
if (i == 0) {
|
||||
const std::string& first_element = chessboard_display_vector->at(i).at(0);
|
||||
temp.push_back(first_element);
|
||||
temp.push_back(std::string(62-BaseVisualizer::CountVisibleCharacters(first_element), ' '));
|
||||
} else if (chessboard_display_vector->at(i).size() > 1 && i != 0) {
|
||||
temp.insert(temp.end(), chessboard_display_vector->at(i).begin(), chessboard_display_vector->at(i).end());
|
||||
} else {
|
||||
temp.push_back(chessboard_display_vector->at(i).at(0));
|
||||
}
|
||||
|
||||
if (i < historie_display_vector->size()) {
|
||||
temp.push_back(std::string(DISTANCE_BETWEEN_ELEMENTS, ' '));
|
||||
temp.push_back(historie_display_vector->at(i)[0]);
|
||||
} else if (i-3-historie_display_vector->size() < command_menu_display_vector->size()) {
|
||||
temp.push_back(std::string(DISTANCE_BETWEEN_ELEMENTS, ' '));
|
||||
temp.push_back(command_menu_display_vector->at(i-3-historie_display_vector->size())[0]);
|
||||
} else{
|
||||
temp.push_back({"", ""});
|
||||
}
|
||||
|
||||
BaseVisualizer::GetSumAllCharsFromVector(temp);
|
||||
temp.push_back(std::string(MAX_MENU_WIDTH-BaseVisualizer::GetSumAllCharsFromVector(temp)-1, ' ') + BaseVisualizer::VERTICAL_LINE);
|
||||
|
||||
position_vector.push_back(temp);
|
||||
}
|
||||
}
|
||||
|
||||
void PlayingViewVisualizer::DisplayElement() {
|
||||
PlayingViewVisualizer::GenerateElement();
|
||||
size_t size;
|
||||
std::string temp;
|
||||
for (int row = 0; row < display_vector.size(); ++row) {
|
||||
for (int column = 0; column < display_vector[row].size(); ++column) {
|
||||
if (row >= 4 && row <= 27 && column >= 3 && column <= 10) {
|
||||
bool isSecondRowOfField = ((row-1) % 3 == 2);
|
||||
bool isBlackWhite = ((column-1) % 2 == (row-1) % 2);
|
||||
|
||||
if ((row - 1) % 3 == 0) { // Change after 3 rows
|
||||
if (isSecondRowOfField) {
|
||||
this->SetConsoleColor(isBlackWhite ? BLACK : WHITE, isBlackWhite ? WHITE : BLACK);
|
||||
} else {
|
||||
this->SetConsoleColor(isBlackWhite ? WHITE : BLACK, isBlackWhite ? BLACK : WHITE);
|
||||
}
|
||||
} else {
|
||||
if (isSecondRowOfField) {
|
||||
this->SetConsoleColor(isBlackWhite ? WHITE : BLACK, isBlackWhite ? BLACK : WHITE);
|
||||
} else {
|
||||
this->SetConsoleColor(isBlackWhite ? BLACK : WHITE, isBlackWhite ? WHITE : BLACK);
|
||||
}
|
||||
}
|
||||
}
|
||||
std::cout << display_vector[row][column];
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
}
|
||||
this->SetConsoleColor(DEFAULT, DEFAULT);
|
||||
|
||||
std::cout << std::endl;
|
||||
}
|
||||
}
|
||||
|
||||
std::string PlayingViewVisualizer::GetMove() {
|
||||
return move;
|
||||
}
|
@@ -1,29 +0,0 @@
|
||||
#ifndef PLAYINGVIEWVISUALIZER_HPP
|
||||
#define PLAYINGVIEWVISUALIZER_HPP
|
||||
|
||||
#include "BaseVisualizer.hpp"
|
||||
#include "../Chessboard/Chessboard.hpp"
|
||||
|
||||
class PlayingViewVisualizer : public BaseVisualizer {
|
||||
private:
|
||||
const size_t DISTANCE_BETWEEN_ELEMENTS;
|
||||
|
||||
Chessboard* CHESSBOARD;
|
||||
std::string move;
|
||||
|
||||
std::vector<std::vector<std::string>> position_vector;
|
||||
|
||||
void GenerateElement();
|
||||
void GeneratePositionVector(
|
||||
std::vector<std::vector<std::string>>* chessboard_display_vector,
|
||||
std::vector<std::vector<std::string>>* historie_display_vector,
|
||||
std::vector<std::vector<std::string>>* command_menu_display_vector);
|
||||
|
||||
public:
|
||||
PlayingViewVisualizer(Chessboard* chessboard, size_t padding, size_t distance) :
|
||||
BaseVisualizer(110, padding), CHESSBOARD(chessboard), DISTANCE_BETWEEN_ELEMENTS(distance) {}
|
||||
void DisplayElement();
|
||||
std::string GetMove();
|
||||
};
|
||||
|
||||
#endif //PLAYINGVIEWVISUALIZER_HPP
|
@@ -1,66 +0,0 @@
|
||||
#include "StartMenuVisualizer.hpp"
|
||||
|
||||
void StartMenuVisualizer::GenerateElement() {
|
||||
BaseVisualizer::GenerateTopBottomBorder(MAX_MENU_WIDTH, true, false);
|
||||
|
||||
BaseVisualizer::AddEmptyLines(2, MAX_MENU_WIDTH, false);
|
||||
|
||||
for (const auto& str : StartMenuVisualizer::ACSII_ART_TURBO_SCHACH) {
|
||||
BaseVisualizer::GenerateCenteredString(MAX_MENU_WIDTH, str, false);
|
||||
}
|
||||
|
||||
BaseVisualizer::AddEmptyLines(2, MAX_MENU_WIDTH, false);
|
||||
|
||||
BaseVisualizer::GenerateCenteredString(MAX_MENU_WIDTH, "Welcome to TurboSchach!", false);
|
||||
|
||||
BaseVisualizer::AddEmptyLines(2, MAX_MENU_WIDTH, false);
|
||||
|
||||
BaseVisualizer::GenerateCenteredString(MAX_MENU_WIDTH, "Please select one of the menu options:", false);
|
||||
BaseVisualizer::GenerateCenteredString(MAX_MENU_WIDTH, "\x1B[s", false);
|
||||
|
||||
BaseVisualizer::AddEmptyLines(1, MAX_MENU_WIDTH, false);
|
||||
|
||||
// ToDo: Attribute zum direkten setzen des Types der Außenbegrenzung -> Allgemein in BaseVisualizer auch?
|
||||
// ToDo: Überarbeiten -> Extra Methode um Menus im Menu zu generieren
|
||||
BaseVisualizer::GenerateTopBottomBorder(24, true, true);
|
||||
BaseVisualizer::GenerateCenteredString(MAX_MENU_WIDTH, BaseVisualizer::display_vector[BaseVisualizer::display_vector.size()-1][0], false);
|
||||
BaseVisualizer::display_vector.erase(BaseVisualizer::display_vector.begin() + (BaseVisualizer::display_vector.size() - 2));
|
||||
|
||||
|
||||
for (const auto& str : StartMenuVisualizer::MENU_OPTIONS) {
|
||||
BaseVisualizer::GenerateBoxMenuLine(24, str, true, 1);
|
||||
BaseVisualizer::GenerateCenteredString(MAX_MENU_WIDTH, BaseVisualizer::display_vector[BaseVisualizer::display_vector.size()-1][0], false);
|
||||
BaseVisualizer::display_vector.erase(BaseVisualizer::display_vector.begin() + (BaseVisualizer::display_vector.size() - 2));
|
||||
|
||||
}
|
||||
|
||||
BaseVisualizer::GenerateTopBottomBorder(24, false, true);
|
||||
BaseVisualizer::GenerateCenteredString(MAX_MENU_WIDTH, BaseVisualizer::display_vector[BaseVisualizer::display_vector.size()-1][0], false);
|
||||
BaseVisualizer::display_vector.erase(BaseVisualizer::display_vector.begin() + (BaseVisualizer::display_vector.size() - 2));
|
||||
|
||||
|
||||
BaseVisualizer::AddEmptyLines(2, MAX_MENU_WIDTH, false);
|
||||
|
||||
BaseVisualizer::GenerateTopBottomBorder(MAX_MENU_WIDTH, false, false);
|
||||
}
|
||||
|
||||
int StartMenuVisualizer::GetSelectedOption() {
|
||||
return selectedOption;
|
||||
}
|
||||
|
||||
void StartMenuVisualizer::SetSelectedOption(int optionSelect) {
|
||||
selectedOption = selectedOption;
|
||||
};
|
||||
|
||||
void StartMenuVisualizer::DisplayElement1() {
|
||||
BaseVisualizer::ClearTerminal();
|
||||
int temp;
|
||||
for (const auto& row : display_vector) {
|
||||
for (const auto& cell : row) {
|
||||
std::cout << cell;
|
||||
}
|
||||
std::cout << std::endl;
|
||||
}
|
||||
std::cout << "\x1B[u";
|
||||
std::cin >> selectedOption;
|
||||
}
|
@@ -1,39 +0,0 @@
|
||||
#ifndef STARTMENUVISUALIZER_H
|
||||
#define STARTMENUVISUALIZER_H
|
||||
|
||||
#include "BaseVisualizer.hpp"
|
||||
|
||||
class StartMenuVisualizer : public BaseVisualizer {
|
||||
private:
|
||||
inline static const std::vector<std::string> ACSII_ART_TURBO_SCHACH = {
|
||||
"████████╗██╗░░░██╗██████╗░██████╗░░█████╗░░██████╗░█████╗░██╗░░██╗░█████╗░░█████╗░██╗░░██╗",
|
||||
"╚══██╔══╝██║░░░██║██╔══██╗██╔══██╗██╔══██╗██╔════╝██╔══██╗██║░░██║██╔══██╗██╔══██╗██║░░██║",
|
||||
"░░░██║░░░██║░░░██║██████╔╝██████╦╝██║░░██║╚█████╗░██║░░╚═╝███████║███████║██║░░╚═╝███████║",
|
||||
"░░░██║░░░██║░░░██║██╔══██╗██╔══██╗██║░░██║░╚═══██╗██║░░██╗██╔══██║██╔══██║██║░░██╗██╔══██║",
|
||||
"░░░██║░░░╚██████╔╝██║░░██║██████╦╝╚█████╔╝██████╔╝╚█████╔╝██║░░██║██║░░██║╚█████╔╝██║░░██║",
|
||||
"░░░╚═╝░░░░╚═════╝░╚═╝░░╚═╝╚═════╝░░╚════╝░╚═════╝░░╚════╝░╚═╝░░╚═╝╚═╝░░╚═╝░╚════╝░╚═╝░░╚═╝"
|
||||
};
|
||||
|
||||
inline static const std::vector<std::string> MENU_OPTIONS = {
|
||||
"1 - New Game",
|
||||
"2 - Load Save",
|
||||
"3 - Instructions",
|
||||
"",
|
||||
"0 - Exit"
|
||||
};
|
||||
|
||||
int selectedOption = -1;
|
||||
|
||||
void GenerateElement() override;
|
||||
|
||||
public:
|
||||
StartMenuVisualizer(size_t padding) : BaseVisualizer(BaseVisualizer::CountVisibleCharacters(StartMenuVisualizer::ACSII_ART_TURBO_SCHACH[0]), padding) {
|
||||
StartMenuVisualizer::GenerateElement();
|
||||
}
|
||||
int GetSelectedOption();
|
||||
void SetSelectedOption(int selectedOption);
|
||||
void DisplayElement1();
|
||||
|
||||
};
|
||||
|
||||
#endif //STARTMENUVISUALIZER_H
|
27
chessgames/1229276.pgn
Normal file
27
chessgames/1229276.pgn
Normal file
@@ -0,0 +1,27 @@
|
||||
[Event "Bosna 21st"]
|
||||
[Site "Sarajevo YUG"]
|
||||
[Date "1982.??.??"]
|
||||
[EventDate "1983.03.00"]
|
||||
[Round "?"]
|
||||
[Result "0-1"]
|
||||
[White "Vitomir Arapovic"]
|
||||
[Black "Alexander Beliavsky"]
|
||||
[ECO "C26"]
|
||||
[WhiteElo "?"]
|
||||
[BlackElo "?"]
|
||||
[PlyCount "150"]
|
||||
|
||||
1.e4 e5 2.Nc3 Nf6 3.Bc4 Bc5 4.d3 O-O 5.Nf3 Re8 6.Ng5 Re7 7.O-O
|
||||
h6 8.Nf3 c6 9.d4 exd4 10.e5 Ne8 11.Nxd4 d5 12.exd6 Nxd6 13.Bb3
|
||||
Na6 14.Be3 Qe8 15.Qf3 Bxd4 16.Bxd4 Nf5 17.Rad1 Bd7 18.Qh5 b6
|
||||
19.Qg6 Nxd4 20.Rxd4 Nc5 21.Bc4 Be6 22.Qg3 Bxc4 23.Rxc4 Rd8
|
||||
24.Rg4 f5 25.Rg6 Rd4 26.Rd6 f4 27.Qg6 Qxg6 28.Rxg6 Ne6 29.h4
|
||||
h5 30.g4 fxg3 31.Rxg3 Rf7 32.Re1 Nc5 33.Re8+ Kh7 34.Rg5 Rxh4
|
||||
35.b4 Nd7 36.Ne4 Nf6 37.Nxf6+ Rxf6 38.Re7 Rg6 39.Rxg6 Kxg6
|
||||
40.Re6+ Kh7 41.a3 Rc4 42.Re7 Rxc2 43.Rxa7 Rc4 44.Kg2 b5 45.Ra6
|
||||
g6 46.Ra8 Kh6 47.Rh8+ Kg5 48.Rg8 Kf5 49.Rf8+ Kg4 50.Rf6 g5
|
||||
51.Rf8 Rc3 52.Ra8 h4 53.a4 h3+ 54.Kh2 Rc2 55.Kg1 Rb2 56.axb5
|
||||
cxb5 57.Ra3 Kh4 58.Rd3 Rxb4 59.Kh2 g4 60.Rd5 Rb2 61.Kg1 Rb1+
|
||||
62.Kh2 Rf1 63.Rxb5 Rxf2+ 64.Kg1 Rc2 65.Rb4 Re2 66.Ra4 Kg3
|
||||
67.Ra1 Re3 68.Kh1 Kf3 69.Rf1+ Ke2 70.Rf8 g3 71.Kg1 Re4 72.Rh8
|
||||
Kf3 73.Rf8+ Rf4 74.Rg8 Rf7 75.Rh8 h2+ 0-1
|
29
chessgames/1258478.pgn
Normal file
29
chessgames/1258478.pgn
Normal file
@@ -0,0 +1,29 @@
|
||||
[Event "Wch-blitz"]
|
||||
[Site "Saint John CAN"]
|
||||
[Date "1988.02.20"]
|
||||
[EventDate "1988.02.19"]
|
||||
[Round "3"]
|
||||
[Result "1/2-1/2"]
|
||||
[White "Garry Kasparov"]
|
||||
[Black "Kiril Dimitrov Georgiev"]
|
||||
[ECO "A29"]
|
||||
[WhiteElo "2750"]
|
||||
[BlackElo "2595"]
|
||||
[PlyCount "155"]
|
||||
|
||||
1. c4 e5 2. Nc3 Nf6 3. Nf3 Nc6 4. g3 d5 5. cxd5 Nxd5 6. Bg2
|
||||
Nb6 7. O-O Be7 8. a3 a5 9. d3 O-O 10. Be3 Be6 11. Na4 Nd5
|
||||
12. Bc5 Bd6 13. Rc1 h6 14. Nd2 Rc8 15. Ne4 b6 16. Nxd6 cxd6
|
||||
17. Bxb6 Nxb6 18. Rxc6 Rb8 19. Nxb6 Rxb6 20. Qc2 Qb8 21. Rxb6
|
||||
Qxb6 22. Rb1 Bb3 23. Qd2 Rb8 24. Rc1 Be6 25. Rc2 d5 26. h4 a4
|
||||
27. Bf3 Qd4 28. e3 Qb6 29. d4 e4 30. Be2 Qb3 31. Kg2 g6
|
||||
32. Bd1 Kg7 33. Qc1 Qb6 34. Rd2 Bd7 35. Qc5 Qxc5 36. dxc5 Bc6
|
||||
37. Kf1 Kf6 38. Ke1 Ke5 39. Rc2 Rb5 40. Kd2 d4 41. exd4+ Kxd4
|
||||
42. Be2 Rxc5 43. Rxc5 Kxc5 44. Ke3 f5 45. g4 Kd5 46. gxf5 gxf5
|
||||
47.Kf4 Ke6 48. Bc4+ Kf6 49. b4 axb3 50. Bxb3 Bb5 51.a4 Ba6
|
||||
52.Bd5 Bc8 53.Bc6 Ke6 54.Bb5 Kd6 55. Bf1 Kc5 56.Bh3 Kb4
|
||||
57.Bxf5 Ba6 58.Bxe4 Kxa4 59.Ke5 Kb4 60. f4 Kc5 61.f5 Bc4 62.f6
|
||||
Bf7 63.Bf5 Kc6 64.Be6 Bg6 65.f7 Bxf7 66. Bxf7 Kd7 67.Kf6 Kd6
|
||||
68.h5 Kd7 69.Kg6 Ke7 70.Ba2 Ke8 71. Kxh6 Kf8 72.Kg6 Ke7 73.h6
|
||||
Kd6 74.h7 Kc5 75.h8=Q Kb4 76. Qd4+ Kb5 77.Bd5 Ka6 78.Qc5
|
||||
1/2-1/2
|
22
chessgames/1284086.pgn
Normal file
22
chessgames/1284086.pgn
Normal file
@@ -0,0 +1,22 @@
|
||||
[Event "Alicante"]
|
||||
[Site "Spain"]
|
||||
[Date "1992.??.??"]
|
||||
[EventDate "?"]
|
||||
[Round "7"]
|
||||
[Result "1/2-1/2"]
|
||||
[White "Stephen Boyd"]
|
||||
[Black "Torbjorn Glimbrant"]
|
||||
[ECO "C49"]
|
||||
[WhiteElo "2265"]
|
||||
[BlackElo "2235"]
|
||||
[PlyCount "91"]
|
||||
|
||||
1.e4 e5 2.Nf3 Nc6 3.Nc3 Nf6 4.Bb5 Bb4 5.O-O O-O 6.d3 d6 7.Bg5
|
||||
Bxc3 8.bxc3 Qe7 9.Re1 Nd8 10.d4 h6 11.Bc1 a6 12.Bd3 Bg4 13.h3
|
||||
Bd7 14.a4 a5 15.Nh4 Nc6 16.Nf5 Bxf5 17.exf5 Qd7 18.g4 exd4
|
||||
19.cxd4 Nxd4 20.Bb2 c5 21.Bxd4 cxd4 22.Bb5 Qc7 23.Qxd4 d5
|
||||
24.Re2 Rad8 25.Rae1 Rd6 26.Re7 Qxc2 27.Rxb7 Ne4 28.Re2 Qc1+
|
||||
29.Kg2 Qc8 30.Re7 Qd8 31.Qa7 Nf6 32.Rc7 d4 33.Ree7 d3 34.Rxf7
|
||||
Rxf7 35.Rxf7 d2 36.Rxg7+ Kh8 37.Be2 d1=Q 38.Bxd1 Rxd1 39.Rg6
|
||||
Qd5+ 40.Kg3 Rd3+ 41.Kh4 Rxh3+ 42.Kxh3 Qh1+ 43.Kg3 Nh5+ 44.gxh5
|
||||
Qf3+ 45.Kh2 Qg2+ 46.Kxg2 1/2-1/2
|
21
chessgames/1348060.pgn
Normal file
21
chessgames/1348060.pgn
Normal file
@@ -0,0 +1,21 @@
|
||||
[Event "Norwegian Championship"]
|
||||
[Site "Sandnes NOR"]
|
||||
[Date "2005.07.05"]
|
||||
[EventDate "2005.07.??"]
|
||||
[Round "5"]
|
||||
[Result "1-0"]
|
||||
[White "Magnus Carlsen"]
|
||||
[Black "Geir Sune Tallaksen Ostmoe"]
|
||||
[ECO "E15"]
|
||||
[WhiteElo "2528"]
|
||||
[BlackElo "2349"]
|
||||
[PlyCount "73"]
|
||||
|
||||
1. Nf3 Nf6 2. c4 e6 3. d4 b6 4. g3 Ba6 5. b3 b5 6. cxb5 Bxb5
|
||||
7. Bg2 d5 8. O-O Nbd7 9. Nc3 Ba6 10. Re1 Bd6 11. Bb2 O-O
|
||||
12. e4 Nxe4 13. Nxe4 dxe4 14. Rxe4 Bb7 15. Rh4 Be7 16. Rh3 Nf6
|
||||
17. Qe2 Bd5 18. Re1 Qb8 19. Ne5 Qb7 20. Bxd5 Qxd5 21. Qc2 c5
|
||||
22. Ng4 h6 23. Re5 Qf3 24. Nxh6+ gxh6 25. Rxh6 Kg7 26. Rg5+
|
||||
Kxh6 27. Bc1 cxd4 28. Rg4+ Qe3 29. Rh4+ Nh5 30. Rxh5+ Kxh5
|
||||
31. Qh7+ Kg4 32. fxe3 Rac8 33. Kg2 Rxc1 34. h3+ Kg5 35. Qg7+
|
||||
Kf5 36. g4+ Ke4 37. Qxd4# 1-0
|
31
chessgames/1427255.pgn
Normal file
31
chessgames/1427255.pgn
Normal file
@@ -0,0 +1,31 @@
|
||||
[Event "Youth - Experience"]
|
||||
[Site "Amsterdam NED"]
|
||||
[Date "2006.08.27"]
|
||||
[EventDate "2006.08.19"]
|
||||
[Round "8"]
|
||||
[Result "1/2-1/2"]
|
||||
[White "Ulf Andersson"]
|
||||
[Black "Daniel Stellwagen"]
|
||||
[ECO "A04"]
|
||||
[WhiteElo "2542"]
|
||||
[BlackElo "2575"]
|
||||
[PlyCount "175"]
|
||||
|
||||
1. Nf3 f5 2. d4 g6 3. g3 Bg7 4. Bg2 Nf6 5. O-O O-O 6. c4 d6
|
||||
7. Nc3 Qe8 8. d5 a5 9. Nd4 Na6 10. e4 fxe4 11. Nxe4 Nxe4
|
||||
12. Bxe4 Bh3 13. Re1 Nc5 14. Bh1 Qf7 15. Be3 Rae8 16. Qd2 b6
|
||||
17. b3 Kh8 18. Rad1 e5 19. dxe6 Nxe6 20. Bd5 Nxd4 21. Bxd4 Qd7
|
||||
22. a3 Bxd4 23. Qxd4+ Qg7 24. Qxg7+ Kxg7 25. Bc6 Rxe1+
|
||||
26. Rxe1 g5 27. f3 Bf5 28. Kf2 Kf6 29. b4 axb4 30. axb4 Be6
|
||||
31. Re4 Bf5 32. Rd4 Rf7 33. b5 Re7 34. Bd5 Be6 35. f4 Bxd5
|
||||
36. fxg5+ Kxg5 37. Rxd5+ Kg6 38. Kf3 Re1 39. h4 h5 40. Rg5+
|
||||
Kh6 41. g4 hxg4+ 42. Rxg4 Re5 43. Rd4 Rc5 44. Ke4 Kg6 45. Kd3
|
||||
Rh5 46. Rg4+ Kf6 47. Kd4 Ke6 48. Re4+ Kf6 49. Rg4 Ke6 50. Rf4
|
||||
Ke7 51. Ke4 Re5+ 52. Kf3 d5 53. Rd4 Re1 54. Rxd5 Rc1 55. Rd4
|
||||
Kf6 56. Ke4 Ke6 57. Kd3 Rd1+ 58. Kc3 Rc1+ 59. Kd2 Rh1 60. Re4+
|
||||
Kf6 61. Ke3 Rc1 62. Rg4 Kf5 63. Rg5+ Kf6 64. Kd4 Rh1 65. Rg4
|
||||
Ke6 66. Ke4 Re1+ 67. Kf3 Rc1 68. Ke3 Kf5 69. Rd4 Ke5 70. Rd5+
|
||||
Ke6 71. Kd3 Rd1+ 72. Ke4 Rh1 73. h5 Rh4+ 74. Kd3 Rh3+ 75. Kd4
|
||||
Rh4+ 76. Kc3 Rh3+ 77. Kb4 Rg3 78. Rd8 Rh3 79. Rh8 Kd7 80. h6
|
||||
c5+ 81. bxc6+ Kxc6 82. Rh7 Rh4 83. Kb3 Kc5 84. Rc7+ Kd6
|
||||
85. Rh7 Kc5 86. Rc7+ Kd6 87. Rb7 Kc6 88. Rh7 1/2-1/2
|
29
chessgames/1482551.pgn
Normal file
29
chessgames/1482551.pgn
Normal file
@@ -0,0 +1,29 @@
|
||||
[Event "Gibraltar Chess Festival"]
|
||||
[Site "Gibraltar ENG"]
|
||||
[Date "2008.01.23"]
|
||||
[EventDate "2008.01.22"]
|
||||
[Round "2"]
|
||||
[Result "1-0"]
|
||||
[White "Tim Jaksland"]
|
||||
[Black "Line Jin Jorgensen"]
|
||||
[ECO "C01"]
|
||||
[WhiteElo "2294"]
|
||||
[BlackElo "1867"]
|
||||
[PlyCount "149"]
|
||||
|
||||
1. e4 e6 2. d4 d5 3. exd5 exd5 4. Nf3 Nf6 5. Bd3 Bd6 6. O-O
|
||||
O-O 7. c4 c6 8. Nc3 Bg4 9. h3 Bh5 10. Re1 dxc4 11. Bxc4 Qc7
|
||||
12. g4 Bg6 13. Ne5 Nfd7 14. f4 Nxe5 15. dxe5 Bc5+ 16. Kg2 h6
|
||||
17. f5 Bh7 18. Qf3 Kh8 19. Bf4 b5 20. Bb3 Qb6 21. Rad1 a5
|
||||
22. a4 Ra7 23. Re2 b4 24. Ne4 Bd4 25. Rxd4 Qxd4 26. Rd2 Qb6
|
||||
27. Be3 Qc7 28. Bc5 Nd7 29. Rxd7 Qxd7 30. Bxf8 Qd4 31. Bc5
|
||||
Qxb2+ 32. Qf2 Qxf2+ 33. Kxf2 Rd7 34. Nd6 Bg8 35. Ke3 Re7
|
||||
36. Kf4 Rxe5 37. Kxe5 f6+ 38. Kd4 Bxb3 39. Bb6 Bxa4 40. Bxa5
|
||||
h5 41. gxh5 Bd1 42. h6 b3 43. hxg7+ Kxg7 44. Bc3 Kh6 45. Ke4
|
||||
Kh5 46. Bxf6 b2 47. Bxb2 Kh4 48. f6 Bb3 49. Ke5 Kxh3 50. f7
|
||||
Bxf7 51. Nxf7 c5 52. Nd6 c4 53. Kf4 c3 54. Bxc3 Kg2 55. Ne4
|
||||
Kh2 56. Kf3 Kg1 57. Nf2 Kh2 58. Be5+ Kg1 59. Bd6 Kf1 60. Bh2
|
||||
Ke1 61. Ne4 Kf1 62. Nd2+ Ke1 63. Ke3 Kd1 64. Kd3 Ke1 65. Bg3+
|
||||
Kd1 66. Bf2 Kc1 67. Nc4 Kd1 68. Nb2+ Kc1 69. Kc3 Kb1 70. Kb3
|
||||
Ka1 71. Be3 Kb1 72. Bf4 Ka1 73. Nc4 Kb1 74. Na3+ Ka1 75. Be5+
|
||||
1-0
|
18
chessgames/1588906.pgn
Normal file
18
chessgames/1588906.pgn
Normal file
@@ -0,0 +1,18 @@
|
||||
[Event "BCF-ch 87th"]
|
||||
[Site "Street ENG"]
|
||||
[Date "2000.08.09"]
|
||||
[EventDate "2000.07.31"]
|
||||
[Round "9"]
|
||||
[Result "0-1"]
|
||||
[White "Jack Rudd"]
|
||||
[Black "Martin Simons"]
|
||||
[ECO "B01"]
|
||||
[WhiteElo "2176"]
|
||||
[BlackElo "2226"]
|
||||
[PlyCount "40"]
|
||||
|
||||
1. e4 d5 2. exd5 Nf6 3. c4 e6 4. dxe6 Bxe6 5. d4 Bb4+ 6. Bd2
|
||||
Bxd2+ 7. Qxd2 Qe7 8. Qe2 Nc6 9. Nf3 O-O-O 10. d5 Rhe8 11. Kd1
|
||||
Nxd5 12. cxd5 Bxd5 13. Nfd2 Qf6 14. Qd3 Bxg2 15. Qg3 Bxh1
|
||||
16. Nc3 Bf3+ 17. Kc1 Re1+ 18. Kc2 Nd4+ 19. Kd3 Nb3+ 20. Kc2
|
||||
Nxa1# 0-1
|
21
chessgames/1775611.pgn
Normal file
21
chessgames/1775611.pgn
Normal file
@@ -0,0 +1,21 @@
|
||||
[Event "Isle of Man Masters"]
|
||||
[Site "Douglas IMN"]
|
||||
[Date "2014.10.11"]
|
||||
[EventDate "2014.10.04"]
|
||||
[Round "8.2"]
|
||||
[Result "0-1"]
|
||||
[White "Gabriel Sargissian"]
|
||||
[Black "Nigel Short"]
|
||||
[ECO "A70"]
|
||||
[WhiteElo "2690"]
|
||||
[BlackElo "2646"]
|
||||
[PlyCount "78"]
|
||||
|
||||
1. d4 Nf6 2. c4 e6 3. Nf3 c5 4. d5 exd5 5. cxd5 d6 6. Nc3 g6
|
||||
7. Bf4 a6 8. a4 Bg7 9. h3 O-O 10. e3 Ne8 11. Be2 Nd7 12. O-O
|
||||
Rb8 13. Nd2 Ne5 14. a5 f5 15. Bg3 Bd7 16. Qb3 b5 17. axb6 Rxb6
|
||||
18. Qc2 Bb5 19. Nxb5 axb5 20. Nb3 g5 21. Na5 f4 22. Bh2 Nc7
|
||||
23. Rfd1 Kh8 24. Qe4 Qf6 25. exf4 gxf4 26. Nb3 Na6 27. Nd2 c4
|
||||
28. Qb1 Nc5 29. Ne4 Nxe4 30. Qxe4 Rb7 31. Ra5 Nd7 32. b4 cxb3
|
||||
33. Bd3 Qh6 34. Qb4 Nc5 35. Bb1 Be5 36. Rxb5 Rg7 37. Be4 Nxe4
|
||||
38. Qxe4 Qxh3 39. Kh1 Qh5 0-1
|
19
chessgames/1799484.pgn
Normal file
19
chessgames/1799484.pgn
Normal file
@@ -0,0 +1,19 @@
|
||||
[Event "Russian Championship Superfinal"]
|
||||
[Site "Chita RUS"]
|
||||
[Date "2015.08.12"]
|
||||
[EventDate "2015.08.09"]
|
||||
[Round "4"]
|
||||
[Result "0-1"]
|
||||
[White "Peter Svidler"]
|
||||
[Black "Denis Khismatullin"]
|
||||
[ECO "B91"]
|
||||
[WhiteElo "2739"]
|
||||
[BlackElo "2642"]
|
||||
[PlyCount "58"]
|
||||
|
||||
1. e4 c5 2. Nc3 a6 3. Nge2 d6 4. g3 g6 5. d4 cxd4 6. Nxd4 Bg7
|
||||
7. Bg2 Nf6 8. b3 O-O 9. Bb2 Bd7 10. Qd2 Nc6 11. Nde2 b5
|
||||
12. O-O-O Ng4 13. Rdf1 Qa5 14. h3 Nf6 15. Kb1 b4 16. Nd1 Qc7
|
||||
17. Ne3 a5 18. f4 a4 19. e5 dxe5 20. fxe5 Nxe5 21. Bxa8 Rxa8
|
||||
22. Rf4 axb3 23. axb3 Qa7 24. Nd4 Nh5 25. Nd5 Bc6 26. Nxc6
|
||||
Qa2+ 27. Kc1 Qa1+ 28. Bxa1 Rxa1+ 29. Kb2 Nc4# 0-1
|
218
main.cpp
218
main.cpp
@@ -1,156 +1,104 @@
|
||||
#ifdef _WIN32
|
||||
#include <windows.h>
|
||||
#endif
|
||||
#include <fstream>
|
||||
#include "Player/Player.hpp"
|
||||
#include "ChessPieces/Knight.hpp"
|
||||
#include "ChessPieces/Bishop.hpp"
|
||||
#include "ChessPieces/King.hpp"
|
||||
#include "ChessPieces/Pawn.hpp"
|
||||
#include "ChessPieces/Queen.hpp"
|
||||
#include "ChessPieces/Rook.hpp"
|
||||
#include "ChessPieces/ChessPiece.hpp"
|
||||
#include "Chessboard/Chessboard.hpp"
|
||||
#include "ChessPieces/ChessPiecePosition.hpp"
|
||||
#include "Chessboard/ChessboardVisualizerText.hpp"
|
||||
#include "Chessboard/ChessboardVisualizerGraphic.hpp"
|
||||
#include "Visualizer/BaseVisualizer.hpp"
|
||||
#include "Visualizer/StartMenuVisualizer.hpp"
|
||||
#include "Visualizer/HistorieVisualizer.hpp"
|
||||
#include "Visualizer/ChessboardVisualizer.hpp"
|
||||
#include "Visualizer/CommandMenuVisualizer.hpp"
|
||||
#include "Visualizer/PlayingViewVisualizer.hpp"
|
||||
#include "Visualizer/InstructionsVisualizer.hpp"
|
||||
|
||||
#include <iostream>
|
||||
#include <memory>
|
||||
#include <vector>
|
||||
#include <string>
|
||||
#include <locale>
|
||||
|
||||
void HandleThirdOption() {
|
||||
BaseVisualizer::ClearTerminal();
|
||||
InstructionsVisualizer instructions = InstructionsVisualizer();
|
||||
instructions.DisplayElement();
|
||||
std::cout << "\x1B[u";
|
||||
std::cin;
|
||||
}
|
||||
|
||||
void HandleCommandOptions(const std::string& command) {
|
||||
if (command == "1") {
|
||||
HandleThirdOption();
|
||||
} else if (command == "2") {
|
||||
// ToDo: Save implementieren
|
||||
} else if (command == "3") {
|
||||
// ToDo: Exit implementieren -> Möglichkeit noch zu speichern oder einfach speichern?
|
||||
} else if (command == "8") {
|
||||
// ToDo: Spiel beenden -> Gewinn an anderen gegeben
|
||||
} else if (command == "9") {
|
||||
// ToDo: Draw anbieten -> Anfrage mit Annahme/Ablehnen an anderen Spieler schicken
|
||||
}
|
||||
}
|
||||
|
||||
std::string ExtractAfterDollar(const std::string& userInput) {
|
||||
// Überprüfen, ob der String mit '$' beginnt
|
||||
if (!userInput.empty() && userInput[0] == '$') {
|
||||
return userInput.substr(1); // Rückgabe des Teils nach '$'
|
||||
}
|
||||
return ""; // Leerer String, wenn kein '$' am Anfang
|
||||
}
|
||||
|
||||
void HandleFirstOption() {
|
||||
BaseVisualizer::ClearTerminal();
|
||||
Player* playerA = new Player("Player 1");
|
||||
Player* playerB = new Player("Player 2");
|
||||
|
||||
Chessboard chessboard = Chessboard();
|
||||
chessboard.SetPlayers(playerA, playerB);
|
||||
|
||||
chessboard.InitializeStartBoard();
|
||||
|
||||
PlayingViewVisualizer playView = PlayingViewVisualizer(&chessboard, 4, 12);
|
||||
|
||||
while (chessboard.IsCheckmate() == false) {
|
||||
std::string input;
|
||||
|
||||
playView.DisplayElement();
|
||||
|
||||
std::cout << "\x1B[u";
|
||||
std::cin >> input;
|
||||
|
||||
std::string command = ExtractAfterDollar(input);
|
||||
|
||||
while (command != "3") {
|
||||
if (command != "") {
|
||||
HandleCommandOptions(command);
|
||||
break;
|
||||
} else {
|
||||
//ToDo: Valide Züge annehmen
|
||||
chessboard.MoveChessPiece(input);
|
||||
}
|
||||
// ToDo: Nicht valide Eingabe melden -> Unterscheidung was falsch?
|
||||
}
|
||||
break;
|
||||
}
|
||||
std::cout << "Game is over! - " << chessboard.GetOpponentPlayer()->GetName() << " has won the game!" << std::endl;
|
||||
}
|
||||
|
||||
void HandleSecondOption() {}
|
||||
|
||||
int main() {
|
||||
int main(int argc, char* argv[]) {
|
||||
#ifdef _WIN32
|
||||
SetConsoleOutputCP(CP_UTF8);
|
||||
#endif
|
||||
|
||||
BaseVisualizer::ClearTerminal();
|
||||
|
||||
StartMenuVisualizer startMenu = StartMenuVisualizer(3);
|
||||
int choice = -1;
|
||||
|
||||
while (startMenu.GetSelectedOption() != 0) {
|
||||
BaseVisualizer::ClearTerminal();
|
||||
startMenu.DisplayElement1();
|
||||
|
||||
if (startMenu.GetSelectedOption() == 1) {
|
||||
HandleFirstOption();
|
||||
} else if (startMenu.GetSelectedOption() == 2) {
|
||||
HandleSecondOption();
|
||||
} else if (startMenu.GetSelectedOption() == 3) {
|
||||
HandleThirdOption();
|
||||
}
|
||||
}
|
||||
|
||||
//CommandMenuVisualizer commandMenu = CommandMenuVisualizer(2);
|
||||
//commandMenu.DisplayElement();
|
||||
//HistorieVisualizer historie = HistorieVisualizer(15, 2, "Player 1", "Player 2");
|
||||
//historie.DisplayElement();
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
/*if () {
|
||||
Player* playerA = new Player("Player 1");
|
||||
Player* playerB = new Player("Player 2");
|
||||
|
||||
Chessboard chessboard = Chessboard();
|
||||
chessboard.SetPlayers(playerA, playerB);
|
||||
|
||||
chessboard.InitializeStartBoard();
|
||||
|
||||
// Jetzt kann man Moves machen. Nach jedem Move müssen die ChessPieces aktualisiert werden.
|
||||
chessboard.UpdateChessPieces();
|
||||
|
||||
//ChessboardVisualizerText* visualizer = new ChessboardVisualizerText();
|
||||
ChessboardVisualizer visualizer(&chessboard, 2);
|
||||
|
||||
|
||||
}*/
|
||||
//}
|
||||
|
||||
/*std::cout << "Spieler A: ";
|
||||
std::cout << "Spieler A: ";
|
||||
std::string namePlayerA;
|
||||
getline(std::cin, namePlayerA);
|
||||
std::cout << "Spieler B: ";
|
||||
std::string namePlayerB;
|
||||
getline(std::cin, namePlayerB);
|
||||
|
||||
Player* playerA = new Player("1");
|
||||
Player* playerB = new Player("2");*/
|
||||
Player* playerA = new Player(namePlayerA);
|
||||
Player* playerB = new Player(namePlayerB);
|
||||
|
||||
Chessboard chessboard = Chessboard();
|
||||
chessboard.SetPlayers(playerA, playerB);
|
||||
|
||||
// set black chess pieces
|
||||
chessboard.SetChessPiece(new Rook{ChessPieceColor::Black, ChessPiecePosition{'A', 8}});
|
||||
chessboard.SetChessPiece(new Knight{ChessPieceColor::Black, ChessPiecePosition{'B', 8}});
|
||||
chessboard.SetChessPiece(new Bishop{ChessPieceColor::Black, ChessPiecePosition{'C', 8}});
|
||||
chessboard.SetChessPiece(new Queen{ChessPieceColor::Black, ChessPiecePosition{'D', 8}});
|
||||
chessboard.SetChessPiece(new King{ChessPieceColor::Black, ChessPiecePosition{'E', 8}});
|
||||
chessboard.SetChessPiece(new Bishop{ChessPieceColor::Black, ChessPiecePosition{'F', 8}});
|
||||
chessboard.SetChessPiece(new Knight{ChessPieceColor::Black, ChessPiecePosition{'G', 8}});
|
||||
chessboard.SetChessPiece(new Rook{ChessPieceColor::Black, ChessPiecePosition{'H', 8}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::Black, ChessPiecePosition{'A', 7}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::Black, ChessPiecePosition{'B', 7}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::Black, ChessPiecePosition{'C', 7}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::Black, ChessPiecePosition{'D', 7}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::Black, ChessPiecePosition{'E', 7}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::Black, ChessPiecePosition{'F', 7}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::Black, ChessPiecePosition{'G', 7}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::Black, ChessPiecePosition{'H', 7}});
|
||||
|
||||
return 0;
|
||||
}
|
||||
// set white chess pieces
|
||||
chessboard.SetChessPiece(new Rook{ChessPieceColor::White, ChessPiecePosition{'A', 1}});
|
||||
chessboard.SetChessPiece(new Knight{ChessPieceColor::White, ChessPiecePosition{'B', 1}});
|
||||
chessboard.SetChessPiece(new Bishop{ChessPieceColor::White, ChessPiecePosition{'C', 1}});
|
||||
chessboard.SetChessPiece(new Queen{ChessPieceColor::White, ChessPiecePosition{'D', 1}});
|
||||
chessboard.SetChessPiece(new King{ChessPieceColor::White, ChessPiecePosition{'E', 1}});
|
||||
chessboard.SetChessPiece(new Bishop{ChessPieceColor::White, ChessPiecePosition{'F', 1}});
|
||||
chessboard.SetChessPiece(new Knight{ChessPieceColor::White, ChessPiecePosition{'G', 1}});
|
||||
chessboard.SetChessPiece(new Rook{ChessPieceColor::White, ChessPiecePosition{'H', 1}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::White, ChessPiecePosition{'A', 2}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::White, ChessPiecePosition{'B', 2}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::White, ChessPiecePosition{'C', 2}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::White, ChessPiecePosition{'D', 2}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::White, ChessPiecePosition{'E', 2}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::White, ChessPiecePosition{'F', 2}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::White, ChessPiecePosition{'G', 2}});
|
||||
chessboard.SetChessPiece(new Pawn{ChessPieceColor::White, ChessPiecePosition{'H', 2}});
|
||||
|
||||
// Jetzt kann man Moves machen. Nach jedem Move müssen die ChessPieces aktualisiert werden.
|
||||
chessboard.UpdateChessPieces();
|
||||
|
||||
//ChessboardVisualizerText* visualizer = new ChessboardVisualizerText();
|
||||
ChessboardVisualizerGraphic* visualizer = new ChessboardVisualizerGraphic();
|
||||
visualizer->Draw(&chessboard);
|
||||
|
||||
// Import chessboard from PGN file.
|
||||
// https://www.chessgames.com/perl/chessgame?gid=1799484
|
||||
// 1588906 - Checkmate
|
||||
// 1482551 - Checkmate
|
||||
// 1348060 - Checkmate
|
||||
// 1799484 - Checkmate
|
||||
// 1284086 - Stalemate
|
||||
// 1258478 - Stalemate
|
||||
// 1229276 - En Passant (black fxg3)
|
||||
// 1775611 - En Passant (white axb6)
|
||||
// 1427255 - En Passant (white bxc6+ and dxe6)
|
||||
chessboard.ImportFilePGN("./chessgames/1258478.pgn");
|
||||
visualizer->Draw(&chessboard);
|
||||
|
||||
while (chessboard.IsCheckmate() == false && chessboard.IsStalemate() == false) {
|
||||
std::string move;
|
||||
std::cout << "Move [" << ((chessboard.GetCurrentPlayer()->GetColor() == ChessPieceColor::White) ? "White" : "Black") << "] : ";
|
||||
std::cin >> move;
|
||||
chessboard.MoveChessPiece(move);
|
||||
visualizer->Draw(&chessboard);
|
||||
}
|
||||
|
||||
std::cout << "Game is over! - " << chessboard.GetOpponentPlayer()->GetName() << " has won the game!" << std::endl;
|
||||
/**
|
||||
std::vector<std::vector<ChessPiece>> chessmatrix;
|
||||
|
||||
@@ -176,3 +124,5 @@ int main() {
|
||||
|
||||
}
|
||||
*/
|
||||
return 0;
|
||||
}
|
||||
|
10
makefile
Normal file
10
makefile
Normal file
@@ -0,0 +1,10 @@
|
||||
all:
|
||||
g++ -std=c++17 -o chess main.cpp ChessPieces/*.cpp Chessboard/*.cpp Player/*.cpp
|
||||
|
||||
run:
|
||||
./chess
|
||||
|
||||
clean:
|
||||
rm -f main.exe
|
||||
rm -f chess.exe
|
||||
rm -f chess
|
Reference in New Issue
Block a user