Compare commits
12
Commits
faa65c2014
...
main
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
80626485ca | ||
|
|
5663b2285a | ||
|
|
d025c31789 | ||
|
|
040f5e1b87 | ||
|
|
f14920f03a | ||
|
|
a117de01fc | ||
|
|
a5ea95e5bd | ||
|
|
e9f763877c | ||
|
|
a3b8a267e8 | ||
|
|
52e9baabae | ||
|
|
0f8edaa6f8 | ||
|
|
1b1af0f377 |
No files matched your search
@@ -1,3 +1,77 @@
|
|||||||
# gui-chess
|
# Sakk alkalmazás (gui-chess)
|
||||||
|
Programozás alapjai 3 – Nagy házi feladat specifikáció
|
||||||
|
|
||||||
A programozás alapjai 3 nagyházi feladat; A programozás alapjai 2 nagyházi feladata átemelve JAVA környezetbe és GUI-val megvalósítva.
|
## 1. Célkitűzés
|
||||||
|
A projekt célja egy teljes körű sakkalkalmazás implementálása Java nyelven. A feladat alapját a „Programozás alapjai 2” tárgyban készült C++ sakkmotor adja, melynek logikáját átemelve, az objektumorientált elveket és a Java nyelvi sajátosságait kihasználva egy grafikus felhasználói felülettel (GUI) és parancssori réteggel is rendelkező szoftver készül.
|
||||||
|
|
||||||
|
## 2. Funkcionális követelmények
|
||||||
|
### 2.1 Játékszabályok és játékmódok
|
||||||
|
- Szabályrendszer: A standard sakk szabályainak teljes körű ellenőrzése és betartatása (szabályos lépések, sakk, matt, patt helyzetek detektálása, sáncolás, en passant és gyalogátváltozás).
|
||||||
|
- Játékos módok: Lokális kétfős játék (Hotseat mód), ahol a felek felváltva lépnek ugyanazon a felületen.
|
||||||
|
- Lépésvisszavonás és elemzés: Lehetőség a lépések visszavonására (Undo) és előreléptetésére.
|
||||||
|
|
||||||
|
### 2.2 Felhasználói felületek
|
||||||
|
- Grafikus felület (GUI):
|
||||||
|
- Interaktív sakktábla (kattintásos vagy drag-and-drop bábulépéssel).
|
||||||
|
- Vizuális visszajelzés az érvényes lépésekről és az aktuális sakkhelyzetről.
|
||||||
|
- Lépéslista (Move history) megjelenítése algebrai jelöléssel.
|
||||||
|
- Konzolos felület (CLI):
|
||||||
|
- A sakktábla kirajzolása terminálban szöveges karakterekkel.
|
||||||
|
- Lépések fogadása standard szöveges formátumban (pl. `e2e4`).
|
||||||
|
|
||||||
|
### 2.3. Adatkezelés és perzisztencia
|
||||||
|
- PGN (Portable Game Notation) támogatás:
|
||||||
|
- Külső forrásból származó (pl. [Chess.com](https://chess.com), [Lichess](https://lichess.org)) standard `.pgn` formátumú játszmák beolvasása, elemzése és visszajátszása.
|
||||||
|
- Az aktuálisan játszott parti kimentése szabványos PGN fájlba a metaadatokkal (dátum, felek nevei, eredmény) együtt.
|
||||||
|
- Állásmentés (FEN): Az aktuális táblaállás gyors betöltése és exportálása FEN (Forsyth–Edwards Notation) karakterlánccal.
|
||||||
|
|
||||||
|
## 3. Nem funkcionális követelmények és architektúra
|
||||||
|
- Választott architektúra (MVC):
|
||||||
|
- Model: A sakktábla állapota, szabályellenőrzés, bábuk reprezentációja és lépésgenerálás. A motor teljesen független a megjelenítéstől.
|
||||||
|
|
||||||
|
- View: `Java Swing` komponensek és a CLI kirajzoló modul.
|
||||||
|
|
||||||
|
- Controller: Eseménykezelők, amelyek a felhasználói beviteleket (GUI kattintás, CLI parancs) továbbítják a motornak.
|
||||||
|
|
||||||
|
- Perzisztencia / Fájlkezelés: Szabványos Java I/O, kivételkezeléssel.
|
||||||
|
|
||||||
|
- Tesztelhetőség: A játékmotor üzleti logikáját (speciális lépések, matt detektálás, PGN parser) lefedő JUnit egységtesztek.
|
||||||
|
|
||||||
|
## 4. Terv
|
||||||
|
### 4.1 Szereplők
|
||||||
|
- Játékos: Az a személy aki játszmát kezdeményez, lépéseket tesz, kezeli a játék felületét.
|
||||||
|
- Fájlrendszer: Másodlagos szereplő. PGN/FEN állományokat kezel.
|
||||||
|
|
||||||
|
### 4.2 Használati esetek (Use Cases):
|
||||||
|
- Új játszma indítása
|
||||||
|
- Lépés megtétele a táblán
|
||||||
|
- Lehetséges lépések megtekintése
|
||||||
|
- Lépés visszavonása
|
||||||
|
- Játszma mentése (PGN formátumban)
|
||||||
|
- Játszma betöltése és visszajátszása (PGN formátumból)
|
||||||
|
- Táblaállás betöltése/mentése (FEN formátumból/ban)
|
||||||
|
|
||||||
|
### 4.3 GUI váza:
|
||||||
|
```text
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
| Menüsor: [Fájl (Új, Betöltés, Mentés)] [Nézet] [Segítség] |
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
| +---------------------------+ +------------------------+ |
|
||||||
|
| | | | Státusz / Soron lévő: | |
|
||||||
|
| | | | Fehér | |
|
||||||
|
| | | | Sakk jelzés: Nincs | |
|
||||||
|
| | | +------------------------+ |
|
||||||
|
| | | | Lépéstörténet: | |
|
||||||
|
| | SAKKTÁBLA | | 1. e4 e5 | |
|
||||||
|
| | (8 x 8) | | 2. Nf3 Nc6 | |
|
||||||
|
| | | | 3. Bb5 ... | |
|
||||||
|
| | | +------------------------+ |
|
||||||
|
| | | | Vezérlők: | |
|
||||||
|
| | | | [< Előző] [Következő >]| |
|
||||||
|
| | | | [Undo] | |
|
||||||
|
| +---------------------------+ +------------------------+ |
|
||||||
|
+-------------------------------------------------------------+
|
||||||
|
```
|
||||||
|
|
||||||
|
### 4.4 UML
|
||||||
|

|
||||||
@@ -0,0 +1,286 @@
|
|||||||
|
<mxfile host="app.diagrams.net">
|
||||||
|
<diagram id="C5RBs43oDa-KdzZeNtuy" name="Oldal-1">
|
||||||
|
<mxGraphModel dx="1857" dy="1780" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
|
||||||
|
<root>
|
||||||
|
<mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
|
||||||
|
<mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-38" parent="WIyWlLk6GJQsqaUBKTNV-1" style="shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;fillColor=default;" value="" vertex="1">
|
||||||
|
<mxGeometry height="880" width="1750" x="-500" y="-370" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-0" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Abstract»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>Piece</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">- pieceColor: Color</p><p style="margin:0px;margin-left:4px;">- movedBefore: boolean</p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">+ Piece(Color)</p><p style="margin:0px;margin-left:4px;">+ getMoveDomain() : Direction[]&nbsp;</p><p style="margin:0px;margin-left:4px;">+ getColor() : Color</p><p style="margin:0px;margin-left:4px;">+ getSymbol() : Char</p><p style="margin:0px;margin-left:4px;">+ getType() : Type</p><p style="margin:0px;margin-left:4px;">+ hasMoved() : bool</p>" vertex="1">
|
||||||
|
<mxGeometry height="170" width="260" x="250" y="-30" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-3" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Final»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>Pawn</b></p><hr size="1" style="border-style:solid;">&nbsp;+ getMoveDomain() : Direction[]" vertex="1">
|
||||||
|
<mxGeometry height="70" width="176" x="-486" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-4" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Final»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>King</b></p><hr size="1" style="border-style:solid;">&nbsp;+ getMoveDomain() : Direction[]" vertex="1">
|
||||||
|
<mxGeometry height="70" width="176" x="-176" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-5" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Final»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>Queen</b></p><hr size="1" style="border-style:solid;">&nbsp;+ getMoveDomain() : Direction[]" vertex="1">
|
||||||
|
<mxGeometry height="70" width="176" x="126" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-6" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Final»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>Rook</b></p><hr size="1" style="border-style:solid;">&nbsp;+ getMoveDomain() : Direction[]" vertex="1">
|
||||||
|
<mxGeometry height="70" width="176" x="429" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-7" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Final»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>Bishop</b></p><hr size="1" style="border-style:solid;">&nbsp;+ getMoveDomain() : Direction[]" vertex="1">
|
||||||
|
<mxGeometry height="70" width="176" x="734" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-12" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-3" style="endArrow=block;endFill=0;endSize=12;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=0.75;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;curved=1;curveGeometry=1;" target="_r-HP5b758gAeptMtzsk-0" value="">
|
||||||
|
<mxGeometry relative="1" width="160" as="geometry">
|
||||||
|
<mxPoint x="340" y="280" as="sourcePoint" />
|
||||||
|
<mxPoint x="500" y="280" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-13" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-4" style="endArrow=block;endFill=0;endSize=12;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0;entryY=1;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;curved=1;curveGeometry=1;" target="_r-HP5b758gAeptMtzsk-0" value="">
|
||||||
|
<mxGeometry relative="1" width="160" as="geometry">
|
||||||
|
<mxPoint x="10" y="470" as="sourcePoint" />
|
||||||
|
<mxPoint x="525" y="290" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-14" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-5" style="endArrow=block;endFill=0;endSize=12;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.25;entryY=1;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;curved=1;curveGeometry=1;" target="_r-HP5b758gAeptMtzsk-0" value="">
|
||||||
|
<mxGeometry relative="1" width="160" x="-0.1252" as="geometry">
|
||||||
|
<mxPoint x="390" y="450" as="sourcePoint" />
|
||||||
|
<mxPoint x="655" y="310" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-15" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-6" style="endArrow=block;endFill=0;endSize=12;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;curved=1;curveGeometry=1;entryX=0.75;entryY=1;entryDx=0;entryDy=0;" target="_r-HP5b758gAeptMtzsk-0" value="">
|
||||||
|
<mxGeometry relative="1" width="160" as="geometry">
|
||||||
|
<mxPoint x="480" y="460" as="sourcePoint" />
|
||||||
|
<mxPoint x="410" y="131.12" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-16" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-7" style="endArrow=block;endFill=0;endSize=12;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=1;entryY=1;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;curved=1;curveGeometry=1;" target="_r-HP5b758gAeptMtzsk-0" value="">
|
||||||
|
<mxGeometry relative="1" width="160" as="geometry">
|
||||||
|
<mxPoint x="720" y="420" as="sourcePoint" />
|
||||||
|
<mxPoint x="985" y="280" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-18" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-19" style="endArrow=block;endFill=0;endSize=12;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=1;entryY=0.75;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;curved=1;curveGeometry=1;" target="_r-HP5b758gAeptMtzsk-0" value="">
|
||||||
|
<mxGeometry relative="1" width="160" as="geometry">
|
||||||
|
<mxPoint x="1015" y="390" as="sourcePoint" />
|
||||||
|
<mxPoint x="1085" y="230" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-19" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Final»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>Knight</b></p><hr size="1" style="border-style:solid;">&nbsp;+ getMoveDomain() : Direction[]" vertex="1">
|
||||||
|
<mxGeometry height="70" width="176" x="1054" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-20" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin: 4px 0px 0px; text-align: center; text-decoration: underline;">«Enum»</p><p style="margin: 4px 0px 0px; text-align: center; text-decoration: underline;">Type</p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:8px;">PAWN<br>KING<br>QUEEN</p><p style="margin:0px;margin-left:8px;">ROOK</p><p style="margin:0px;margin-left:8px;">BISHOP</p><p style="margin:0px;margin-left:8px;">KNIGHT</p>" vertex="1">
|
||||||
|
<mxGeometry height="140" width="60" x="90" y="-115" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-22" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin: 4px 0px 0px; text-align: center; text-decoration: underline;">«Enum»</p><p style="margin: 4px 0px 0px; text-align: center; text-decoration: underline;">Color</p><hr size="1" style="border-style:solid;"><div>&nbsp;WHITE</div><div>&nbsp;BLACK</div>" vertex="1">
|
||||||
|
<mxGeometry height="80" width="50" x="355" y="-270" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-26" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-20" style="endArrow=open;endSize=12;dashed=1;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=-0.001;entryY=0.595;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;entryPerimeter=0;libavoidRouting=1;" target="_r-HP5b758gAeptMtzsk-0" value="Use">
|
||||||
|
<mxGeometry relative="1" width="160" x="0.0023" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="200" y="-45" />
|
||||||
|
<mxPoint x="200" y="71" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="140" y="170" as="sourcePoint" />
|
||||||
|
<mxPoint x="300" y="170" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-27" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-22" style="endArrow=open;endFill=1;endSize=12;html=1;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;startArrow=none;startFill=0;startSize=12;exitX=0.5;exitY=1;exitDx=0;exitDy=0;libavoidRouting=1;" target="_r-HP5b758gAeptMtzsk-0" value="">
|
||||||
|
<mxGeometry relative="1" width="160" x="-0.063" as="geometry">
|
||||||
|
<mxPoint x="70" y="-160" as="sourcePoint" />
|
||||||
|
<mxPoint x="300" y="170" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-29" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Final»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>ChessBoard</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">- board: Piece[64]</p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">+ ChessBoard()</p><p style="margin:0px;margin-left:4px;">+ getPiece(idx : int) : Piece</p><p style="margin:0px;margin-left:4px;">+ getPiece(x : int, y : int) : Piece</p><p style="margin:0px;margin-left:4px;">+ movePiece(from: int, to: int) : Optional&lt;Move&gt;</p><p style="margin:0px;margin-left:4px;">+ isCheck(color : Color) : bool</p><p style="margin:0px;margin-left:4px;">+ isCheckMate(color : Color) : bool</p>" vertex="1">
|
||||||
|
<mxGeometry height="170" width="260" x="640" y="-340" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-30" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-29" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;entryX=0.75;entryY=0;entryDx=0;entryDy=0;exitX=0.5;exitY=1;exitDx=0;exitDy=0;libavoidRouting=1;" target="_r-HP5b758gAeptMtzsk-0" value="">
|
||||||
|
<mxGeometry relative="1" x="-0.542" y="3" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="770" y="-95" />
|
||||||
|
<mxPoint x="445" y="-95" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="700" y="-120" as="sourcePoint" />
|
||||||
|
<mxPoint x="740" y="-220" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-31" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;" value="1" vertex="1">
|
||||||
|
<mxGeometry height="30" width="60" x="750" y="-160" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-32" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;" value="0..64" vertex="1">
|
||||||
|
<mxGeometry height="30" width="60" x="440" y="-60" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-37" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-22" style="endArrow=open;endSize=12;dashed=1;html=1;rounded=0;exitX=0.977;exitY=0.176;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;entryX=0;entryY=0.5;entryDx=0;entryDy=0;libavoidRouting=1;exitPerimeter=0;" target="_r-HP5b758gAeptMtzsk-29" value="Use">
|
||||||
|
<mxGeometry relative="1" width="160" x="-0.0132" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="523" y="-256" />
|
||||||
|
<mxPoint x="523" y="-255" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="300" y="-300" as="sourcePoint" />
|
||||||
|
<mxPoint x="550" y="-115" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-39" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;strokeWidth=1;fontSize=24;" value="<div>Model</div>" vertex="1">
|
||||||
|
<mxGeometry height="55" width="113" x="-500" y="-360" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-40" parent="WIyWlLk6GJQsqaUBKTNV-1" style="shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;fillColor=default;" value="" vertex="1">
|
||||||
|
<mxGeometry height="490" width="450" x="1350" y="-280" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-41" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;fontSize=24;" value="Controller" vertex="1">
|
||||||
|
<mxGeometry height="30" width="60" x="1380" y="-260" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-46" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-47" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;entryX=1.003;entryY=0.395;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=open;endFill=0;fontSize=11;startSize=6;endSize=12;exitX=0;exitY=0.25;exitDx=0;exitDy=0;" target="_r-HP5b758gAeptMtzsk-29">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1420" y="-191" />
|
||||||
|
<mxPoint x="1310" y="-191" />
|
||||||
|
<mxPoint x="1310" y="-272.8" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="1790" y="-210" as="sourcePoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-1" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-47" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;libavoidRouting=1;startArrow=diamondThin;startFill=1;endArrow=open;endFill=0;startSize=14;endSize=12;" target="oEUtffCDIGD-I46B6jyE-0">
|
||||||
|
<mxGeometry relative="1" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1290" y="-97" />
|
||||||
|
<mxPoint x="1290" y="-130" />
|
||||||
|
</Array>
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-47" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«<i>Final</i>»<br><b>ChessGame</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">- board: ChessBoard<br>- state: GameState</p><p style="margin:0px;margin-left:4px;">- view: GameView</p><p style="margin:0px;margin-left:4px;">- history: List&lt;Move&gt;</p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">+ start(): void<br>+ processTurn(from: int, to: int) : void</p><p style="margin:0px;margin-left:4px;">+ getGameState() : GameState</p><p style="margin:0px;margin-left:4px;"><br></p><p style="margin:0px;margin-left:4px;">- endTurn() : void</p><p style="margin:0px;margin-left:4px;">- switchPlayer() : void</p><p style="margin:0px;margin-left:4px;">- checkGameEnd() : void</p>" vertex="1">
|
||||||
|
<mxGeometry height="236" width="220" x="1370" y="-215" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-49" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«<i>Final</i>»</p><p style="margin:0px;margin-top:4px;text-align:center;">«<i>Record</i>»<br><b>GameState</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">activePlayer: Color<br>status: GameStatus</p><p style="margin:0px;margin-left:4px;"><br></p>" vertex="1">
|
||||||
|
<mxGeometry height="100" width="190" x="1480" y="100" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-50" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-47" style="endArrow=open;html=1;endSize=12;startArrow=diamondThin;startSize=14;startFill=1;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;libavoidRouting=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;" target="_r-HP5b758gAeptMtzsk-49" value="">
|
||||||
|
<mxGeometry relative="1" x="-0.7356" y="3" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1480" y="73" />
|
||||||
|
<mxPoint x="1575" y="73" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="1587" y="-67" as="sourcePoint" />
|
||||||
|
<mxPoint x="1360" y="70" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-51" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;" value="1" vertex="1">
|
||||||
|
<mxGeometry height="15" width="30" x="1480" y="30" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-52" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;" value="1" vertex="1">
|
||||||
|
<mxGeometry height="15" width="20" x="1580" y="80" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-54" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin: 4px 0px 0px; text-align: center; text-decoration: underline;">«Enum»</p><p style="margin: 4px 0px 0px; text-align: center; text-decoration: underline;">GameStatus</p><hr size="1" style="border-style:solid;"><div>&nbsp;ACTIVE</div><div>&nbsp;WHITE_WINS</div><div>&nbsp;BLACK_WINS</div><div>&nbsp;STALEMATE</div>" vertex="1">
|
||||||
|
<mxGeometry height="110" width="90" x="1680" y="-130" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-56" parent="WIyWlLk6GJQsqaUBKTNV-1" style="shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;fillColor=default;" value="" vertex="1">
|
||||||
|
<mxGeometry height="570" width="620" x="1350" y="360" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-57" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;fontSize=24;" value="View" vertex="1">
|
||||||
|
<mxGeometry height="30" width="60" x="1370" y="390" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-59" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«<i>Interface</i>»<br><b>GameView</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">+ displayBoard(board: ChessBoard): void<br>+ showMessage(msg: String) : void</p><p style="margin:0px;margin-left:4px;">+ showError(errorMsg: String) : void</p><p style="margin:0px;margin-left:4px;">+ showGameOver(status: GameStatus) : void</p><p style="margin:0px;margin-left:4px;">+ setController(controller: ChessGame) : void</p>" vertex="1">
|
||||||
|
<mxGeometry height="140" width="250" x="1540" y="475" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-60" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-49" style="endArrow=open;html=1;endSize=12;startArrow=none;startSize=14;startFill=0;edgeStyle=orthogonalEdgeStyle;align=left;verticalAlign=bottom;rounded=0;entryX=1;entryY=0.5;entryDx=0;entryDy=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;endFill=0;libavoidRouting=1;" target="_r-HP5b758gAeptMtzsk-54" value="">
|
||||||
|
<mxGeometry relative="1" x="-0.1581" y="3" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1786" y="150" />
|
||||||
|
<mxPoint x="1786" y="-75" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="1480" y="150" as="sourcePoint" />
|
||||||
|
<mxPoint x="1440" y="336" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-63" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-47" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;endArrow=open;endFill=0;fontSize=11;startSize=6;endSize=12;exitX=0.25;exitY=1;exitDx=0;exitDy=0;entryX=0.5;entryY=0;entryDx=0;entryDy=0;libavoidRouting=1;" target="_r-HP5b758gAeptMtzsk-59">
|
||||||
|
<mxGeometry relative="1" x="-0.0639" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1425" y="295" />
|
||||||
|
<mxPoint x="1665" y="295" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="2442" y="311" as="sourcePoint" />
|
||||||
|
<mxPoint x="1620" y="650" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-67" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;"><b>ConsoleView</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">- controller: ChessGame</p><p style="margin:0px;margin-left:4px;">- scanner: Scanner</p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">+ displayBoard(board: ChessBoard): void<br>+ showMessage(msg: String) : void</p><p style="margin:0px;margin-left:4px;">+ showError(errorMsg: String) : void</p><p style="margin:0px;margin-left:4px;">+ showGameOver(status: GameStatus) : void</p><p style="margin:0px;margin-left:4px;">+ setController(controller: ChessGame) : void</p><p style="margin:0px;margin-left:4px;"></p>" vertex="1">
|
||||||
|
<mxGeometry height="150" width="250" x="1390" y="735" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-68" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;"><b>SwingView</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">- controller: ChessGame</p><p style="margin:0px;margin-left:4px;">- frame: JFrame</p><p style="margin:0px;margin-left:4px;">- boardPanel: JPanel</p><p style="margin:0px;margin-left:4px;">- squares: JButton[64]</p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">+ displayBoard(board: ChessBoard): void<br>+ showMessage(msg: String) : void</p><p style="margin:0px;margin-left:4px;">+ showError(errorMsg: String) : void</p><p style="margin:0px;margin-left:4px;">+ showGameOver(status: GameStatus) : void</p><p style="margin:0px;margin-left:4px;">+ setController(controller: ChessGame) : void</p><p style="margin:0px;margin-left:4px;"></p>" vertex="1">
|
||||||
|
<mxGeometry height="180" width="250" x="1690" y="735" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-69" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-67" style="html=1;verticalAlign=bottom;labelBackgroundColor=none;endArrow=open;endFill=0;dashed=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.25;entryY=1;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;" target="_r-HP5b758gAeptMtzsk-59" value="«implements»">
|
||||||
|
<mxGeometry relative="1" width="160" x="-0.0025" as="geometry">
|
||||||
|
<mxPoint x="1520" y="655" as="sourcePoint" />
|
||||||
|
<mxPoint x="1680" y="655" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="_r-HP5b758gAeptMtzsk-70" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-68" style="html=1;verticalAlign=bottom;labelBackgroundColor=none;endArrow=open;endFill=0;dashed=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.665;entryY=0.981;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;entryPerimeter=0;" target="_r-HP5b758gAeptMtzsk-59" value="«implements»">
|
||||||
|
<mxGeometry relative="1" width="160" x="0.0723" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1790" y="735" />
|
||||||
|
<mxPoint x="1790" y="675" />
|
||||||
|
<mxPoint x="1706.3" y="675" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="1740" y="785" as="sourcePoint" />
|
||||||
|
<mxPoint x="1823" y="665" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-0" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;">«Final»</p><p style="margin:0px;margin-top:4px;text-align:center;">«Record»</p><p style="margin:0px;margin-top:4px;text-align:center;"><b>Move</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">&nbsp;start: int<br>&nbsp;end: int</p><p style="margin:0px;margin-left:4px;">&nbsp;isCapture: bool</p><p style="margin:0px;margin-left:4px;">&nbsp;isCastle: bool</p><p style="margin:0px;margin-left:4px;">&nbsp;isEnPassant: bool</p><p style="margin:0px;margin-left:4px;">&nbsp;isCheck: bool</p><div>&nbsp; movedPiece: Type</div><div>&nbsp; promotedTo: Type</div><div>&nbsp; capturedPieceColor: Color</div><div>&nbsp; capturedPieceType: Type</div>" vertex="1">
|
||||||
|
<mxGeometry height="200" width="190" x="1020" y="-230" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-2" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;" value="1" vertex="1">
|
||||||
|
<mxGeometry height="30" width="60" x="1370" y="-130" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-3" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;" value="*" vertex="1">
|
||||||
|
<mxGeometry height="30" width="60" x="1120" y="-70" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-4" parent="WIyWlLk6GJQsqaUBKTNV-1" style="shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;fillColor=default;" value="" vertex="1">
|
||||||
|
<mxGeometry height="220" width="580" x="1350" y="-561" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-5" parent="WIyWlLk6GJQsqaUBKTNV-1" style="text;html=1;whiteSpace=wrap;strokeColor=none;fillColor=none;align=center;verticalAlign=middle;rounded=0;" value="Service" vertex="1">
|
||||||
|
<mxGeometry height="30" width="60" x="1360" y="-541" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-6" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;"><b>PGNWriter</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">+ write(List&lt;Move&gt;): void</p>" vertex="1">
|
||||||
|
<mxGeometry height="60" width="160" x="1420" y="-431" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-7" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin:0px;margin-top:4px;text-align:center;"><b>PGNReader</b></p><hr size="1" style="border-style:solid;"><p style="margin:0px;margin-left:4px;">+ read(): List&lt;Move&gt;</p>" vertex="1">
|
||||||
|
<mxGeometry height="60" width="160" x="1694" y="-431" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-8" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="oEUtffCDIGD-I46B6jyE-4" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;innerLoopWaypoints=1;exitX=0.5;exitY=1;exitDx=0;exitDy=0;exitPerimeter=0;" target="oEUtffCDIGD-I46B6jyE-4">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-11" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-47" style="endArrow=open;endSize=12;dashed=1;html=1;rounded=0;exitX=0.5;exitY=0;exitDx=0;exitDy=0;entryX=0.5;entryY=1;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;libavoidRouting=1;" target="oEUtffCDIGD-I46B6jyE-6" value="Use">
|
||||||
|
<mxGeometry relative="1" width="160" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1480" y="-293" />
|
||||||
|
<mxPoint x="1500" y="-293" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="1350" y="-320" as="sourcePoint" />
|
||||||
|
<mxPoint x="1510" y="-320" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-12" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="_r-HP5b758gAeptMtzsk-47" style="endArrow=open;endSize=12;dashed=1;html=1;rounded=0;exitX=0.75;exitY=0;exitDx=0;exitDy=0;edgeStyle=orthogonalEdgeStyle;libavoidRouting=1;" target="oEUtffCDIGD-I46B6jyE-7" value="Use">
|
||||||
|
<mxGeometry relative="1" width="160" x="0.3357" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="1535" y="-293" />
|
||||||
|
<mxPoint x="1774" y="-293" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="1750" y="-135" as="sourcePoint" />
|
||||||
|
<mxPoint x="1720" y="-290" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-13" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="oEUtffCDIGD-I46B6jyE-0" style="edgeStyle=orthogonalEdgeStyle;rounded=0;orthogonalLoop=1;jettySize=auto;html=1;exitX=0;exitY=0.5;exitDx=0;exitDy=0;entryX=0.996;entryY=0.707;entryDx=0;entryDy=0;entryPerimeter=0;endArrow=open;endFill=0;startSize=5;endSize=12;" target="_r-HP5b758gAeptMtzsk-29">
|
||||||
|
<mxGeometry relative="1" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-15" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="<p style="margin: 4px 0px 0px; text-align: center; text-decoration: underline;">«Enum»</p><p style="margin: 4px 0px 0px; text-align: center; text-decoration: underline;">Direction</p><hr size="1" style="border-style:solid;"><div>&nbsp;NORTH</div><div>&nbsp;SOUTH</div><div>&nbsp;EAST</div><div>&nbsp;WEST</div><div>&nbsp;NORTH_EAST</div><div>&nbsp;NORTH_WEST</div><div>&nbsp;SOUTH_EAST</div><div>&nbsp;SOUTH_WEST</div><div>&nbsp;KNIGHT_NNE</div><div>&nbsp;KNIGHT_ENE</div><div>&nbsp;KNIGHT_ESE</div><div>&nbsp;KNIGHT_SSE</div><div>&nbsp;KNIGHT_SSW</div><div>&nbsp;KNIGHT_WSW</div><div>&nbsp;KNIGHT_WNW</div><div>&nbsp;KNIGHT_NNW</div><div>&nbsp;PAWN_DOUBLE_NORTH</div><div>&nbsp;PAWN_DOUBLE_SOUTH</div><div><hr size="1" style="border-style:solid;"><div>&nbsp;- dx</div><div>&nbsp;- dy</div><div><hr size="1" style="border-style:solid;"><div>&nbsp;+ getDx() : int</div><div>&nbsp;+ getDy() : int</div><div>&nbsp;+ getFlatOffset() : int</div><br></div><br></div>" vertex="1">
|
||||||
|
<mxGeometry height="425" width="150" x="-290" y="-305" as="geometry" />
|
||||||
|
</mxCell>
|
||||||
|
<mxCell id="oEUtffCDIGD-I46B6jyE-16" edge="1" parent="WIyWlLk6GJQsqaUBKTNV-1" source="oEUtffCDIGD-I46B6jyE-15" style="endArrow=open;endSize=12;dashed=1;html=1;rounded=0;exitX=1;exitY=0.5;exitDx=0;exitDy=0;entryX=0.25;entryY=0;entryDx=0;entryDy=0;edgeStyle=orthogonalEdgeStyle;libavoidRouting=1;" target="_r-HP5b758gAeptMtzsk-0" value="Use">
|
||||||
|
<mxGeometry relative="1" width="160" x="0.2014" as="geometry">
|
||||||
|
<Array as="points">
|
||||||
|
<mxPoint x="-25" y="-92" />
|
||||||
|
<mxPoint x="-25" y="-131" />
|
||||||
|
<mxPoint x="315" y="-131" />
|
||||||
|
</Array>
|
||||||
|
<mxPoint x="-100" y="-130" as="sourcePoint" />
|
||||||
|
<mxPoint x="310" y="-79" as="targetPoint" />
|
||||||
|
</mxGeometry>
|
||||||
|
</mxCell>
|
||||||
|
</root>
|
||||||
|
</mxGraphModel>
|
||||||
|
</diagram>
|
||||||
|
</mxfile>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<!-- Do not edit this file with editors other than draw.io -->
|
||||||
|
<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11.dtd">
|
||||||
|
<svg xmlns="http://www.w3.org/2000/svg" style="background: #ffffff; background-color: var(--ge-adaptive-bg, #ffffff); color-scheme: light dark;" xmlns:xlink="http://www.w3.org/1999/xlink" version="1.1" width="2512px" height="1533px" viewBox="0 0 2512 1533" id="ge-svg-QP1ztADYlWT_awuG9Oml" content="<mxfile host="app.diagrams.net" scale="1" border="20">
 <diagram id="C5RBs43oDa-KdzZeNtuy" name="Oldal-1">
 <mxGraphModel dx="1857" dy="1780" grid="1" gridSize="10" guides="1" tooltips="1" connect="1" arrows="1" fold="1" page="1" pageScale="1" pageWidth="827" pageHeight="1169" math="0" shadow="0">
 <root>
 <mxCell id="WIyWlLk6GJQsqaUBKTNV-0" />
 <mxCell id="WIyWlLk6GJQsqaUBKTNV-1" parent="WIyWlLk6GJQsqaUBKTNV-0" />
 <mxCell id="_r-HP5b758gAeptMtzsk-38" parent="WIyWlLk6GJQsqaUBKTNV-1" style="shape=folder;fontStyle=1;spacingTop=10;tabWidth=40;tabHeight=14;tabPosition=left;html=1;whiteSpace=wrap;fillColor=default;" value="" vertex="1">
 <mxGeometry height="880" width="1750" x="-500" y="-370" as="geometry" />
 </mxCell>
 <mxCell id="_r-HP5b758gAeptMtzsk-0" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;«Abstract»&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;Piece&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;- pieceColor: Color&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;- movedBefore: boolean&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ Piece(Color)&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ getMoveDomain() : Direction[]&amp;nbsp;&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ getColor() : Color&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ getSymbol() : Char&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ getType() : Type&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-left:4px;&quot;&gt;+ hasMoved() : bool&lt;/p&gt;" vertex="1">
 <mxGeometry height="170" width="260" x="250" y="-30" as="geometry" />
 </mxCell>
 <mxCell id="_r-HP5b758gAeptMtzsk-3" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;«Final»&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;Pawn&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&amp;nbsp;+ getMoveDomain() : Direction[]" vertex="1">
 <mxGeometry height="70" width="176" x="-486" y="390" as="geometry" />
 </mxCell>
 <mxCell id="_r-HP5b758gAeptMtzsk-4" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;" value="&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;«Final»&lt;/p&gt;&lt;p style=&quot;margin:0px;margin-top:4px;text-align:center;&quot;&gt;&lt;b&gt;King&lt;/b&gt;&lt;/p&gt;&lt;hr size=&quot;1&quot; style=&quot;border-style:solid;&quot;&gt;&amp;nbsp;+ getMoveDomain() : Direction[]" vertex="1">
 <mxGeometry height="70" width="176" x="-176" y="390" as="geometry" />
 </mxCell>
 <mxCell id="_r-HP5b758gAeptMtzsk-5" parent="WIyWlLk6GJQsqaUBKTNV-1" style="verticalAlign=top;align=left;overflow=fill;html=1;whiteSpace=wrap;&quoLine truncated
|
||||||
|
After Width: | Height: | Size: 953 KiB |
Whitespace-only changes.
Whitespace-only changes.
@@ -0,0 +1,90 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||||
|
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
|
||||||
|
<modelVersion>4.0.0</modelVersion>
|
||||||
|
|
||||||
|
<groupId>com.gitea.lin</groupId>
|
||||||
|
<artifactId>gui-chess</artifactId>
|
||||||
|
<version>0.0.0</version>
|
||||||
|
|
||||||
|
<name>gui-chess</name>
|
||||||
|
<!-- FIXME change it to the project's website -->
|
||||||
|
<url>http://www.example.com</url>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<project.build.sourceEncoding>UTF-8</project.build.sourceEncoding>
|
||||||
|
<maven.compiler.release>17</maven.compiler.release>
|
||||||
|
</properties>
|
||||||
|
|
||||||
|
<dependencyManagement>
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit</groupId>
|
||||||
|
<artifactId>junit-bom</artifactId>
|
||||||
|
<version>5.11.0</version>
|
||||||
|
<type>pom</type>
|
||||||
|
<scope>import</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<dependencies>
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-api</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
<!-- Optionally: parameterized tests support -->
|
||||||
|
<dependency>
|
||||||
|
<groupId>org.junit.jupiter</groupId>
|
||||||
|
<artifactId>junit-jupiter-params</artifactId>
|
||||||
|
<scope>test</scope>
|
||||||
|
</dependency>
|
||||||
|
</dependencies>
|
||||||
|
|
||||||
|
<build>
|
||||||
|
<pluginManagement><!-- lock down plugins versions to avoid using Maven defaults (may be moved to parent pom) -->
|
||||||
|
<plugins>
|
||||||
|
<!-- clean lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#clean_Lifecycle -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-clean-plugin</artifactId>
|
||||||
|
<version>3.4.0</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- default lifecycle, jar packaging: see https://maven.apache.org/ref/current/maven-core/default-bindings.html#Plugin_bindings_for_jar_packaging -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-resources-plugin</artifactId>
|
||||||
|
<version>3.3.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-compiler-plugin</artifactId>
|
||||||
|
<version>3.13.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-surefire-plugin</artifactId>
|
||||||
|
<version>3.3.0</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-jar-plugin</artifactId>
|
||||||
|
<version>3.4.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-install-plugin</artifactId>
|
||||||
|
<version>3.1.2</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-deploy-plugin</artifactId>
|
||||||
|
<version>3.1.2</version>
|
||||||
|
</plugin>
|
||||||
|
<!-- site lifecycle, see https://maven.apache.org/ref/current/maven-core/lifecycles.html#site_Lifecycle -->
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-site-plugin</artifactId>
|
||||||
|
<version>3.12.1</version>
|
||||||
|
</plugin>
|
||||||
|
<plugin>
|
||||||
|
<artifactId>maven-project-info-reports-plugin</artifactId>
|
||||||
|
<version>3.6.1</version>
|
||||||
|
</plugin>
|
||||||
|
</plugins>
|
||||||
|
</pluginManagement>
|
||||||
|
</build>
|
||||||
|
</project>
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.gitea.lin;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Hello world!
|
||||||
|
*/
|
||||||
|
public class App {
|
||||||
|
public static void main(String[] args) {
|
||||||
|
System.out.println("Hello World!");
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,6 @@
|
|||||||
|
package com.gitea.lin.model;
|
||||||
|
|
||||||
|
public enum Color {
|
||||||
|
WHITE,
|
||||||
|
BLACK,
|
||||||
|
}
|
||||||
@@ -0,0 +1,53 @@
|
|||||||
|
package com.gitea.lin.model;
|
||||||
|
|
||||||
|
public enum Direction {
|
||||||
|
// Orthogonal (Rook, Queen, King)
|
||||||
|
NORTH(0, -1),
|
||||||
|
SOUTH(0, 1),
|
||||||
|
EAST(1, 0),
|
||||||
|
WEST(-1, 0),
|
||||||
|
|
||||||
|
// Diagonal (Bishop, Queen, King, Pawn captures)
|
||||||
|
NORTH_EAST(1, -1),
|
||||||
|
NORTH_WEST(-1, -1),
|
||||||
|
SOUTH_EAST(1, 1),
|
||||||
|
SOUTH_WEST(-1, 1),
|
||||||
|
|
||||||
|
// Knight Jumps (L-shapes)
|
||||||
|
KNIGHT_NNE(1, -2),
|
||||||
|
KNIGHT_ENE(2, -1),
|
||||||
|
KNIGHT_ESE(2, 1),
|
||||||
|
KNIGHT_SSE(1, 2),
|
||||||
|
KNIGHT_SSW(-1, 2),
|
||||||
|
KNIGHT_WSW(-2, 1),
|
||||||
|
KNIGHT_WNW(-2, -1),
|
||||||
|
KNIGHT_NNW(-1, -2),
|
||||||
|
|
||||||
|
// Pawn Initial Double Push
|
||||||
|
PAWN_DOUBLE_NORTH(0, -2),
|
||||||
|
PAWN_DOUBLE_SOUTH(0, 2);
|
||||||
|
|
||||||
|
private final int dx;
|
||||||
|
private final int dy;
|
||||||
|
|
||||||
|
Direction(int dx, int dy) {
|
||||||
|
this.dx = dx;
|
||||||
|
this.dy = dy;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDx() {
|
||||||
|
return dx;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getDy() {
|
||||||
|
return dy;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Converts the 2D vector into a 1D array offset for Piece[64].
|
||||||
|
* (Assuming index 0 is top-left a8 and 63 is bottom-right h1)
|
||||||
|
*/
|
||||||
|
public int getFlatOffset() {
|
||||||
|
return dy * 8 + dx;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.gitea.lin.model.Piece;
|
||||||
|
|
||||||
|
import com.gitea.lin.model.Color;
|
||||||
|
import com.gitea.lin.model.Direction;
|
||||||
|
import com.gitea.lin.model.Type;
|
||||||
|
|
||||||
|
import static com.gitea.lin.model.Direction.*;
|
||||||
|
|
||||||
|
public final class Bishop extends Piece {
|
||||||
|
public Bishop(Color c) {
|
||||||
|
super(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Direction[] getMoveDomain() {
|
||||||
|
return new Direction[] {NORTH_EAST, NORTH_WEST, SOUTH_EAST, SOUTH_WEST};
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int getMaximumStep() { return 7; }
|
||||||
|
@Override
|
||||||
|
public char getSymbol() { return 'B'; }
|
||||||
|
@Override
|
||||||
|
public Type getType() { return Type.BISHOP; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,33 @@
|
|||||||
|
package com.gitea.lin.model.Piece;
|
||||||
|
|
||||||
|
import com.gitea.lin.model.Color;
|
||||||
|
import com.gitea.lin.model.Direction;
|
||||||
|
import com.gitea.lin.model.Type;
|
||||||
|
|
||||||
|
import static com.gitea.lin.model.Direction.*;
|
||||||
|
|
||||||
|
public final class King extends Piece {
|
||||||
|
public King(Color c) {
|
||||||
|
super(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Direction[] getMoveDomain() {
|
||||||
|
return new Direction[] {NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, WEST, NORTH_WEST};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaximumStep() {
|
||||||
|
return 1;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public char getSymbol() {
|
||||||
|
return 'K';
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type getType() {
|
||||||
|
return Type.KING;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.gitea.lin.model.Piece;
|
||||||
|
|
||||||
|
import com.gitea.lin.model.Color;
|
||||||
|
import com.gitea.lin.model.Direction;
|
||||||
|
import com.gitea.lin.model.Type;
|
||||||
|
|
||||||
|
import static com.gitea.lin.model.Direction.*;
|
||||||
|
|
||||||
|
public final class Knight extends Piece {
|
||||||
|
public Knight(Color c) {
|
||||||
|
super(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Direction[] getMoveDomain() {
|
||||||
|
return new Direction[] {KNIGHT_ENE, KNIGHT_ESE, KNIGHT_NNE, KNIGHT_NNW, KNIGHT_SSE, KNIGHT_SSW, KNIGHT_WNW, KNIGHT_WSW};
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int getMaximumStep() { return 2; }
|
||||||
|
@Override
|
||||||
|
public char getSymbol() { return 'N'; }
|
||||||
|
@Override
|
||||||
|
public Type getType() { return Type.KNIGHT; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,44 @@
|
|||||||
|
package com.gitea.lin.model.Piece;
|
||||||
|
|
||||||
|
import com.gitea.lin.model.Color;
|
||||||
|
import com.gitea.lin.model.Direction;
|
||||||
|
import com.gitea.lin.model.Type;
|
||||||
|
|
||||||
|
import static com.gitea.lin.model.Direction.*;
|
||||||
|
|
||||||
|
public final class Pawn extends Piece {
|
||||||
|
public Pawn(Color c) {
|
||||||
|
super(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Direction[] getMoveDomain() {
|
||||||
|
boolean isWhite = super.getColor() == Color.WHITE;
|
||||||
|
|
||||||
|
Direction forward = isWhite ? NORTH : SOUTH;
|
||||||
|
Direction forwardDouble = isWhite ? PAWN_DOUBLE_NORTH : PAWN_DOUBLE_SOUTH;
|
||||||
|
Direction hitLeft = isWhite ? NORTH_WEST : SOUTH_WEST;
|
||||||
|
Direction hitRight = isWhite ? NORTH_EAST : SOUTH_EAST;
|
||||||
|
|
||||||
|
if (super.hasMoved()) {
|
||||||
|
return new Direction[] {forward, hitLeft, hitRight};
|
||||||
|
}
|
||||||
|
|
||||||
|
return new Direction[] {forward, forwardDouble, hitLeft, hitRight};
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getMaximumStep() {
|
||||||
|
return super.hasMoved() ? 1 : 2;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public char getSymbol() {
|
||||||
|
return 'P';
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Type getType() {
|
||||||
|
return Type.PAWN;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,27 @@
|
|||||||
|
package com.gitea.lin.model.Piece;
|
||||||
|
|
||||||
|
import com.gitea.lin.model.Color;
|
||||||
|
import com.gitea.lin.model.Direction;
|
||||||
|
import com.gitea.lin.model.Type;
|
||||||
|
|
||||||
|
public abstract class Piece {
|
||||||
|
private Color pieceColor;
|
||||||
|
private boolean movedBefore;
|
||||||
|
|
||||||
|
public Piece(Color c) {
|
||||||
|
this.pieceColor = c;
|
||||||
|
}
|
||||||
|
|
||||||
|
public abstract Direction[] getMoveDomain();
|
||||||
|
public abstract int getMaximumStep(); // TODO: Update UML
|
||||||
|
public abstract char getSymbol();
|
||||||
|
public abstract Type getType();
|
||||||
|
|
||||||
|
public Color getColor() {
|
||||||
|
return this.pieceColor;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean hasMoved() {
|
||||||
|
return this.movedBefore;
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.gitea.lin.model.Piece;
|
||||||
|
|
||||||
|
import com.gitea.lin.model.Color;
|
||||||
|
import com.gitea.lin.model.Direction;
|
||||||
|
import com.gitea.lin.model.Type;
|
||||||
|
|
||||||
|
import static com.gitea.lin.model.Direction.*;
|
||||||
|
|
||||||
|
public final class Queen extends Piece {
|
||||||
|
public Queen(Color c) {
|
||||||
|
super(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Direction[] getMoveDomain() {
|
||||||
|
return new Direction[] {NORTH, NORTH_EAST, EAST, SOUTH_EAST, SOUTH, SOUTH_WEST, WEST, NORTH_WEST};
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int getMaximumStep() { return 7; }
|
||||||
|
@Override
|
||||||
|
public char getSymbol() { return 'Q'; }
|
||||||
|
@Override
|
||||||
|
public Type getType() { return Type.QUEEN; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,24 @@
|
|||||||
|
package com.gitea.lin.model.Piece;
|
||||||
|
|
||||||
|
import com.gitea.lin.model.Color;
|
||||||
|
import com.gitea.lin.model.Direction;
|
||||||
|
import com.gitea.lin.model.Type;
|
||||||
|
|
||||||
|
import static com.gitea.lin.model.Direction.*;
|
||||||
|
|
||||||
|
public final class Rook extends Piece {
|
||||||
|
public Rook(Color c) {
|
||||||
|
super(c);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public Direction[] getMoveDomain() {
|
||||||
|
return new Direction[] {NORTH, EAST, SOUTH, WEST};
|
||||||
|
}
|
||||||
|
@Override
|
||||||
|
public int getMaximumStep() { return 7; }
|
||||||
|
@Override
|
||||||
|
public char getSymbol() { return 'R'; }
|
||||||
|
@Override
|
||||||
|
public Type getType() { return Type.ROOK; }
|
||||||
|
}
|
||||||
@@ -0,0 +1,10 @@
|
|||||||
|
package com.gitea.lin.model;
|
||||||
|
|
||||||
|
public enum Type {
|
||||||
|
PAWN,
|
||||||
|
KING,
|
||||||
|
QUEEN,
|
||||||
|
ROOK,
|
||||||
|
BISHOP,
|
||||||
|
KNIGHT,
|
||||||
|
}
|
||||||
@@ -0,0 +1,19 @@
|
|||||||
|
package com.gitea.lin;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.Test;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Unit test for simple App.
|
||||||
|
*/
|
||||||
|
public class AppTest {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rigorous Test :-)
|
||||||
|
*/
|
||||||
|
@Test
|
||||||
|
public void shouldAnswerWithTrue() {
|
||||||
|
assertTrue(true);
|
||||||
|
}
|
||||||
|
}
|
||||||
Binary file not shown.
Binary file not shown.
@@ -0,0 +1,3 @@
|
|||||||
|
artifactId=gui-chess
|
||||||
|
groupId=com.gitea.lin
|
||||||
|
version=0.0.0
|
||||||
Whitespace-only changes.
+1
@@ -0,0 +1 @@
|
|||||||
|
C:\Users\Bandi\Documents\coding\java\Prog3_nagyházi\gui-chess\src\main\java\com\gitea\lin\App.java
|
||||||
Whitespace-only changes.
+1
@@ -0,0 +1 @@
|
|||||||
|
C:\Users\Bandi\Documents\coding\java\Prog3_nagyházi\gui-chess\src\test\java\com\gitea\lin\AppTest.java
|
||||||
@@ -0,0 +1,63 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
<testsuite xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="https://maven.apache.org/surefire/maven-surefire-plugin/xsd/surefire-test-report.xsd" version="3.0.1" name="com.gitea.lin.AppTest" time="0.056" tests="1" errors="0" skipped="0" failures="0">
|
||||||
|
<properties>
|
||||||
|
<property name="java.specification.version" value="26"/>
|
||||||
|
<property name="sun.cpu.isalist" value="amd64"/>
|
||||||
|
<property name="sun.jnu.encoding" value="Cp1250"/>
|
||||||
|
<property name="java.class.path" value="C:\Users\Bandi\Documents\coding\java\Prog3_nagyházi\gui-chess\target\test-classes;C:\Users\Bandi\Documents\coding\java\Prog3_nagyházi\gui-chess\target\classes;C:\Users\Bandi\.m2\repository\org\junit\jupiter\junit-jupiter-api\5.11.0\junit-jupiter-api-5.11.0.jar;C:\Users\Bandi\.m2\repository\org\opentest4j\opentest4j\1.3.0\opentest4j-1.3.0.jar;C:\Users\Bandi\.m2\repository\org\junit\platform\junit-platform-commons\1.11.0\junit-platform-commons-1.11.0.jar;C:\Users\Bandi\.m2\repository\org\apiguardian\apiguardian-api\1.1.2\apiguardian-api-1.1.2.jar;C:\Users\Bandi\.m2\repository\org\junit\jupiter\junit-jupiter-params\5.11.0\junit-jupiter-params-5.11.0.jar;"/>
|
||||||
|
<property name="java.vm.vendor" value="Oracle Corporation"/>
|
||||||
|
<property name="sun.arch.data.model" value="64"/>
|
||||||
|
<property name="user.variant" value=""/>
|
||||||
|
<property name="java.vendor.url" value="https://java.oracle.com/"/>
|
||||||
|
<property name="user.timezone" value="Europe/Budapest"/>
|
||||||
|
<property name="os.name" value="Windows 11"/>
|
||||||
|
<property name="java.vm.specification.version" value="26"/>
|
||||||
|
<property name="sun.java.launcher" value="SUN_STANDARD"/>
|
||||||
|
<property name="user.country" value="HU"/>
|
||||||
|
<property name="sun.boot.library.path" value="C:\Program Files\Java\jdk-26.0.2.1\bin"/>
|
||||||
|
<property name="sun.java.command" value="C:\Users\Bandi\AppData\Local\Temp\surefire15989385249947531126\surefirebooter-20261013163928644_3.jar C:\Users\Bandi\AppData\Local\Temp\surefire15989385249947531126 2026-10-13T16-39-28_444-jvmRun1 surefire-20261013163928644_1tmp surefire_0-20261013163928644_2tmp"/>
|
||||||
|
<property name="jdk.debug" value="release"/>
|
||||||
|
<property name="surefire.test.class.path" value="C:\Users\Bandi\Documents\coding\java\Prog3_nagyházi\gui-chess\target\test-classes;C:\Users\Bandi\Documents\coding\java\Prog3_nagyházi\gui-chess\target\classes;C:\Users\Bandi\.m2\repository\org\junit\jupiter\junit-jupiter-api\5.11.0\junit-jupiter-api-5.11.0.jar;C:\Users\Bandi\.m2\repository\org\opentest4j\opentest4j\1.3.0\opentest4j-1.3.0.jar;C:\Users\Bandi\.m2\repository\org\junit\platform\junit-platform-commons\1.11.0\junit-platform-commons-1.11.0.jar;C:\Users\Bandi\.m2\repository\org\apiguardian\apiguardian-api\1.1.2\apiguardian-api-1.1.2.jar;C:\Users\Bandi\.m2\repository\org\junit\jupiter\junit-jupiter-params\5.11.0\junit-jupiter-params-5.11.0.jar;"/>
|
||||||
|
<property name="sun.cpu.endian" value="little"/>
|
||||||
|
<property name="user.home" value="C:\Users\Bandi"/>
|
||||||
|
<property name="user.language" value="hu"/>
|
||||||
|
<property name="java.specification.vendor" value="Oracle Corporation"/>
|
||||||
|
<property name="java.version.date" value="2026-08-18"/>
|
||||||
|
<property name="java.home" value="C:\Program Files\Java\jdk-26.0.2.1"/>
|
||||||
|
<property name="file.separator" value="\"/>
|
||||||
|
<property name="basedir" value="C:\Users\Bandi\Documents\coding\java\Prog3_nagyházi\gui-chess"/>
|
||||||
|
<property name="java.vm.compressedOopsMode" value="Zero based"/>
|
||||||
|
<property name="line.separator" value=" "/>
|
||||||
|
<property name="java.vm.specification.vendor" value="Oracle Corporation"/>
|
||||||
|
<property name="java.specification.name" value="Java Platform API Specification"/>
|
||||||
|
<property name="surefire.real.class.path" value="C:\Users\Bandi\AppData\Local\Temp\surefire15989385249947531126\surefirebooter-20261013163928644_3.jar"/>
|
||||||
|
<property name="user.script" value=""/>
|
||||||
|
<property name="sun.management.compiler" value="HotSpot 64-Bit Tiered Compilers"/>
|
||||||
|
<property name="java.runtime.version" value="26.0.2.1+1-7"/>
|
||||||
|
<property name="user.name" value="Bandi"/>
|
||||||
|
<property name="stdout.encoding" value="Cp1250"/>
|
||||||
|
<property name="path.separator" value=";"/>
|
||||||
|
<property name="os.version" value="10.0"/>
|
||||||
|
<property name="java.runtime.name" value="Java(TM) SE Runtime Environment"/>
|
||||||
|
<property name="file.encoding" value="UTF-8"/>
|
||||||
|
<property name="java.vm.name" value="Java HotSpot(TM) 64-Bit Server VM"/>
|
||||||
|
<property name="localRepository" value="C:\Users\Bandi\.m2\repository"/>
|
||||||
|
<property name="java.vendor.url.bug" value="https://bugreport.java.com/bugreport/"/>
|
||||||
|
<property name="java.io.tmpdir" value="C:\Users\Bandi\AppData\Local\Temp\"/>
|
||||||
|
<property name="java.version" value="26.0.2.1"/>
|
||||||
|
<property name="user.dir" value="C:\Users\Bandi\Documents\coding\java\Prog3_nagyházi\gui-chess"/>
|
||||||
|
<property name="os.arch" value="amd64"/>
|
||||||
|
<property name="java.vm.specification.name" value="Java Virtual Machine Specification"/>
|
||||||
|
<property name="sun.os.patch.level" value=""/>
|
||||||
|
<property name="native.encoding" value="Cp1250"/>
|
||||||
|
<property name="java.library.path" value="C:\Program Files\Java\jdk-26.0.2.1\bin;C:\WINDOWS\Sun\Java\bin;C:\WINDOWS\system32;C:\WINDOWS;C:\Program Files (x86)\VMware\VMware Workstation\bin\;C:\Program Files\Common Files\Oracle\Java\javapath;C:\Program Files (x86)\Common Files\Oracle\Java\java8path;C:\Program Files (x86)\Common Files\Oracle\Java\javapath;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\Program Files (x86)\NVIDIA Corporation\PhysX\Common;C:\Program Files\dotnet\;D:\Git\cmd;C:\Program Files\NVIDIA Corporation\NVIDIA app\NvDLISR;C:\WINDOWS\system32;C:\WINDOWS;C:\WINDOWS\System32\Wbem;C:\WINDOWS\System32\WindowsPowerShell\v1.0\;C:\WINDOWS\System32\OpenSSH\;C:\msys64\ucrt64\bin;C:\Program Files\Go\bin;C:\Program Files\nodejs\;C:\Program Files\CMake\bin;C:\Program Files (x86)\Windows Kits\10\Windows Performance Toolkit\;C:\Program Files\Java\jdk-26.0.2.1\bin;C:\Program Files\Git\cmd;C:\Program Files\PuTTY\;C:\Program Files\Tailscale\;C:\Users\Bandi\AppData\Local\Programs\Python\Python314\Scripts\;C:\Users\Bandi\AppData\Local\Programs\Python\Python314\;D:\Python\Scripts\;D:\Python\;C:\Users\Bandi\AppData\Local\Microsoft\WindowsApps;C:\Users\Bandi\AppData\Local\JetBrains\Toolbox\scripts;C:\Git\bin;C:\msys64\ucrt64\bin;C:\Program Files (x86)\GnuWin32\bin;C:\Users\Bandi\AppData\Local\Programs\Zed\bin;C:\Users\Bandi\go\bin;C:\Users\Bandi\AppData\Local\Microsoft\WinGet\Packages\Task.Task_Microsoft.Winget.Source_8wekyb3d8bbwe;C:\Users\Bandi\AppData\Roaming\npm;C:\Program Files\LLVM\bin;C:\ninja;C:\Users\Bandi\.dotnet\tools;C:\Program Files\JetBrains\IntelliJ IDEA 2026.2.0.1\bin;C:\Users\Bandi\AppData\Local\Programs\Microsoft VS Code\bin;C:\apache-maven-3.9.16\bin;;C:\Users\Bandi\AppData\Local\Programs\DockerDesktop\resources\bin;."/>
|
||||||
|
<property name="java.vm.info" value="mixed mode, sharing"/>
|
||||||
|
<property name="stderr.encoding" value="Cp1250"/>
|
||||||
|
<property name="java.vendor" value="Oracle Corporation"/>
|
||||||
|
<property name="java.vm.version" value="26.0.2.1+1-7"/>
|
||||||
|
<property name="stdin.encoding" value="Cp1250"/>
|
||||||
|
<property name="sun.io.unicode.encoding" value="UnicodeLittle"/>
|
||||||
|
<property name="java.class.version" value="70.0"/>
|
||||||
|
</properties>
|
||||||
|
<testcase name="shouldAnswerWithTrue" classname="com.gitea.lin.AppTest" time="0.03"/>
|
||||||
|
</testsuite>
|
||||||
@@ -0,0 +1,4 @@
|
|||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Test set: com.gitea.lin.AppTest
|
||||||
|
-------------------------------------------------------------------------------
|
||||||
|
Tests run: 1, Failures: 0, Errors: 0, Skipped: 0, Time elapsed: 0.056 s -- in com.gitea.lin.AppTest
|
||||||
Binary file not shown.
Reference in new issue
Block a user