fix for old dev branch

This commit is contained in:
AdmiralEmser
2022-08-15 21:58:49 +02:00
parent 0cb5eee033
commit 2335d6ebd3
9 changed files with 127 additions and 20 deletions
+1 -1
View File
@@ -351,4 +351,4 @@ MigrationBackup/
# own # own
out/ out/
.vscode/ .vscode/
+1 -1
View File
@@ -4,7 +4,7 @@
cmake_minimum_required (VERSION 3.8) cmake_minimum_required (VERSION 3.8)
# Add source to this project's executable. # Add source to this project's executable.
add_executable (FC-Chess "FC-Chess.cpp" "FC-Chess.h") add_executable (FC-Chess "main.cpp" "fc-chess.cpp" "graphics.cpp")
if (CMAKE_VERSION VERSION_GREATER 3.12) if (CMAKE_VERSION VERSION_GREATER 3.12)
set_property(TARGET FC-Chess PROPERTY CXX_STANDARD 20) set_property(TARGET FC-Chess PROPERTY CXX_STANDARD 20)
+40 -10
View File
@@ -1,12 +1,42 @@
// FC-Chess.cpp : Defines the entry point for the application. #include "fc-chess.h"
//
#include "FC-Chess.h" void FCC::Chess::mainLoop()
using namespace std;
int main()
{ {
cout << "Hello CMake." << endl; FCC::ChessTUI tui;
return 0;
} // preparing board: colors
for (int8_t i = 0; i < 8; i++) {
for (int j = 0; i < 2; i++) {
posColor[i][j] = (uint8_t)(PiecesColors::BLACK);
}
for (int j = 6; i < 8; i++) {
posColor[i][j] = (uint8_t)(PiecesColors::WHITE);
}
for (int j = 2; i < 7; i++) {
posColor[i][j] = (uint8_t)(PiecesColors::NONE);
}
}
// preparing board: pieces
for (int8_t i = 0; i < 8; i++) {
posPieces[1][i] = (uint8_t)(Pieces::PAWN);
posPieces[6][i] = (uint8_t)(Pieces::PAWN);
}
for (int8_t i = 0; i < 2; i++) {
posPieces[i][0] = (uint8_t)(Pieces::ROOK);
posPieces[i][7] = (uint8_t)(Pieces::ROOK);
posPieces[i][1] = (uint8_t)(Pieces::KNIGHT);
posPieces[i][6] = (uint8_t)(Pieces::KNIGHT);
posPieces[i][2] = (uint8_t)(Pieces::BISHOP);
posPieces[i][5] = (uint8_t)(Pieces::BISHOP);
posPieces[i][3] = (uint8_t)(Pieces::KING);
posPieces[i][4] = (uint8_t)(Pieces::QUEEN);
}
// main loop
while(!gameEnded) {
tui.mainLoop();
}
}
+37 -5
View File
@@ -1,8 +1,40 @@
// FC-Chess.h : Include file for standard system include files,
// or project specific include files.
#pragma once #pragma once
#include <iostream> #include <iostream>
// TODO: Reference additional headers your program requires here. #include "graphics.h"
namespace FCC
{
// vars
enum class Pieces {
NONE,
PAWN,
ROOK,
BISHOP,
KNIGHT,
QUEEN,
KING
};
enum class PiecesColors {
NONE,
BLACK = 10,
WHITE = 20
};
// classes and funcs
class Chess
{
public:
// constructor and destructor
Chess() = default;
~Chess() = default;
// vars
uint8_t posPieces[8][8], posColor[8][8], posPossible[8][8];
// funcs
void mainLoop();
private:
bool gameEnded;
};
}
+3 -1
View File
@@ -5,5 +5,7 @@ void FCC::ChessTUI::mainLoop() {
} }
void FCC::ChessTUI::testLoop() { void FCC::ChessTUI::testLoop() {
std::cout << u8"\u2654"; std::cout << "\u2654" << std::endl;
std::cout << "" << std::endl;
//std::cout << L"♔";
} }
+14
View File
@@ -0,0 +1,14 @@
#pragma once
#include <iostream>
#include "FC-Chess.h"
namespace FCC
{
class ChessTUI
{
public:
void mainLoop();
void testLoop();
};
}
+17
View File
@@ -0,0 +1,17 @@
// FC-Chess.cpp : Defines the entry point for the application.
//
#include "fc-chess.h"
//using namespace std;
int main()
{
FCC::Chess gm;
gm.mainLoop();
FCC::ChessTUI test;
test.testLoop();
return 0;
}
+12
View File
@@ -0,0 +1,12 @@
# To Do List
## What features/functions do I need?
* save (autosave)
* load
* 2x 2D arrays: possible moves and positions
* check if move is allowed (vertical, etc.)
* check if another piece or rule blocks movement
* "special" rules
* switch between players
* check if position is out of boundaries
* TUI using ASCII
*
+2 -2
View File
@@ -1,9 +1,9 @@
# FC-Chess # FC-Chess
## Welcome ## Welcome
First of all I'd like to welcome you to FC Chess. I think I don't need to explain what it is, so I rather talk about my aims during this project. I want to achieve a more or less good looking GUI and cross-platform Chess game. In order to document my progress, I'll use the [wiki](https://github.com/AdmiralEmser/FC-Chess/wiki/Introduction-%5BHome%5D). There I will also write down some thoughts about my ideas including those that didn't make it into the project. First of all I'd like to welcome you to FC Chess. I think I don't need to explain what it is, so I rather talk about my aims during this project. I want to achieve a more or less good looking GUI and cross-platform Chess game. In order to document my progress, I'll use the [wiki](https://github.com/AdmiralEmser/FC-Chess/wiki/Home). There I will also write down some thoughts about my ideas including those that didn't make it into the project.
## Contact ## Contact
You can reach me using E-Mail: admiralemser@gmail.com You can reach me using E-Mail: admiralemser@gmail.com
## Warranty and Liablilty ## Warranty and Liablilty
This project is published under MIT license. For further information, check [the license file in this repo](https://github.com/AdmiralEmser/FC-Chess/blob/main/LICENSE) out. This project is published under MIT license. For further information, check [the license file in this repo](https://github.com/AdmiralEmser/FC-Chess/blob/main/LICENSE) out.