fix for old dev branch
This commit is contained in:
@@ -4,7 +4,7 @@
|
||||
cmake_minimum_required (VERSION 3.8)
|
||||
|
||||
# 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)
|
||||
set_property(TARGET FC-Chess PROPERTY CXX_STANDARD 20)
|
||||
|
||||
@@ -1,12 +1,42 @@
|
||||
// FC-Chess.cpp : Defines the entry point for the application.
|
||||
//
|
||||
#include "fc-chess.h"
|
||||
|
||||
#include "FC-Chess.h"
|
||||
|
||||
using namespace std;
|
||||
|
||||
int main()
|
||||
void FCC::Chess::mainLoop()
|
||||
{
|
||||
cout << "Hello CMake." << endl;
|
||||
return 0;
|
||||
FCC::ChessTUI tui;
|
||||
|
||||
// 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();
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
@@ -1,8 +1,40 @@
|
||||
// FC-Chess.h : Include file for standard system include files,
|
||||
// or project specific include files.
|
||||
|
||||
#pragma once
|
||||
|
||||
#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;
|
||||
};
|
||||
}
|
||||
|
||||
@@ -5,5 +5,7 @@ void FCC::ChessTUI::mainLoop() {
|
||||
}
|
||||
|
||||
void FCC::ChessTUI::testLoop() {
|
||||
std::cout << u8"\u2654";
|
||||
std::cout << "\u2654" << std::endl;
|
||||
std::cout << "♔" << std::endl;
|
||||
//std::cout << L"♔";
|
||||
}
|
||||
@@ -0,0 +1,14 @@
|
||||
#pragma once
|
||||
#include <iostream>
|
||||
|
||||
#include "FC-Chess.h"
|
||||
|
||||
namespace FCC
|
||||
{
|
||||
class ChessTUI
|
||||
{
|
||||
public:
|
||||
void mainLoop();
|
||||
void testLoop();
|
||||
};
|
||||
}
|
||||
@@ -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;
|
||||
}
|
||||
@@ -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
|
||||
*
|
||||
@@ -1,6 +1,6 @@
|
||||
# FC-Chess
|
||||
## 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
|
||||
You can reach me using E-Mail: admiralemser@gmail.com
|
||||
|
||||
Reference in New Issue
Block a user