Compare commits

..

26 Commits

Author SHA1 Message Date
vargadavidlajos
3eced42969 Merge branch 'master' into UI/Settings 2025-11-15 18:51:23 +01:00
Bence
464ef5f70b Removed faulty test and unnecessary file 2025-11-13 20:54:04 +01:00
Bence
fc2dfe78cb Fixed file structure 2025-11-13 20:37:46 +01:00
Bence
fe8293d5dc Rename Cargo.toml to ui/Cargo.toml 2025-11-13 20:31:18 +01:00
Bence
75e7636541 Delete ui/placeholder.md 2025-11-13 20:31:06 +01:00
Bence
6cfb9d81fd Fixing file structure 2025-11-13 20:30:52 +01:00
Bence
826cdf1b40 ui mappa létrehozása 2025-11-13 20:27:28 +01:00
Bence
462fe4073c Add files via upload 2025-11-13 20:23:49 +01:00
Bence
aff5a9aff2 Fixing mistake (uploaded to wrong directory) 2025-11-13 20:22:36 +01:00
Bence
573a1d25db Fixing mistake (uploaded to wrong directory) 2025-11-13 20:22:18 +01:00
Bence
126a1f00ee Fixing mistake (uploaded to wrong directory) 2025-11-13 20:22:05 +01:00
Bence
37216b776c Fixing mistake (uploaded to wrong directory) 2025-11-13 20:21:53 +01:00
Bence
bffb81e13c Fixing mistake (uploaded to wrong directory) 2025-11-13 20:21:32 +01:00
Bence
8c92f625f7 Fixed file structure/missing files 2025-11-13 20:18:59 +01:00
Bence
51287d2ad8 Add files via upload 2025-11-13 19:19:01 +01:00
Bence
7daa25719e Update Cargo.toml 2025-11-13 19:10:38 +01:00
Bence
922c7ef13a Workflow update 2025-11-13 10:03:04 +01:00
Bence
3885238e2d Workflow update 2025-11-13 10:02:07 +01:00
Bence
d3fc65db95 Workflow update 2025-11-13 10:01:43 +01:00
Bence
fd5908d2f6 Workflow update 2025-11-13 10:01:28 +01:00
Bence
372e3f52b6 Workflow update 2025-11-13 10:01:10 +01:00
Bence
143e032f62 Workflow update 2025-11-13 10:00:48 +01:00
Bence
74f214b2aa Workflow update 2025-11-13 10:00:30 +01:00
Bence
0aea34f06e Workflow update 2025-11-13 10:00:02 +01:00
Bence
aea3ccb2bc Added custom local server port option 2025-11-12 14:59:42 +01:00
Bence
7f175d6df8 Beállítás menü hozzáadása
Fullscreen/ablakos mód, felbontás opciók hozzáadva
2025-11-12 13:38:01 +01:00
17 changed files with 3 additions and 359 deletions

View File

@@ -18,7 +18,7 @@ jobs:
steps:
- name: checkout repository
uses: actions/checkout@v4
- name: Determine which tests to run
id: check
run: |
@@ -93,6 +93,3 @@ jobs:
cd "$GITHUB_WORKSPACE"
git clean -fdx
git reset --hard

View File

@@ -101,5 +101,3 @@ jobs:
release/windows.zip
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}

View File

@@ -22,68 +22,6 @@ A vágyálom rendszer alapját egy központi szerver képezné, amely kezeli a f
A platform célja a megbízható és folyamatos működés, akár nagyobb terhelés mellett is. A rendszer fejlesztése során kiemelt szempont lenne a biztonság (adatvédelem, csalás elleni védelem), a stabil hálózati kommunikáció, valamint a bővíthetőség például ranglisták, versenyek vagy mobilalkalmazás későbbi integrálásának lehetősége.
Összességében a vágyálom rendszer egy minden szempontból teljes értékű, közösségorientált sakkalkalmazás lenne, amely a mostani, helyi hálózaton működő változatból fejlődne tovább egy interneten keresztül bárhonnan elérhető platformmá.
## 3. Igényelt funkciók
### Alapok
- Két játékos közti sakkjátszma lebonyolítása.
- Teljes szabályrendszer megvalósítása (érvényes lépések, sakk/sakkmatt/patt felismerése).
- Új játék indítása.
- Játékosok nevének megadása a játszma elején.
- Felhasználóbarát grafikus felület (UI) látható tábla, figurák, órák, státuszjelzések.
- Játékoslépések vizuális kiemelése (pl. kijelölt mező, lehetséges lépések megjelenítése).
- A játék állapotának kijelzése (folyamatban, sakk, matt, döntetlen).
### LAN és hálózati funkciók
- „Szerver indítása” funkció a játékos hostként indíthat egy helyi szervert.
- „Csatlakozás” funkció másik játékos IP-cím alapján tud csatlakozni.
- Helyi hálózaton keresztüli valós idejű kommunikáció.
- LAN játék automatikus felfedezése (broadcast keresés).
- Játék mentése és visszatöltése hálózati módban.
### Online vágyálom funkciók
- Felhasználói regisztráció és bejelentkezés.
- Jelszóval védett fiókok, email- vagy OAuth-alapú hitelesítés (Google, GitHub stb.).
- Profiloldal megtekintése (név, avatar, statisztikák, értékszám).
- Automatikus matchmaking rendszer.
- Kézi játékindítás meghívó küldése barátnak.
- Játszmák mentése és visszajátszása.
- Játszmaelemzés lépések listázása, hibák kiemelése.
- Webes felület vagy mobilalkalmazás támogatása.
- Játék előzményeinek és statisztikáinak megtekintése (győzelmek, vereségek, döntetlenek).
- Automatikus szervermentés és adatbázis szinkronizáció.
### Felhasználói felület
- Letisztult, reszponzív, platformfüggetlen felület (asztali és webes verzió).
- Sötét/világos téma lehetősége.
- Egyéni figurakészlet vagy tábla kinézet választása.
- Animált figuramozgások.
- Egérrel és billentyűzettel is vezérelhető játék.
- Hangjelzések a lépésekhez és az idő lejártához.
- Lépéselőzmények (move list) megjelenítése oldalt.
- Tábla forgatásának lehetősége (pl. a fehér vagy fekete nézőpontból).
- Állapotjelzők (sakk, matt, döntetlen, várakozás az ellenfélre).
- Teljes képernyős mód.
### Technikai / fejlesztői funkciók
- Kliensszerver architektúra.
- REST API vagy WebSocket alapú kommunikáció.
- Adatbázis a felhasználói adatok és meccsek tárolására (pl. SQLite, PostgreSQL, MongoDB).
- Logolási és hibakezelési rendszer.
- Automatikus mentés és adatvisszaállítás.
- Verziókezelés (Git).
- Tesztelhető, moduláris kódszerkezet (külön modulok: logika, UI, hálózat, adat).
- Cross-platform működés (Windows, Linux, esetleg web).
### További funkciók
- Egyszemélyes mód (ember vs. gép, AI-bot).
- Több nehézségi szintű AI.
- Oktató mód (javasolt lépések, hibák magyarázata).
- Hivatalos FEN/PGN formátum export/import.
- Beépített sakkfeladványok, kihívások.
- Érintéses vezérlés mobilon.
- Többnyelvű felület (pl. magyar, angol).
## 4. Rendszer követelmények
A rendszer célja egy kétjátékos sakkalkalmazás megvalósítása, amely alapvetően hálózati kapcsolat (LAN vagy internet) segítségével biztosítja a valós idejű játékot. A rendszer kliensszerver architektúrán alapul, ahol az egyes komponensek jól elkülönülten, meghatározott feladatokat látnak el.

Binary file not shown.

View File

@@ -3,7 +3,5 @@ mod utils;
mod legality;
mod checkinfo;
mod attacks;
mod bitmove;
mod movebuffer;
pub mod board;

View File

@@ -1,77 +0,0 @@
use super::utils::*;
#[derive(Copy, Clone, PartialEq, Eq)]
pub struct BitMove {
move_type: BitMoveType,
from_square: u8,
to_square: u8,
promotion_piece: Option<u8>
}
impl BitMove {
#[inline]
pub fn quiet(from: u8, to: u8, promotion_piece: Option<u8>) -> Self {
return Self {
move_type: BitMoveType::Quiet,
from_square: from,
to_square: to,
promotion_piece: promotion_piece
};
}
#[inline]
pub fn capture(from: u8, to: u8, promotion_piece: Option<u8>) -> Self {
return Self {
move_type: BitMoveType::Capture,
from_square: from,
to_square: to,
promotion_piece: promotion_piece
};
}
#[inline]
pub fn castle(from: u8, to: u8) -> Self {
return Self {
move_type: BitMoveType::Castle,
from_square: from,
to_square: to,
promotion_piece: None
};
}
#[inline(always)]
pub fn move_type(&self) -> BitMoveType {
return self.move_type;
}
#[inline(always)]
pub fn from_square(&self) -> u8 {
return self.from_square;
}
#[inline(always)]
pub fn to_square(&self) -> u8 {
return self.to_square;
}
#[inline(always)]
pub fn promotion_piece(&self) -> Option<u8> {
return self.promotion_piece;
}
pub fn uci_notation(&self) -> String {
let mut notation = notation_from_square_number(self.from_square());
notation.push_str(&notation_from_square_number(self.to_square()));
if let Some(promotion_piece) = self.promotion_piece {
notation.push(get_character_by_piece_id(promotion_piece).to_ascii_lowercase());
}
return notation;
}
}
#[derive(Copy, Clone, PartialEq, Eq)]
pub enum BitMoveType {
Quiet,
Capture,
Castle,
EnPassant
}

View File

@@ -1,44 +0,0 @@
use super::bitmove::BitMove;
pub struct MoveBuffer {
buffer: [BitMove; 256],
count: usize
}
impl MoveBuffer {
pub fn new() -> Self {
return Self {
buffer: [BitMove::quiet(0, 0, None); 256],
count: 0
};
}
#[inline]
pub fn add(&mut self, bitmove: BitMove) {
self.buffer[self.count] = bitmove;
self.count += 1;
}
#[inline]
pub fn append(&mut self, other: &MoveBuffer) {
self.buffer[self.count..self.count + other.count()].copy_from_slice(other.contents());
self.count += other.count();
}
#[inline(always)]
pub fn clear(&mut self) {
self.count = 0;
}
#[inline(always)]
pub fn count(&self) -> usize{
return self.count;
}
#[inline(always)]
pub fn get(&self, idx: usize) -> &BitMove {
return &self.buffer[idx];
}
#[inline(always)]
pub fn contents(&self) -> &[BitMove] {
return &self.buffer[0..self.count];
}
}

View File

@@ -48,11 +48,6 @@ pub fn try_get_square_number_from_notation(notation: &str) -> Result<u8, ()> {
}
}
const PIECE_CHARACTERS: [char; 12] = ['P', 'N', 'B', 'R', 'Q', 'K', 'p', 'n', 'b', 'r', 'q', 'k'];
pub fn get_character_by_piece_id(id: u8) -> char {
return PIECE_CHARACTERS[id as usize];
}
// <----- TESTS ----->

View File

@@ -1,32 +0,0 @@
pub struct BoardSquare {
pub x: usize,
pub y: usize
}
impl BoardSquare {
pub fn new() -> Self {
return Self{
x: 0,
y: 0
};
}
pub fn from_coord(x: usize, y: usize) -> Self {
#[cfg(debug_assertions)]
{
if x > 7 {
println!("Warning: x coordinate of square is bigger than 7, it might not be on the board!");
}
if y > 7 {
println!("Warning: y coordinate of square is bigger than 7, it might not be on the board!");
}
}
return Self {
x: x,
y: y
};
}
}

View File

@@ -1,71 +0,0 @@
use crate::piecetype;
use super::boardsquare::BoardSquare;
use super::piecetype::PieceType;
use super::movetype::MoveType;
pub struct ChessMove {
pub move_type: MoveType,
pub piece_type: PieceType,
pub from_square: BoardSquare,
pub to_square: BoardSquare,
pub rook_from: BoardSquare,
pub rook_to: BoardSquare,
pub promotion_piece: Option<PieceType>
}
impl ChessMove {
pub fn quiet(
piece_type: PieceType,
from_square: BoardSquare,
to_square: BoardSquare,
promotion_piece: Option<PieceType>
) -> Self {
return Self {
move_type: MoveType::Quiet,
piece_type: piece_type,
from_square: from_square,
to_square: to_square,
rook_from: BoardSquare::new(),
rook_to: BoardSquare::new(),
promotion_piece: promotion_piece
}
}
pub fn capture(
piece_type: PieceType,
from_square: BoardSquare,
to_square: BoardSquare,
promotion_piece: Option<PieceType>
) -> Self {
return Self {
move_type: MoveType::Capture,
piece_type: piece_type,
from_square: from_square,
to_square: to_square,
rook_from: BoardSquare::new(),
rook_to: BoardSquare::new(),
promotion_piece: promotion_piece
}
}
pub fn castle(
piece_type: PieceType,
from_square: BoardSquare,
to_square: BoardSquare,
rook_from: BoardSquare,
rook_to: BoardSquare
) -> Self {
return Self {
move_type: MoveType::Quiet,
piece_type: piece_type,
from_square: from_square,
to_square: to_square,
rook_from: rook_from,
rook_to: rook_to,
promotion_piece: None
}
}
}

View File

@@ -1,6 +0,0 @@
pub enum GameEnd {
WhiteWon(String),
BlackWon(String),
Draw(String)
}

View File

@@ -1,24 +0,0 @@
mod bitboard;
pub mod chessmove;
pub mod piecetype;
pub mod boardsquare;
pub mod movetype;
pub mod gameend;
use chessmove::ChessMove;
use gameend::GameEnd;
pub fn get_available_moves(fen: &str) -> Vec<ChessMove> {
println!("get_available_moves answered");
return vec![];
}
pub fn is_game_over(fen: &str) -> Option<GameEnd> {
println!("is_game_over answered");
return None;
}
pub fn get_board_after_move(fen: &str, chess_move: &ChessMove) -> String {
println!("get_board_after_move answered");
return String::from("rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1");
}

View File

@@ -1,7 +0,0 @@
pub enum MoveType {
Quiet,
Capture,
Castle,
EnPassant
}

View File

@@ -1,15 +0,0 @@
pub enum PieceType {
WhitePawn,
WhiteKnight,
WhiteBishop,
WhiteRook,
WhiteQueen,
WhiteKing,
BlackPawn,
BlackKnight,
BlackBishop,
BlackRook,
BlackQueen,
BlackKing
}

View File

@@ -1,4 +0,0 @@
[target.x86_64-unknown-linux-gnu]
linker = "x86_64-linux-gnu-gcc"
[target.x86_64-pc-windows-gnu]
linker = "x86_64-w64-mingw32-gcc"

1
ui/.gitignore vendored
View File

@@ -1 +0,0 @@
/target

View File

@@ -3,7 +3,7 @@ use eframe::egui;
fn main() -> eframe::Result<()> {
let options = eframe::NativeOptions{
viewport: egui::ViewportBuilder::default()
.with_fullscreen(true)
.with_fullscreen(false)
.with_min_inner_size(egui::vec2(800.0, 600.0)) // Minimum width, height
.with_inner_size(egui::vec2(7680.0, 4320.0)), // Initial size
..Default::default()
@@ -101,7 +101,6 @@ impl Default for ChessApp {
(1920, 1080),
(2560, 1440),
(3840, 2160),
(7680, 4320),
],
selected_resolution: 2, // Default to 1920x1080
state: AppState::MainMenu,
@@ -428,4 +427,4 @@ mod tests {
let app = ChessApp::default();
assert_eq!(app.server_port, "8080");
}
}
}