Compare commits
96 Commits
HAAAAAAAAA
...
master
| Author | SHA1 | Date | |
|---|---|---|---|
| 39e2475983 | |||
| 7dd3f198db | |||
| 11a246adfd | |||
| 20db850334 | |||
|
|
69135e8173 | ||
| 09aa4bc3c1 | |||
| 836eb85e1f | |||
|
|
3bf3ed23ba | ||
|
|
6a54635c59 | ||
| 78537be4e9 | |||
|
|
5a1fd9ff9d | ||
| c047379d01 | |||
| 5bda0a1be7 | |||
| c3610c47c9 | |||
| 08ed9b46b1 | |||
| 2595af2d48 | |||
| edfc5733db | |||
|
|
71666a3883 | ||
| 3f1ef93323 | |||
| a580321bd0 | |||
| d7d7dfe787 | |||
|
|
2fb3874a99 | ||
|
|
591e4f977a | ||
|
|
c481f66b0c | ||
|
|
aafb025874 | ||
|
|
627c49b961 | ||
|
|
b4157167b5 | ||
|
|
1419898955 | ||
|
|
dd3be67be0 | ||
|
|
c6a32b8d07 | ||
|
|
a8439df736 | ||
|
|
27032d264d | ||
|
|
8afd51b353 | ||
| 2460b7539e | |||
| 0f5020b0b4 | |||
| ac4f859fd8 | |||
| 4a8644181a | |||
| efa357a1ab | |||
| 618e436270 | |||
| d5009371f2 | |||
| 87727f39e8 | |||
| 413201882b | |||
| d8289b553a | |||
|
|
adeb9b07e5 | ||
|
|
4903fd567b | ||
| 990c830590 | |||
| d806420d21 | |||
| 4b98341618 | |||
| 68021b796b | |||
| 06efbf649b | |||
| 4ee29d8f50 | |||
| eda2a1afae | |||
| f3bbfd9e6c | |||
|
|
129c3ef0b2 | ||
| 14d0521215 | |||
| 7568208045 | |||
| 86aa6e9bb5 | |||
| 91c645e34f | |||
| 78bdefebe5 | |||
| 3e30332245 | |||
| 275878932b | |||
| 68d577a99a | |||
| fa3124220d | |||
| 3a009256c5 | |||
| d09bf6e9ce | |||
| 5da915932d | |||
| da422e78b8 | |||
| f0a0a8e328 | |||
| 436b641269 | |||
| 34a59546e6 | |||
| 9e2421accf | |||
| 52ca8b208c | |||
|
|
140d37fbd9 | ||
|
|
2b3581a400 | ||
| a6b1fae230 | |||
| a20a5387a7 | |||
|
|
8c672e24ad | ||
|
|
815756b5e9 | ||
| a1032335a5 | |||
| 336d8378ae | |||
| c165ecdae5 | |||
| 352aee49e4 | |||
| f22debdf5f | |||
| 02089c649b | |||
| e98199e1ec | |||
| 438252a8ca | |||
| caf6569409 | |||
| 3863c812c8 | |||
| 6d96455ac4 | |||
| a5c046f891 | |||
|
|
b7f9ca8a98 | ||
| a160042ef4 | |||
| f47e4cc309 | |||
| 25c2270a37 | |||
| bcded60fbe | |||
| edfffaf061 |
2
.github/workflows/build.yml
vendored
2
.github/workflows/build.yml
vendored
@@ -19,7 +19,7 @@ jobs:
|
|||||||
uses: gradle/actions/setup-gradle@v4
|
uses: gradle/actions/setup-gradle@v4
|
||||||
|
|
||||||
- name: Build with Gradle
|
- name: Build with Gradle
|
||||||
run: ./gradlew build
|
run: ./gradlew assemble
|
||||||
|
|
||||||
- name: Test
|
- name: Test
|
||||||
run: ./gradlew test
|
run: ./gradlew test
|
||||||
|
|||||||
13
README.md
13
README.md
@@ -1,13 +1,26 @@
|
|||||||
# Sudoku 🧩
|
# Sudoku 🧩
|
||||||
|
|
||||||
|
Une application de génération et résolution de MultiDoku.
|
||||||
|
|
||||||
## Features 🌟
|
## Features 🌟
|
||||||
|
|
||||||
|
- MultiDoku solvers
|
||||||
- Graphical User Interface (GUI)
|
- Graphical User Interface (GUI)
|
||||||
- Sudoku saves
|
- Sudoku saves
|
||||||
- Multiplayer
|
- Multiplayer
|
||||||
|
|
||||||
|
## Screenshots 🖼
|
||||||
|
|
||||||
|
[[screenshots/menu.png]]
|
||||||
|
|
||||||
|
[[screenshots/solo.png]]
|
||||||
|
|
||||||
|
[[screenshots/multi.png]]
|
||||||
|
|
||||||
## Develop ☝🤓
|
## Develop ☝🤓
|
||||||
|
|
||||||
|
**Pour plus de détails sur la conception et autres, regarder le 👉 [wiki](https://git.ale-pri.com/Ryuk/Sudoku/wiki)** 👈
|
||||||
|
|
||||||
### Run 🏃
|
### Run 🏃
|
||||||
|
|
||||||
```sh
|
```sh
|
||||||
|
|||||||
@@ -11,35 +11,25 @@ plugins {
|
|||||||
id 'application'
|
id 'application'
|
||||||
}
|
}
|
||||||
|
|
||||||
project.ext.os = System.properties['os.name'].toLowerCase().split(" ")[0]
|
|
||||||
|
|
||||||
repositories {
|
repositories {
|
||||||
// Use Maven Central for resolving dependencies.
|
// Use Maven Central for resolving dependencies.
|
||||||
mavenCentral()
|
mavenCentral()
|
||||||
flatDir {
|
|
||||||
dirs("$rootProject.projectDir/libs")
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
dependencies {
|
dependencies {
|
||||||
// Use JUnit Jupiter for testing.
|
// Use JUnit Jupiter for testing.
|
||||||
testImplementation 'org.junit.jupiter:junit-jupiter:5.9.1'
|
testImplementation 'org.junit.jupiter:junit-jupiter-api:5.8.1'
|
||||||
|
testRuntimeOnly 'org.junit.jupiter:junit-jupiter-engine:5.8.1'
|
||||||
// This dependency is used by the application.
|
|
||||||
implementation 'com.google.guava:guava:31.1-jre'
|
|
||||||
|
|
||||||
// uml
|
|
||||||
implementation 'com.github.javaparser:javaparser-symbol-solver-core:3.26.2'
|
|
||||||
|
|
||||||
implementation 'org.json:json:20250107'
|
implementation 'org.json:json:20250107'
|
||||||
|
|
||||||
implementation 'com.fasterxml.jackson.core:jackson-databind:2.18.2'
|
|
||||||
|
|
||||||
implementation "io.github.spair:imgui-java-app:1.88.0"
|
implementation "io.github.spair:imgui-java-app:1.88.0"
|
||||||
|
|
||||||
implementation "org.lwjgl:lwjgl-stb:3.3.4"
|
implementation "org.lwjgl:lwjgl-stb:3.3.4"
|
||||||
|
|
||||||
runtimeOnly "org.lwjgl:lwjgl-stb::natives-$os"
|
implementation "org.lwjgl:lwjgl-stb::natives-linux"
|
||||||
|
implementation "org.lwjgl:lwjgl-stb::natives-windows"
|
||||||
|
implementation "org.lwjgl:lwjgl-stb::natives-macos"
|
||||||
}
|
}
|
||||||
|
|
||||||
application {
|
application {
|
||||||
@@ -47,8 +37,19 @@ application {
|
|||||||
mainClass = 'gui.Main'
|
mainClass = 'gui.Main'
|
||||||
}
|
}
|
||||||
|
|
||||||
tasks.named('test') {
|
// Add libraries into the final jar
|
||||||
// Use JUnit Platform for unit tests.
|
jar {
|
||||||
|
archiveBaseName = rootProject.getName()
|
||||||
|
duplicatesStrategy = DuplicatesStrategy.EXCLUDE
|
||||||
|
manifest {
|
||||||
|
attributes "Main-Class": application.mainClass
|
||||||
|
}
|
||||||
|
from {
|
||||||
|
configurations.compileClasspath.collect { it.isDirectory() ? it : zipTree(it) }
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
test {
|
||||||
useJUnitPlatform()
|
useJUnitPlatform()
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,572 +0,0 @@
|
|||||||
{
|
|
||||||
"cells": [
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"blocks": [
|
|
||||||
{"cellIDs": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
9,
|
|
||||||
10,
|
|
||||||
11,
|
|
||||||
18,
|
|
||||||
19,
|
|
||||||
20
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
12,
|
|
||||||
13,
|
|
||||||
14,
|
|
||||||
21,
|
|
||||||
22,
|
|
||||||
23
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
15,
|
|
||||||
16,
|
|
||||||
17,
|
|
||||||
24,
|
|
||||||
25,
|
|
||||||
26
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
27,
|
|
||||||
28,
|
|
||||||
29,
|
|
||||||
36,
|
|
||||||
37,
|
|
||||||
38,
|
|
||||||
45,
|
|
||||||
46,
|
|
||||||
47
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
30,
|
|
||||||
31,
|
|
||||||
32,
|
|
||||||
39,
|
|
||||||
40,
|
|
||||||
41,
|
|
||||||
48,
|
|
||||||
49,
|
|
||||||
50
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
33,
|
|
||||||
34,
|
|
||||||
35,
|
|
||||||
42,
|
|
||||||
43,
|
|
||||||
44,
|
|
||||||
51,
|
|
||||||
52,
|
|
||||||
53
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
54,
|
|
||||||
55,
|
|
||||||
56,
|
|
||||||
63,
|
|
||||||
64,
|
|
||||||
65,
|
|
||||||
72,
|
|
||||||
73,
|
|
||||||
74
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
57,
|
|
||||||
58,
|
|
||||||
59,
|
|
||||||
66,
|
|
||||||
67,
|
|
||||||
68,
|
|
||||||
75,
|
|
||||||
76,
|
|
||||||
77
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
60,
|
|
||||||
61,
|
|
||||||
62,
|
|
||||||
69,
|
|
||||||
70,
|
|
||||||
71,
|
|
||||||
78,
|
|
||||||
79,
|
|
||||||
80
|
|
||||||
]}
|
|
||||||
],
|
|
||||||
"multidoku": [{
|
|
||||||
"blockWidth": 3,
|
|
||||||
"cells": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
10,
|
|
||||||
11,
|
|
||||||
12,
|
|
||||||
13,
|
|
||||||
14,
|
|
||||||
15,
|
|
||||||
16,
|
|
||||||
17,
|
|
||||||
18,
|
|
||||||
19,
|
|
||||||
20,
|
|
||||||
21,
|
|
||||||
22,
|
|
||||||
23,
|
|
||||||
24,
|
|
||||||
25,
|
|
||||||
26,
|
|
||||||
27,
|
|
||||||
28,
|
|
||||||
29,
|
|
||||||
30,
|
|
||||||
31,
|
|
||||||
32,
|
|
||||||
33,
|
|
||||||
34,
|
|
||||||
35,
|
|
||||||
36,
|
|
||||||
37,
|
|
||||||
38,
|
|
||||||
39,
|
|
||||||
40,
|
|
||||||
41,
|
|
||||||
42,
|
|
||||||
43,
|
|
||||||
44,
|
|
||||||
45,
|
|
||||||
46,
|
|
||||||
47,
|
|
||||||
48,
|
|
||||||
49,
|
|
||||||
50,
|
|
||||||
51,
|
|
||||||
52,
|
|
||||||
53,
|
|
||||||
54,
|
|
||||||
55,
|
|
||||||
56,
|
|
||||||
57,
|
|
||||||
58,
|
|
||||||
59,
|
|
||||||
60,
|
|
||||||
61,
|
|
||||||
62,
|
|
||||||
63,
|
|
||||||
64,
|
|
||||||
65,
|
|
||||||
66,
|
|
||||||
67,
|
|
||||||
68,
|
|
||||||
69,
|
|
||||||
70,
|
|
||||||
71,
|
|
||||||
72,
|
|
||||||
73,
|
|
||||||
74,
|
|
||||||
75,
|
|
||||||
76,
|
|
||||||
77,
|
|
||||||
78,
|
|
||||||
79,
|
|
||||||
80
|
|
||||||
],
|
|
||||||
"blocks": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8
|
|
||||||
],
|
|
||||||
"constraints": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
@@ -1,572 +0,0 @@
|
|||||||
{
|
|
||||||
"cells": [
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 0,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 1,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 2,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 2
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 3,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 4,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 5,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 4
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 5
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 3
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 6
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 0
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 6,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 7
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 7,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"symbolIndex": -1
|
|
||||||
},
|
|
||||||
{
|
|
||||||
"blockID": 8,
|
|
||||||
"immutable": true,
|
|
||||||
"symbolIndex": 8
|
|
||||||
}
|
|
||||||
],
|
|
||||||
"blocks": [
|
|
||||||
{"cellIDs": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
9,
|
|
||||||
10,
|
|
||||||
11,
|
|
||||||
18,
|
|
||||||
19,
|
|
||||||
20
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
12,
|
|
||||||
13,
|
|
||||||
14,
|
|
||||||
21,
|
|
||||||
22,
|
|
||||||
23
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
15,
|
|
||||||
16,
|
|
||||||
17,
|
|
||||||
24,
|
|
||||||
25,
|
|
||||||
26
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
27,
|
|
||||||
28,
|
|
||||||
29,
|
|
||||||
36,
|
|
||||||
37,
|
|
||||||
38,
|
|
||||||
45,
|
|
||||||
46,
|
|
||||||
47
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
30,
|
|
||||||
31,
|
|
||||||
32,
|
|
||||||
39,
|
|
||||||
40,
|
|
||||||
41,
|
|
||||||
48,
|
|
||||||
49,
|
|
||||||
50
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
33,
|
|
||||||
34,
|
|
||||||
35,
|
|
||||||
42,
|
|
||||||
43,
|
|
||||||
44,
|
|
||||||
51,
|
|
||||||
52,
|
|
||||||
53
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
54,
|
|
||||||
55,
|
|
||||||
56,
|
|
||||||
63,
|
|
||||||
64,
|
|
||||||
65,
|
|
||||||
72,
|
|
||||||
73,
|
|
||||||
74
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
57,
|
|
||||||
58,
|
|
||||||
59,
|
|
||||||
66,
|
|
||||||
67,
|
|
||||||
68,
|
|
||||||
75,
|
|
||||||
76,
|
|
||||||
77
|
|
||||||
]},
|
|
||||||
{"cellIDs": [
|
|
||||||
60,
|
|
||||||
61,
|
|
||||||
62,
|
|
||||||
69,
|
|
||||||
70,
|
|
||||||
71,
|
|
||||||
78,
|
|
||||||
79,
|
|
||||||
80
|
|
||||||
]}
|
|
||||||
],
|
|
||||||
"multidoku": [{
|
|
||||||
"blockWidth": 3,
|
|
||||||
"cells": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8,
|
|
||||||
9,
|
|
||||||
10,
|
|
||||||
11,
|
|
||||||
12,
|
|
||||||
13,
|
|
||||||
14,
|
|
||||||
15,
|
|
||||||
16,
|
|
||||||
17,
|
|
||||||
18,
|
|
||||||
19,
|
|
||||||
20,
|
|
||||||
21,
|
|
||||||
22,
|
|
||||||
23,
|
|
||||||
24,
|
|
||||||
25,
|
|
||||||
26,
|
|
||||||
27,
|
|
||||||
28,
|
|
||||||
29,
|
|
||||||
30,
|
|
||||||
31,
|
|
||||||
32,
|
|
||||||
33,
|
|
||||||
34,
|
|
||||||
35,
|
|
||||||
36,
|
|
||||||
37,
|
|
||||||
38,
|
|
||||||
39,
|
|
||||||
40,
|
|
||||||
41,
|
|
||||||
42,
|
|
||||||
43,
|
|
||||||
44,
|
|
||||||
45,
|
|
||||||
46,
|
|
||||||
47,
|
|
||||||
48,
|
|
||||||
49,
|
|
||||||
50,
|
|
||||||
51,
|
|
||||||
52,
|
|
||||||
53,
|
|
||||||
54,
|
|
||||||
55,
|
|
||||||
56,
|
|
||||||
57,
|
|
||||||
58,
|
|
||||||
59,
|
|
||||||
60,
|
|
||||||
61,
|
|
||||||
62,
|
|
||||||
63,
|
|
||||||
64,
|
|
||||||
65,
|
|
||||||
66,
|
|
||||||
67,
|
|
||||||
68,
|
|
||||||
69,
|
|
||||||
70,
|
|
||||||
71,
|
|
||||||
72,
|
|
||||||
73,
|
|
||||||
74,
|
|
||||||
75,
|
|
||||||
76,
|
|
||||||
77,
|
|
||||||
78,
|
|
||||||
79,
|
|
||||||
80
|
|
||||||
],
|
|
||||||
"blocks": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2,
|
|
||||||
3,
|
|
||||||
4,
|
|
||||||
5,
|
|
||||||
6,
|
|
||||||
7,
|
|
||||||
8
|
|
||||||
],
|
|
||||||
"constraints": [
|
|
||||||
0,
|
|
||||||
1,
|
|
||||||
2
|
|
||||||
]
|
|
||||||
}]
|
|
||||||
}
|
|
||||||
27
app/src/main/java/common/ConsumerSignal.java
Normal file
27
app/src/main/java/common/ConsumerSignal.java
Normal file
@@ -0,0 +1,27 @@
|
|||||||
|
package common;
|
||||||
|
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.Set;
|
||||||
|
import java.util.function.Consumer;
|
||||||
|
|
||||||
|
public class ConsumerSignal<T> {
|
||||||
|
private final Set<Consumer<T>> listeners;
|
||||||
|
|
||||||
|
public ConsumerSignal() {
|
||||||
|
this.listeners = new HashSet<>();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void connect(Consumer<T> listener) {
|
||||||
|
this.listeners.add(listener);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void clear() {
|
||||||
|
this.listeners.clear();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void emit(T arg) {
|
||||||
|
for (Consumer<T> listener : this.listeners) {
|
||||||
|
listener.accept(arg);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
@@ -1,6 +1,10 @@
|
|||||||
package game;
|
package game;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.Collections;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
@@ -8,15 +12,19 @@ import sudoku.structure.MultiDoku;
|
|||||||
public class Game {
|
public class Game {
|
||||||
|
|
||||||
public static enum GameState {
|
public static enum GameState {
|
||||||
GameNotStarted, GameGoing, GameEnd
|
GameNotStarted, GameGoing
|
||||||
}
|
}
|
||||||
|
|
||||||
private final Map<Integer, Player> players;
|
private final Map<Integer, Player> players;
|
||||||
|
private final List<Player> leaderboard;
|
||||||
private GameState gameState;
|
private GameState gameState;
|
||||||
private MultiDoku doku;
|
private MultiDoku doku;
|
||||||
|
private Instant startTime = null;
|
||||||
|
private long gameDuration;
|
||||||
|
|
||||||
public Game() {
|
public Game() {
|
||||||
this.players = new HashMap<>();
|
this.players = new HashMap<>();
|
||||||
|
this.leaderboard = new ArrayList<>();
|
||||||
this.gameState = GameState.GameNotStarted;
|
this.gameState = GameState.GameNotStarted;
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -26,19 +34,33 @@ public class Game {
|
|||||||
|
|
||||||
public void addPlayer(Player player) {
|
public void addPlayer(Player player) {
|
||||||
players.put(player.getId(), player);
|
players.put(player.getId(), player);
|
||||||
|
leaderboard.add(player);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setPlayerRemainingCells(Player player, int newScore) {
|
||||||
|
player.setRemainingCells(newScore);
|
||||||
|
Collections.sort(this.leaderboard,
|
||||||
|
(player1, player2) -> Integer.compare(player1.getRemainingCells(), player2.getRemainingCells()));
|
||||||
}
|
}
|
||||||
|
|
||||||
public void removePlayer(int id) {
|
public void removePlayer(int id) {
|
||||||
players.remove(id);
|
this.leaderboard.remove(getPlayerById(id));
|
||||||
|
this.players.remove(id);
|
||||||
}
|
}
|
||||||
|
|
||||||
public Map<Integer, Player> getPlayers() {
|
public Map<Integer, Player> getPlayers() {
|
||||||
return players;
|
return players;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startGame(MultiDoku doku) {
|
public void startGame(MultiDoku doku, Instant startTime, long gameDuration) {
|
||||||
this.doku = doku;
|
this.doku = doku;
|
||||||
this.gameState = GameState.GameGoing;
|
this.gameState = GameState.GameGoing;
|
||||||
|
this.startTime = startTime;
|
||||||
|
this.gameDuration = gameDuration;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopGame() {
|
||||||
|
this.gameState = GameState.GameNotStarted;
|
||||||
}
|
}
|
||||||
|
|
||||||
public GameState getGameState() {
|
public GameState getGameState() {
|
||||||
@@ -49,4 +71,16 @@ public class Game {
|
|||||||
return doku;
|
return doku;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public List<Player> getLeaderboard() {
|
||||||
|
return leaderboard;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Instant getStartTime() {
|
||||||
|
return startTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getGameDuration() {
|
||||||
|
return gameDuration;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -8,10 +8,20 @@ public class Player implements Serializable {
|
|||||||
|
|
||||||
private final String pseudo;
|
private final String pseudo;
|
||||||
private final int id;
|
private final int id;
|
||||||
|
private int score;
|
||||||
|
|
||||||
public Player(int id, String pseudo) {
|
public Player(int id, String pseudo) {
|
||||||
this.pseudo = pseudo;
|
this.pseudo = pseudo;
|
||||||
this.id = id;
|
this.id = id;
|
||||||
|
this.score = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getRemainingCells() {
|
||||||
|
return score;
|
||||||
|
}
|
||||||
|
|
||||||
|
void setRemainingCells(int score) {
|
||||||
|
this.score = score;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getPseudo() {
|
public String getPseudo() {
|
||||||
|
|||||||
32
app/src/main/java/gui/AssetManager.java
Normal file
32
app/src/main/java/gui/AssetManager.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package gui;
|
||||||
|
|
||||||
|
import java.io.File;
|
||||||
|
import java.io.FileInputStream;
|
||||||
|
import java.io.IOException;
|
||||||
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
public class AssetManager {
|
||||||
|
|
||||||
|
public static byte[] getResource(String name) {
|
||||||
|
// we first search it in files
|
||||||
|
File f = new File(name);
|
||||||
|
if (f.exists()){
|
||||||
|
FileInputStream fis;
|
||||||
|
try {
|
||||||
|
fis = new FileInputStream(f);
|
||||||
|
return fis.readAllBytes();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
// then in the jar
|
||||||
|
InputStream is = ClassLoader.getSystemResourceAsStream(name);
|
||||||
|
try {
|
||||||
|
return is.readAllBytes();
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,8 +1,9 @@
|
|||||||
package gui;
|
package gui;
|
||||||
|
|
||||||
|
import gui.constants.Fonts;
|
||||||
|
import gui.constants.Images;
|
||||||
import gui.menu.MainMenu;
|
import gui.menu.MainMenu;
|
||||||
import gui.menu.StateMachine;
|
import gui.menu.StateMachine;
|
||||||
import imgui.ImGui;
|
|
||||||
import imgui.app.Application;
|
import imgui.app.Application;
|
||||||
import imgui.app.Configuration;
|
import imgui.app.Configuration;
|
||||||
|
|
||||||
@@ -30,7 +31,7 @@ public class Main extends Application {
|
|||||||
@Override
|
@Override
|
||||||
protected void preRun() {
|
protected void preRun() {
|
||||||
super.preRun();
|
super.preRun();
|
||||||
Images.loadImages();
|
Images.reloadImages();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
package gui;
|
|
||||||
|
|
||||||
public class Options {
|
|
||||||
|
|
||||||
public static Symbols Symboles = Symbols.Numbers;
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -47,8 +47,6 @@ public class RenderableMultidoku {
|
|||||||
return cells.get(index);
|
return cells.get(index);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
private static record PositionConstraint(Sudoku sudoku1, Sudoku sudoku2, Coordinate offset) {
|
private static record PositionConstraint(Sudoku sudoku1, Sudoku sudoku2, Coordinate offset) {
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -92,29 +90,23 @@ public class RenderableMultidoku {
|
|||||||
}
|
}
|
||||||
|
|
||||||
private static Coordinate getMaxSudokuCoordinate(Map<Sudoku, Coordinate> sudokusOffset) {
|
private static Coordinate getMaxSudokuCoordinate(Map<Sudoku, Coordinate> sudokusOffset) {
|
||||||
Coordinate maxCoordinate = null;
|
int maxX = 0;
|
||||||
Sudoku maxSudoku = null;
|
int maxY = 0;
|
||||||
float maxDistanceSquared = 0;
|
Sudoku lastSudoku = null;
|
||||||
for (var entry : sudokusOffset.entrySet()) {
|
for (var entry : sudokusOffset.entrySet()) {
|
||||||
Coordinate coordinate = entry.getValue();
|
Coordinate coordinate = entry.getValue();
|
||||||
float distanceSquared = coordinate.getX() * coordinate.getX() + coordinate.getY() * coordinate.getY();
|
if (coordinate.getX() > maxX)
|
||||||
if (maxCoordinate == null) {
|
maxX = coordinate.getX();
|
||||||
maxCoordinate = coordinate;
|
if (coordinate.getY() > maxY)
|
||||||
maxDistanceSquared = distanceSquared;
|
maxY = coordinate.getY();
|
||||||
maxSudoku = entry.getKey();
|
lastSudoku = entry.getKey();
|
||||||
}
|
}
|
||||||
|
|
||||||
if (distanceSquared > maxDistanceSquared) {
|
Coordinate maxCoordinate = new Coordinate(maxX, maxY);
|
||||||
maxDistanceSquared = distanceSquared;
|
// tous les sudokus sont censés faire la même taille
|
||||||
maxSudoku = entry.getKey();
|
int sudokuSize = lastSudoku.getSize();
|
||||||
maxCoordinate = coordinate;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
int blockWidth = maxSudoku.getBlockWidth();
|
return new Coordinate(maxCoordinate.getX() + sudokuSize, maxCoordinate.getY() + sudokuSize);
|
||||||
int blockHeight = maxSudoku.getSize() / blockWidth;
|
|
||||||
|
|
||||||
return new Coordinate(maxCoordinate.getX() + maxSudoku.getSize(), maxCoordinate.getY() + maxSudoku.getSize());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public static RenderableMultidoku fromMultidoku(MultiDoku doku) {
|
public static RenderableMultidoku fromMultidoku(MultiDoku doku) {
|
||||||
|
|||||||
@@ -1,5 +1,6 @@
|
|||||||
package gui;
|
package gui.constants;
|
||||||
|
|
||||||
|
import gui.AssetManager;
|
||||||
import imgui.ImFont;
|
import imgui.ImFont;
|
||||||
import imgui.ImFontConfig;
|
import imgui.ImFontConfig;
|
||||||
import imgui.ImFontGlyphRangesBuilder;
|
import imgui.ImFontGlyphRangesBuilder;
|
||||||
@@ -14,21 +15,19 @@ public class Fonts {
|
|||||||
public static ImFont INFECTED;
|
public static ImFont INFECTED;
|
||||||
public static ImFont EMOJIS;
|
public static ImFont EMOJIS;
|
||||||
|
|
||||||
private static final String baseDir = "";
|
|
||||||
|
|
||||||
public static void createFonts() {
|
public static void createFonts() {
|
||||||
ImFontGlyphRangesBuilder builder = new ImFontGlyphRangesBuilder();
|
ImFontGlyphRangesBuilder builder = new ImFontGlyphRangesBuilder();
|
||||||
builder.addRanges(ImGui.getIO().getFonts().getGlyphRangesDefault());
|
builder.addRanges(ImGui.getIO().getFonts().getGlyphRangesDefault());
|
||||||
builder.addRanges(ImGui.getIO().getFonts().getGlyphRangesCyrillic());
|
builder.addRanges(ImGui.getIO().getFonts().getGlyphRangesCyrillic());
|
||||||
// builder.addRanges(ImGui.getIO().getFonts().getGlyphRangesChineseFull());
|
|
||||||
ImFontConfig cfg = new ImFontConfig();
|
ImFontConfig cfg = new ImFontConfig();
|
||||||
cfg.setGlyphRanges(builder.buildRanges());
|
cfg.setGlyphRanges(builder.buildRanges());
|
||||||
|
|
||||||
COMIC = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "comic.ttf", 50.0f);
|
COMIC = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("comic.ttf"), 50.0f);
|
||||||
ARIAL_BOLD = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "arial_bold.ttf", 50.0f);
|
ARIAL_BOLD = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("arial_bold.ttf"), 50.0f);
|
||||||
ARIAL = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "arial.ttf", 50.0f, cfg);
|
ARIAL = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("arial.ttf"), 50.0f, cfg);
|
||||||
CHERI = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "cheri.ttf", 50.0f);
|
CHERI = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("cheri.ttf"), 50.0f);
|
||||||
INFECTED = ImGui.getIO().getFonts().addFontFromFileTTF(baseDir + "INFECTED.ttf", 50.0f);
|
INFECTED = ImGui.getIO().getFonts().addFontFromMemoryTTF(AssetManager.getResource("INFECTED.ttf"), 50.0f);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
@@ -1,20 +1,25 @@
|
|||||||
package gui;
|
package gui.constants;
|
||||||
|
|
||||||
import java.nio.ByteBuffer;
|
import java.nio.ByteBuffer;
|
||||||
|
|
||||||
import org.lwjgl.opengl.GL11;
|
import org.lwjgl.opengl.GL11;
|
||||||
import org.lwjgl.stb.STBImage;
|
import org.lwjgl.stb.STBImage;
|
||||||
|
|
||||||
|
import gui.AssetManager;
|
||||||
|
|
||||||
public class Images {
|
public class Images {
|
||||||
|
|
||||||
public static int BACKGROUND;
|
public static int BACKGROUND;
|
||||||
|
|
||||||
private static int loadTexture(String fileName) {
|
private static int loadTexture(byte[] imageData) {
|
||||||
int[] width = new int[1];
|
int[] width = new int[1];
|
||||||
int[] height = new int[1];
|
int[] height = new int[1];
|
||||||
int[] channelCount = new int[1];
|
int[] channelCount = new int[1];
|
||||||
|
|
||||||
ByteBuffer pixels = STBImage.stbi_load(fileName, width, height, channelCount, 4);
|
ByteBuffer img = ByteBuffer.allocateDirect(imageData.length);
|
||||||
|
img.put(imageData);
|
||||||
|
img.flip();
|
||||||
|
ByteBuffer pixels = STBImage.stbi_load_from_memory(img, width, height, channelCount, 4);
|
||||||
|
|
||||||
int textureID = GL11.glGenTextures();
|
int textureID = GL11.glGenTextures();
|
||||||
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
|
GL11.glBindTexture(GL11.GL_TEXTURE_2D, textureID);
|
||||||
@@ -32,8 +37,8 @@ public class Images {
|
|||||||
return textureID;
|
return textureID;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void loadImages() {
|
public static void reloadImages() {
|
||||||
BACKGROUND = loadTexture("background.png");
|
BACKGROUND = loadTexture(AssetManager.getResource(Options.BackgroundPath));
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
9
app/src/main/java/gui/constants/Options.java
Normal file
9
app/src/main/java/gui/constants/Options.java
Normal file
@@ -0,0 +1,9 @@
|
|||||||
|
package gui.constants;
|
||||||
|
|
||||||
|
public class Options {
|
||||||
|
|
||||||
|
public static Symbols Symboles = Symbols.Numbers;
|
||||||
|
public static float BackgroundSpeed = 1.0f;
|
||||||
|
public static String BackgroundPath = "background.png";
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,8 +1,8 @@
|
|||||||
package gui;
|
package gui.constants;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import sudoku.constraint.Constraint;
|
import sudoku.constraint.IConstraint;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.SudokuFactory;;
|
import sudoku.structure.SudokuFactory;;
|
||||||
|
|
||||||
@@ -14,9 +14,13 @@ public enum SudokuType {
|
|||||||
(constraints, params) -> SudokuFactory.createBasicEmptyRectangleDoku(params[0], params[1], constraints)),
|
(constraints, params) -> SudokuFactory.createBasicEmptyRectangleDoku(params[0], params[1], constraints)),
|
||||||
RandomBloc("Blocs aléatoires", 1,
|
RandomBloc("Blocs aléatoires", 1,
|
||||||
(constraints, params) -> SudokuFactory.createBasicEmptyRandomBlockDoku(params[0], constraints)),
|
(constraints, params) -> SudokuFactory.createBasicEmptyRandomBlockDoku(params[0], constraints)),
|
||||||
MultiDokuSquare("Multidoku carré (X)", 1,
|
MultiDokuXSquare("Multidoku carré (X)", 1,
|
||||||
(constraints, params) -> SudokuFactory.createBasicXShapedMultidoku(params[0], constraints)),
|
(constraints, params) -> SudokuFactory.createBasicXShapedMultidoku(params[0], constraints)),
|
||||||
MultidokuRectangle("Multidoku rectangle (X)", 2,
|
MultidokuXRectangle("Multidoku rectangle (X)", 2,
|
||||||
|
(constraints, params) -> SudokuFactory.createBasicXShapedMultidoku(params[0], params[1], constraints)),
|
||||||
|
MultiDokuPlusSquare("Multidoku carré (+)", 1,
|
||||||
|
(constraints, params) -> SudokuFactory.createBasicPlusShapedMultidoku(params[0], constraints)),
|
||||||
|
MultidokuPlusRectangle("Multidoku rectangle (+)", 2,
|
||||||
(constraints, params) -> SudokuFactory.createBasicXShapedMultidoku(params[0], params[1], constraints));
|
(constraints, params) -> SudokuFactory.createBasicXShapedMultidoku(params[0], params[1], constraints));
|
||||||
|
|
||||||
String displayName;
|
String displayName;
|
||||||
@@ -33,7 +37,7 @@ public enum SudokuType {
|
|||||||
return this.displayName;
|
return this.displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public MultiDoku createDoku(List<Constraint> constraints, int... params) {
|
public MultiDoku createDoku(List<IConstraint> constraints, int... params) {
|
||||||
return maker.makeSudoku(constraints, params);
|
return maker.makeSudoku(constraints, params);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -43,7 +47,7 @@ public enum SudokuType {
|
|||||||
|
|
||||||
@FunctionalInterface
|
@FunctionalInterface
|
||||||
private static interface SudokuMaker {
|
private static interface SudokuMaker {
|
||||||
MultiDoku makeSudoku(List<Constraint> constraints, int... params);
|
MultiDoku makeSudoku(List<IConstraint> constraints, int... params);
|
||||||
}
|
}
|
||||||
|
|
||||||
private static final String[] dokuNames;
|
private static final String[] dokuNames;
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package gui;
|
package gui.constants;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
@@ -14,12 +14,12 @@ public class ConnexionStatusView extends BaseView {
|
|||||||
|
|
||||||
private String displayText = "Connecting ...";
|
private String displayText = "Connecting ...";
|
||||||
|
|
||||||
public ConnexionStatusView(StateMachine stateMachine, String address, short port)
|
public ConnexionStatusView(StateMachine stateMachine, String pseudo, String address, short port)
|
||||||
throws UnknownHostException, IOException {
|
throws UnknownHostException, IOException {
|
||||||
super(stateMachine);
|
super(stateMachine);
|
||||||
Thread t = new Thread(() -> {
|
Thread t = new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
this.client = new Client(address, port);
|
this.client = new Client(pseudo, address, port);
|
||||||
bindListeners();
|
bindListeners();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
@@ -29,12 +29,13 @@ public class ConnexionStatusView extends BaseView {
|
|||||||
t.start();
|
t.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public ConnexionStatusView(StateMachine stateMachine, short port) throws UnknownHostException, IOException {
|
public ConnexionStatusView(StateMachine stateMachine, String pseudo, short port)
|
||||||
|
throws UnknownHostException, IOException {
|
||||||
super(stateMachine);
|
super(stateMachine);
|
||||||
Thread t = new Thread(() -> {
|
Thread t = new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
this.server = new Server(port);
|
this.server = new Server(port);
|
||||||
this.client = new Client("localhost", port);
|
this.client = new Client(pseudo, "localhost", port);
|
||||||
bindListeners();
|
bindListeners();
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
49
app/src/main/java/gui/menu/EndGameView.java
Normal file
49
app/src/main/java/gui/menu/EndGameView.java
Normal file
@@ -0,0 +1,49 @@
|
|||||||
|
package gui.menu;
|
||||||
|
|
||||||
|
import game.Player;
|
||||||
|
import gui.ColorGenerator;
|
||||||
|
import gui.widget.SudokuRenderer;
|
||||||
|
import imgui.ImGui;
|
||||||
|
import imgui.ImVec4;
|
||||||
|
import sudoku.structure.MultiDoku;
|
||||||
|
|
||||||
|
public class EndGameView extends BaseView {
|
||||||
|
|
||||||
|
private final Player winner;
|
||||||
|
private float time = 0;
|
||||||
|
|
||||||
|
private static final ImVec4 YELLOW = new ImVec4(1, 1, 0, 1);
|
||||||
|
|
||||||
|
private final SudokuRenderer sudokuRenderer;
|
||||||
|
|
||||||
|
public EndGameView(StateMachine stateMachine, MultiDoku resolved, Player winner) {
|
||||||
|
super(stateMachine);
|
||||||
|
this.winner = winner;
|
||||||
|
this.sudokuRenderer = new SudokuRenderer(resolved);
|
||||||
|
}
|
||||||
|
|
||||||
|
private ImVec4 getPseudoColor() {
|
||||||
|
time += ImGui.getIO().getDeltaTime();
|
||||||
|
float factor = (float) Math.cos(time);
|
||||||
|
var color = ColorGenerator.hslToRgb(factor * factor, 0.9f, 0.4f);
|
||||||
|
return new ImVec4(color.r, color.g, color.b, 1.0f);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderWinText() {
|
||||||
|
String winText = " a gagné !";
|
||||||
|
String text = winner.getPseudo() + winText;
|
||||||
|
float textWidth = ImGui.calcTextSizeX(text);
|
||||||
|
ImGui.setCursorPosX(ImGui.getIO().getDisplaySizeX() / 2.0f - textWidth / 2.0f);
|
||||||
|
ImGui.textColored(getPseudoColor(), winner.getPseudo());
|
||||||
|
ImGui.sameLine();
|
||||||
|
ImGui.textColored(YELLOW, winText);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render() {
|
||||||
|
renderWinText();
|
||||||
|
this.sudokuRenderer.render();
|
||||||
|
renderReturnButton();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,6 +1,7 @@
|
|||||||
package gui.menu;
|
package gui.menu;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
import imgui.ImVec2;
|
import imgui.ImVec2;
|
||||||
@@ -11,6 +12,7 @@ public class MultiMenu extends BaseView {
|
|||||||
|
|
||||||
private final ImInt port = new ImInt(25565);
|
private final ImInt port = new ImInt(25565);
|
||||||
private final ImString address = new ImString("localhost");
|
private final ImString address = new ImString("localhost");
|
||||||
|
private final ImString pseudo = new ImString("Joueur" + new Random().nextInt());
|
||||||
|
|
||||||
public MultiMenu(StateMachine stateMachine) {
|
public MultiMenu(StateMachine stateMachine) {
|
||||||
super(stateMachine);
|
super(stateMachine);
|
||||||
@@ -20,10 +22,12 @@ public class MultiMenu extends BaseView {
|
|||||||
private void renderCreate() {
|
private void renderCreate() {
|
||||||
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
||||||
ImGui.beginChild("##CreateGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
ImGui.beginChild("##CreateGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
||||||
ImGui.inputInt("Port", port);
|
if (ImGui.inputInt("Port", port))
|
||||||
|
port.set(Math.clamp(port.get(), 1, 65535));
|
||||||
|
ImGui.inputText("Pseudo", pseudo);
|
||||||
if (ImGui.button("Créer")) {
|
if (ImGui.button("Créer")) {
|
||||||
try {
|
try {
|
||||||
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, (short) port.get()));
|
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, pseudo.get(), (short) port.get()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -35,12 +39,13 @@ public class MultiMenu extends BaseView {
|
|||||||
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
ImVec2 displaySize = ImGui.getIO().getDisplaySize();
|
||||||
ImGui.beginChild("##JoinGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
ImGui.beginChild("##JoinGame", new ImVec2(displaySize.x / 2.0f, displaySize.y * 8.0f / 9.0f));
|
||||||
ImGui.inputText("Adresse", address);
|
ImGui.inputText("Adresse", address);
|
||||||
ImGui.inputInt("Port", port);
|
if (ImGui.inputInt("Port", port))
|
||||||
|
port.set(Math.clamp(port.get(), 1, 65535));
|
||||||
|
ImGui.inputText("Pseudo", pseudo);
|
||||||
if (ImGui.button("Rejoindre")) {
|
if (ImGui.button("Rejoindre")) {
|
||||||
try {
|
try {
|
||||||
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, address.get(), (short) port.get()));
|
this.stateMachine.pushState(new ConnexionStatusView(stateMachine, pseudo.get(), address.get(), (short) port.get()));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
// TODO Auto-generated catch block
|
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,22 +1,50 @@
|
|||||||
package gui.menu;
|
package gui.menu;
|
||||||
|
|
||||||
import gui.SudokuRenderer;
|
import game.Player;
|
||||||
|
import gui.widget.LeaderboardRenderer;
|
||||||
|
import gui.widget.MultiPlayerCompleteProgress;
|
||||||
|
import gui.widget.SudokuRenderer;
|
||||||
|
import gui.widget.TimerRenderer;
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
import network.client.Client;
|
import network.client.Client;
|
||||||
import network.server.Server;
|
import network.server.Server;
|
||||||
|
import sudoku.solver.BacktrackingSolver;
|
||||||
|
import sudoku.solver.Solver;
|
||||||
|
import sudoku.structure.Cell;
|
||||||
|
import sudoku.structure.MultiDoku;
|
||||||
|
|
||||||
public class MultiPlayerDokuView extends BaseView {
|
public class MultiPlayerDokuView extends BaseView {
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final Server server;
|
private final Server server;
|
||||||
private final SudokuRenderer sudokuRenderer;
|
private final SudokuRenderer sudokuRenderer;
|
||||||
|
private final LeaderboardRenderer leaderboardRenderer;
|
||||||
|
private final TimerRenderer timerRenderer;
|
||||||
|
private final MultiPlayerCompleteProgress completeProgress;
|
||||||
|
|
||||||
public MultiPlayerDokuView(StateMachine stateMachine, Client client, Server server) {
|
public MultiPlayerDokuView(StateMachine stateMachine, Client client, Server server) {
|
||||||
super(stateMachine);
|
super(stateMachine);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.server = server;
|
this.server = server;
|
||||||
this.sudokuRenderer = new SudokuRenderer(this.client.getGame().getDoku());
|
this.sudokuRenderer = new SudokuRenderer(this.client.getGame().getDoku());
|
||||||
|
this.leaderboardRenderer = new LeaderboardRenderer(client.getGame(), client.getPlayer());
|
||||||
|
this.sudokuRenderer.onCellChange.connect(this::onCellChange);
|
||||||
this.client.onDisconnect.connect(this::onDisconnect);
|
this.client.onDisconnect.connect(this::onDisconnect);
|
||||||
|
this.client.onGameEnd.connect(this::onGameEnd);
|
||||||
|
this.timerRenderer = new TimerRenderer(this.client.getGame().getStartTime(), this.client.getGame().getGameDuration());
|
||||||
|
this.completeProgress = new MultiPlayerCompleteProgress(this.client.getGame());
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onGameEnd(Player winner) {
|
||||||
|
MultiDoku doku = this.client.getGame().getDoku();
|
||||||
|
doku.clearMutableCells();
|
||||||
|
Solver solver = new BacktrackingSolver();
|
||||||
|
solver.solve(doku);
|
||||||
|
this.stateMachine.overrideState(new EndGameView(stateMachine, doku, winner));
|
||||||
|
}
|
||||||
|
|
||||||
|
private void onCellChange(Cell cell) {
|
||||||
|
this.client.sendCellChange(cell);
|
||||||
}
|
}
|
||||||
|
|
||||||
public void onDisconnect() {
|
public void onDisconnect() {
|
||||||
@@ -27,6 +55,9 @@ public class MultiPlayerDokuView extends BaseView{
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
|
this.timerRenderer.render();
|
||||||
|
this.leaderboardRenderer.render();
|
||||||
|
this.completeProgress.render();
|
||||||
this.sudokuRenderer.render();
|
this.sudokuRenderer.render();
|
||||||
if (ImGui.button("Quitter")) {
|
if (ImGui.button("Quitter")) {
|
||||||
this.client.stop();
|
this.client.stop();
|
||||||
|
|||||||
@@ -1,24 +1,30 @@
|
|||||||
package gui.menu;
|
package gui.menu;
|
||||||
|
|
||||||
import java.util.Arrays;
|
|
||||||
|
|
||||||
import game.Player;
|
import game.Player;
|
||||||
|
import gui.widget.SudokuSelector;
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
|
import imgui.type.ImInt;
|
||||||
import network.client.Client;
|
import network.client.Client;
|
||||||
import network.server.Server;
|
import network.server.Server;
|
||||||
import sudoku.constraint.Constraint;
|
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.SudokuFactory;
|
|
||||||
|
|
||||||
public class MultiPlayerView extends BaseView {
|
public class MultiPlayerView extends BaseView {
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private final Server server;
|
private final Server server;
|
||||||
|
|
||||||
|
private final SudokuSelector selector;
|
||||||
|
|
||||||
|
private ImInt gameDurationMinutes = new ImInt(10);
|
||||||
|
|
||||||
|
private MultiDoku doku = null;
|
||||||
|
|
||||||
public MultiPlayerView(StateMachine stateMachine, Client client, Server server) {
|
public MultiPlayerView(StateMachine stateMachine, Client client, Server server) {
|
||||||
super(stateMachine);
|
super(stateMachine);
|
||||||
this.client = client;
|
this.client = client;
|
||||||
this.server = server;
|
this.server = server;
|
||||||
|
this.selector = new SudokuSelector(false, "Sélectionner le sudoku");
|
||||||
|
this.selector.onSelect.connect(this::onSelected);
|
||||||
this.client.onDisconnect.connect(this::onDisconnect);
|
this.client.onDisconnect.connect(this::onDisconnect);
|
||||||
this.client.onGameStarted
|
this.client.onGameStarted
|
||||||
.connect(() -> this.stateMachine.pushState(new MultiPlayerDokuView(stateMachine, client, server)));
|
.connect(() -> this.stateMachine.pushState(new MultiPlayerDokuView(stateMachine, client, server)));
|
||||||
@@ -34,27 +40,47 @@ public class MultiPlayerView extends BaseView {
|
|||||||
this.stateMachine.popState();
|
this.stateMachine.popState();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void onSelected(MultiDoku doku) {
|
||||||
|
this.doku = doku;
|
||||||
|
}
|
||||||
|
|
||||||
public void renderGameStatus() {
|
public void renderGameStatus() {
|
||||||
if (this.server == null) {
|
if (this.server == null) {
|
||||||
ImGui.text("En attente de l'administrateur du serveur ...");
|
ImGui.text("En attente de l'administrateur du serveur ...");
|
||||||
} else {
|
} else {
|
||||||
|
renderTimer();
|
||||||
|
ImGui.beginDisabled(this.doku == null);
|
||||||
if (ImGui.button("Démarrer")) {
|
if (ImGui.button("Démarrer")) {
|
||||||
// temp
|
this.server.startGame(this.doku, this.gameDurationMinutes.get() * 60);
|
||||||
MultiDoku doku = SudokuFactory.createBasicXShapedMultidoku(3, Arrays.asList(Constraint.Diagonal));
|
|
||||||
this.server.startGame(doku);
|
|
||||||
}
|
}
|
||||||
|
ImGui.endDisabled();
|
||||||
|
selector.render();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
private void renderPlayers() {
|
||||||
public void render() {
|
|
||||||
ImGui.text("Joueurs :");
|
ImGui.text("Joueurs :");
|
||||||
{
|
{
|
||||||
for (Player player : this.client.getGame().getPlayers().values()) {
|
for (Player player : this.client.getGame().getPlayers().values()) {
|
||||||
ImGui.bulletText(player.getPseudo());
|
ImGui.bulletText(player.getPseudo());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderTimer() {
|
||||||
|
if (ImGui.inputInt("Temps de la partie (minutes)", gameDurationMinutes))
|
||||||
|
gameDurationMinutes.set(Math.clamp(gameDurationMinutes.get(), 1, 90));
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void render() {
|
||||||
|
renderPlayers();
|
||||||
renderGameStatus();
|
renderGameStatus();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanResources() {
|
||||||
|
this.selector.clean();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,24 +1,56 @@
|
|||||||
package gui.menu;
|
package gui.menu;
|
||||||
|
|
||||||
import gui.Options;
|
import gui.constants.Images;
|
||||||
import gui.Symbols;
|
import gui.constants.Options;
|
||||||
|
import gui.constants.Symbols;
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
|
import imgui.extension.imguifiledialog.ImGuiFileDialog;
|
||||||
|
import imgui.extension.imguifiledialog.flag.ImGuiFileDialogFlags;
|
||||||
import imgui.type.ImInt;
|
import imgui.type.ImInt;
|
||||||
|
|
||||||
public class OptionsMenu extends BaseView {
|
public class OptionsMenu extends BaseView {
|
||||||
|
|
||||||
private ImInt currentValue = new ImInt();
|
private ImInt currentValue = new ImInt();
|
||||||
|
private float backgroundSpeed[] = new float[] { Options.BackgroundSpeed };
|
||||||
|
|
||||||
public OptionsMenu(StateMachine stateMachine) {
|
public OptionsMenu(StateMachine stateMachine) {
|
||||||
super(stateMachine);
|
super(stateMachine);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void renderImageSelectDialog() {
|
||||||
|
if (ImGuiFileDialog.display("browse-img", ImGuiFileDialogFlags.None)) {
|
||||||
|
if (ImGuiFileDialog.isOk()) {
|
||||||
|
var selection = ImGuiFileDialog.getSelection();
|
||||||
|
for (var entry : selection.entrySet()) {
|
||||||
|
try {
|
||||||
|
String filePath = entry.getValue();
|
||||||
|
Options.BackgroundPath = filePath;
|
||||||
|
Images.reloadImages();
|
||||||
|
} catch (Exception e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
ImGuiFileDialog.close();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderImageSelectButton() {
|
||||||
|
if (ImGui.button("Changer de fond d'écran"))
|
||||||
|
ImGuiFileDialog.openDialog("browse-img", "Choisissez un fichier", ".png,.jpg,.jpeg", ".");
|
||||||
|
renderImageSelectDialog();
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
ImGui.text("Options");
|
ImGui.text("Options");
|
||||||
if (ImGui.combo("Jeu de symboles", currentValue, Symbols.getSymbolsNames())) {
|
if (ImGui.combo("Jeu de symboles", currentValue, Symbols.getSymbolsNames())) {
|
||||||
Options.Symboles = Symbols.values()[currentValue.get()];
|
Options.Symboles = Symbols.values()[currentValue.get()];
|
||||||
}
|
}
|
||||||
|
if (ImGui.sliderFloat("Vitesse d'animation de l'arrière plan", backgroundSpeed, 0.0f, 10.0f)) {
|
||||||
|
Options.BackgroundSpeed = backgroundSpeed[0];
|
||||||
|
}
|
||||||
|
renderImageSelectButton();
|
||||||
renderReturnButton();
|
renderReturnButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -1,7 +1,8 @@
|
|||||||
package gui.menu;
|
package gui.menu;
|
||||||
|
|
||||||
import gui.SudokuSelector;
|
import gui.widget.SudokuSelector;
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
|
import sudoku.structure.MultiDoku;
|
||||||
|
|
||||||
public class SoloMenu extends BaseView {
|
public class SoloMenu extends BaseView {
|
||||||
|
|
||||||
@@ -9,12 +10,12 @@ public class SoloMenu extends BaseView {
|
|||||||
|
|
||||||
public SoloMenu(StateMachine stateMachine) {
|
public SoloMenu(StateMachine stateMachine) {
|
||||||
super(stateMachine);
|
super(stateMachine);
|
||||||
this.sudokuSelector = new SudokuSelector(true);
|
this.sudokuSelector = new SudokuSelector(true, "Résoudre le sudoku");
|
||||||
this.sudokuSelector.onSelect.connect(this::pushSudokuState);
|
this.sudokuSelector.onSelect.connect(this::pushSudokuState);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pushSudokuState() {
|
private void pushSudokuState(MultiDoku doku) {
|
||||||
this.stateMachine.pushState(new SudokuView(stateMachine, this.sudokuSelector.getDoku()));
|
this.stateMachine.pushState(new SudokuView(stateMachine, doku));
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
@@ -24,4 +25,9 @@ public class SoloMenu extends BaseView {
|
|||||||
renderReturnButton();
|
renderReturnButton();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void cleanResources() {
|
||||||
|
this.sudokuSelector.clean();
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,7 +2,7 @@ package gui.menu;
|
|||||||
|
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
import gui.Images;
|
import gui.widget.AnimatedBackground;
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
import imgui.ImVec2;
|
import imgui.ImVec2;
|
||||||
import imgui.flag.ImGuiKey;
|
import imgui.flag.ImGuiKey;
|
||||||
@@ -11,9 +11,11 @@ import imgui.flag.ImGuiWindowFlags;
|
|||||||
public class StateMachine {
|
public class StateMachine {
|
||||||
|
|
||||||
private final Stack<BaseView> menus;
|
private final Stack<BaseView> menus;
|
||||||
|
private final AnimatedBackground background;
|
||||||
|
|
||||||
public StateMachine() {
|
public StateMachine() {
|
||||||
this.menus = new Stack<>();
|
this.menus = new Stack<>();
|
||||||
|
this.background = new AnimatedBackground();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void clear() {
|
public void clear() {
|
||||||
@@ -27,6 +29,11 @@ public class StateMachine {
|
|||||||
menus.add(menu);
|
menus.add(menu);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void overrideState(BaseView menu) {
|
||||||
|
menus.getLast().cleanResources();
|
||||||
|
menus.set(menus.size() - 1, menu);
|
||||||
|
}
|
||||||
|
|
||||||
public void popState() {
|
public void popState() {
|
||||||
menus.getLast().cleanResources();
|
menus.getLast().cleanResources();
|
||||||
menus.pop();
|
menus.pop();
|
||||||
@@ -40,12 +47,7 @@ public class StateMachine {
|
|||||||
|
|
||||||
public void render() {
|
public void render() {
|
||||||
var displaySize = ImGui.getIO().getDisplaySize();
|
var displaySize = ImGui.getIO().getDisplaySize();
|
||||||
ImGui.setNextWindowPos(new ImVec2(0.0f, 0.0f));
|
this.background.render();
|
||||||
ImGui.setNextWindowSize(displaySize);
|
|
||||||
ImGui.begin("Background", null, ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoMove
|
|
||||||
| ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoBackground | ImGuiWindowFlags.NoBringToFrontOnFocus | ImGuiWindowFlags.NoInputs);
|
|
||||||
ImGui.image(Images.BACKGROUND, displaySize, new ImVec2(0, 0));
|
|
||||||
ImGui.end();
|
|
||||||
ImGui.setNextWindowPos(new ImVec2(0.0f, 0.0f));
|
ImGui.setNextWindowPos(new ImVec2(0.0f, 0.0f));
|
||||||
ImGui.setNextWindowSize(displaySize);
|
ImGui.setNextWindowSize(displaySize);
|
||||||
ImGui.begin("##Main Window", null, ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoMove
|
ImGui.begin("##Main Window", null, ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoMove
|
||||||
|
|||||||
@@ -1,15 +1,20 @@
|
|||||||
package gui.menu;
|
package gui.menu;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.CancellationException;
|
import java.util.concurrent.CancellationException;
|
||||||
|
|
||||||
import gui.SudokuRenderer;
|
import gui.widget.SudokuRenderer;
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
import imgui.ImGuiStyle;
|
import imgui.ImGuiStyle;
|
||||||
import sudoku.io.SudokuSerializer;
|
import sudoku.io.SudokuSerializer;
|
||||||
import sudoku.solver.BacktrackingSolver;
|
import sudoku.solver.BacktrackingSolver;
|
||||||
|
import sudoku.solver.HintHelper;
|
||||||
import sudoku.solver.HumanSolver;
|
import sudoku.solver.HumanSolver;
|
||||||
import sudoku.solver.MixedSolver;
|
import sudoku.solver.MixedSolver;
|
||||||
import sudoku.solver.Solver;
|
import sudoku.solver.Solver;
|
||||||
|
import sudoku.solver.SolverStep;
|
||||||
|
import sudoku.solver.HintHelper.Hint;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
|
|
||||||
public class SudokuView extends BaseView {
|
public class SudokuView extends BaseView {
|
||||||
@@ -20,6 +25,8 @@ public class SudokuView extends BaseView {
|
|||||||
private String lastSavePath = null;
|
private String lastSavePath = null;
|
||||||
|
|
||||||
private boolean resolved = false;
|
private boolean resolved = false;
|
||||||
|
// if the solver can't solve
|
||||||
|
private volatile boolean unresolved = false;
|
||||||
|
|
||||||
public SudokuView(StateMachine stateMachine, MultiDoku doku) {
|
public SudokuView(StateMachine stateMachine, MultiDoku doku) {
|
||||||
super(stateMachine);
|
super(stateMachine);
|
||||||
@@ -68,10 +75,28 @@ public class SudokuView extends BaseView {
|
|||||||
stopResolve();
|
stopResolve();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void renderHintButton() {
|
||||||
|
if (!this.resolved && centeredButton("Indice")) {
|
||||||
|
Hint hint = HintHelper.getHint(this.doku, new BacktrackingSolver());
|
||||||
|
assert (hint != null);
|
||||||
|
hint.cell().setSymbolIndex(hint.newValue());
|
||||||
|
if (this.doku.isSolved())
|
||||||
|
this.sudokuRenderer.onResolve.emit();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderUnsolvableText() {
|
||||||
|
if (this.unresolved)
|
||||||
|
ImGui.text("Impossible de résoudre avec l'algorithme actuel !");
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
private void startSolve(Solver solver) {
|
private void startSolve(Solver solver) {
|
||||||
|
this.doku.clearMutableCells();
|
||||||
resolveThread = new Thread(() -> {
|
resolveThread = new Thread(() -> {
|
||||||
|
List<SolverStep> steps = new ArrayList<>();
|
||||||
try {
|
try {
|
||||||
solver.solve(this.doku);
|
unresolved = !solver.solve(this.doku, steps);
|
||||||
} catch (CancellationException e) {
|
} catch (CancellationException e) {
|
||||||
System.out.println("The user is bored !");
|
System.out.println("The user is bored !");
|
||||||
}
|
}
|
||||||
@@ -79,6 +104,11 @@ public class SudokuView extends BaseView {
|
|||||||
});
|
});
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void renderResolvedText() {
|
||||||
|
if (this.resolved)
|
||||||
|
ImGui.text("Bravo !");
|
||||||
|
}
|
||||||
|
|
||||||
private void renderSolvePopup() {
|
private void renderSolvePopup() {
|
||||||
if (ImGui.beginPopup("solve")) {
|
if (ImGui.beginPopup("solve")) {
|
||||||
if (ImGui.button("Résoudre avec backtrace")) {
|
if (ImGui.button("Résoudre avec backtrace")) {
|
||||||
@@ -102,16 +132,14 @@ public class SudokuView extends BaseView {
|
|||||||
ImGui.beginDisabled();
|
ImGui.beginDisabled();
|
||||||
|
|
||||||
if (!this.resolved && centeredButton("Résoudre")) {
|
if (!this.resolved && centeredButton("Résoudre")) {
|
||||||
// beginSolve = true;
|
|
||||||
ImGui.openPopup("solve");
|
ImGui.openPopup("solve");
|
||||||
}
|
}
|
||||||
|
|
||||||
if (resolveThread != null)
|
if (resolveThread != null)
|
||||||
ImGui.endDisabled();
|
ImGui.endDisabled();
|
||||||
|
|
||||||
if (this.resolved) {
|
renderResolvedText();
|
||||||
ImGui.text("Bravo !");
|
renderUnsolvableText();
|
||||||
}
|
|
||||||
|
|
||||||
renderSolvePopup();
|
renderSolvePopup();
|
||||||
}
|
}
|
||||||
@@ -128,9 +156,19 @@ public class SudokuView extends BaseView {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
private void renderClearButton() {
|
||||||
|
if (centeredButton("Effacer")) {
|
||||||
|
this.doku.clearMutableCells();
|
||||||
|
this.resolved = false;
|
||||||
|
this.unresolved = false;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void render() {
|
public void render() {
|
||||||
sudokuRenderer.render();
|
sudokuRenderer.render();
|
||||||
|
renderHintButton();
|
||||||
|
renderClearButton();
|
||||||
renderSolveButton();
|
renderSolveButton();
|
||||||
renderSaveButton();
|
renderSaveButton();
|
||||||
renderCancelButton();
|
renderCancelButton();
|
||||||
|
|||||||
32
app/src/main/java/gui/widget/AnimatedBackground.java
Normal file
32
app/src/main/java/gui/widget/AnimatedBackground.java
Normal file
@@ -0,0 +1,32 @@
|
|||||||
|
package gui.widget;
|
||||||
|
|
||||||
|
import gui.constants.Images;
|
||||||
|
import gui.constants.Options;
|
||||||
|
import imgui.ImGui;
|
||||||
|
import imgui.ImVec2;
|
||||||
|
import imgui.flag.ImGuiWindowFlags;
|
||||||
|
|
||||||
|
public class AnimatedBackground {
|
||||||
|
|
||||||
|
private float backgroundOffset = 0;
|
||||||
|
|
||||||
|
private static final float defaultSpeed = 0.05f;
|
||||||
|
|
||||||
|
public AnimatedBackground() {
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
backgroundOffset += ImGui.getIO().getDeltaTime() * defaultSpeed * Options.BackgroundSpeed;
|
||||||
|
var displaySize = ImGui.getIO().getDisplaySize();
|
||||||
|
ImGui.setNextWindowPos(new ImVec2(0.0f, 0.0f));
|
||||||
|
ImGui.setNextWindowSize(displaySize);
|
||||||
|
ImGui.begin("Background", null, ImGuiWindowFlags.NoDecoration | ImGuiWindowFlags.NoMove
|
||||||
|
| ImGuiWindowFlags.NoSavedSettings | ImGuiWindowFlags.NoBackground
|
||||||
|
| ImGuiWindowFlags.NoBringToFrontOnFocus | ImGuiWindowFlags.NoInputs);
|
||||||
|
ImGui.image(Images.BACKGROUND, displaySize, new ImVec2(backgroundOffset, backgroundOffset),
|
||||||
|
new ImVec2(1.0f + backgroundOffset, 1.0f + backgroundOffset));
|
||||||
|
ImGui.end();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
73
app/src/main/java/gui/widget/LeaderboardRenderer.java
Normal file
73
app/src/main/java/gui/widget/LeaderboardRenderer.java
Normal file
@@ -0,0 +1,73 @@
|
|||||||
|
package gui.widget;
|
||||||
|
|
||||||
|
import game.Game;
|
||||||
|
import game.Player;
|
||||||
|
import imgui.ImGui;
|
||||||
|
import imgui.ImVec2;
|
||||||
|
import imgui.ImVec4;
|
||||||
|
import imgui.flag.ImGuiCol;
|
||||||
|
import imgui.flag.ImGuiStyleVar;
|
||||||
|
|
||||||
|
public class LeaderboardRenderer {
|
||||||
|
|
||||||
|
private final Game game;
|
||||||
|
private final Player currentPlayer;
|
||||||
|
|
||||||
|
private final float cellHeight = 75;
|
||||||
|
private final ImVec2 cellSize = new ImVec2(12 * cellHeight, cellHeight);
|
||||||
|
private final ImVec2 rankSize = new ImVec2(cellHeight, cellHeight);
|
||||||
|
private final ImVec2 scoreSize = rankSize;
|
||||||
|
private final ImVec2 nameSize = new ImVec2(cellSize.x - cellHeight * 2.0f, cellHeight);
|
||||||
|
private final ImVec4 cellColorPlayer = new ImVec4(0.20f, 0.67f, 1.0f, 0.5f);
|
||||||
|
private final ImVec4 cellColorEnemy = new ImVec4(1.0f, 0.0f, 0.0f, 0.5f);
|
||||||
|
private final int maxPlayersShowed = 2;
|
||||||
|
|
||||||
|
private final int emptyCellCount;
|
||||||
|
|
||||||
|
public LeaderboardRenderer(Game game, Player player) {
|
||||||
|
this.game = game;
|
||||||
|
this.currentPlayer = player;
|
||||||
|
this.emptyCellCount = game.getDoku().getEmptyCells().size();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderRank(int rank) {
|
||||||
|
ImGui.button(Integer.toString(rank), rankSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderName(String name) {
|
||||||
|
ImGui.button(name, nameSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderScore(int score) {
|
||||||
|
ImGui.button(Integer.toString(score), scoreSize);
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderCell(Player player, int rank, ImVec4 color) {
|
||||||
|
ImGui.pushStyleColor(ImGuiCol.Button, color);
|
||||||
|
ImGui.pushStyleColor(ImGuiCol.ButtonHovered, color);
|
||||||
|
ImGui.pushStyleColor(ImGuiCol.ButtonActive, color);
|
||||||
|
ImGui.beginChild(player.getPseudo() + "##" + player.getId(), cellSize);
|
||||||
|
renderRank(rank);
|
||||||
|
ImGui.sameLine();
|
||||||
|
renderName(player.getPseudo());
|
||||||
|
ImGui.sameLine();
|
||||||
|
renderScore(emptyCellCount - player.getRemainingCells());
|
||||||
|
ImGui.endChild();
|
||||||
|
ImGui.popStyleColor(3);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
var displaySize = ImGui.getIO().getDisplaySize();
|
||||||
|
ImGui.setCursorPosX(displaySize.x / 2.0f - cellSize.x / 2.0f);
|
||||||
|
ImGui.beginChild("Leaderboard", new ImVec2(cellSize.x + 15.0f, cellHeight * maxPlayersShowed));
|
||||||
|
ImGui.pushStyleVar(ImGuiStyleVar.ItemSpacing, new ImVec2());
|
||||||
|
ImGui.pushStyleVar(ImGuiStyleVar.FrameBorderSize, 3.0f);
|
||||||
|
for (int i = 0; i < game.getLeaderboard().size(); i++) {
|
||||||
|
Player player = game.getLeaderboard().get(i);
|
||||||
|
renderCell(player, i + 1, player == currentPlayer ? cellColorPlayer : cellColorEnemy);
|
||||||
|
}
|
||||||
|
ImGui.popStyleVar(2);
|
||||||
|
ImGui.endChild();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,28 @@
|
|||||||
|
package gui.widget;
|
||||||
|
|
||||||
|
import game.Game;
|
||||||
|
import game.Player;
|
||||||
|
import imgui.ImGui;
|
||||||
|
import imgui.ImVec2;
|
||||||
|
|
||||||
|
public class MultiPlayerCompleteProgress {
|
||||||
|
|
||||||
|
private final Game game;
|
||||||
|
private final int emptyCellCount;
|
||||||
|
private final ImVec2 progressSize = new ImVec2(700, 50);
|
||||||
|
private final SmoothProgressBar progressBar;
|
||||||
|
|
||||||
|
public MultiPlayerCompleteProgress(Game game) {
|
||||||
|
this.game = game;
|
||||||
|
this.emptyCellCount = game.getDoku().getEmptyCells().size();
|
||||||
|
this.progressBar = new SmoothProgressBar();
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
Player firstPlayer = game.getLeaderboard().getFirst();
|
||||||
|
ImGui.setCursorPosX(ImGui.getIO().getDisplaySizeX() / 2.0f - progressSize.x / 2.0f);
|
||||||
|
String progressText = firstPlayer.getPseudo() + " - " + (emptyCellCount - firstPlayer.getRemainingCells()) + "/" + emptyCellCount;
|
||||||
|
this.progressBar.render(progressText, progressSize, 1.0f - firstPlayer.getRemainingCells() / (float) emptyCellCount);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
30
app/src/main/java/gui/widget/SmoothProgressBar.java
Normal file
30
app/src/main/java/gui/widget/SmoothProgressBar.java
Normal file
@@ -0,0 +1,30 @@
|
|||||||
|
package gui.widget;
|
||||||
|
|
||||||
|
import imgui.ImGui;
|
||||||
|
import imgui.ImVec2;
|
||||||
|
|
||||||
|
public class SmoothProgressBar {
|
||||||
|
|
||||||
|
private float lastProgress = 0;
|
||||||
|
private final float speed = 2.0f;
|
||||||
|
private final float clipConstant = 0.001f;
|
||||||
|
|
||||||
|
private void updateProgress(float newProgress) {
|
||||||
|
float delta = newProgress - lastProgress;
|
||||||
|
if (Math.abs(delta) < clipConstant)
|
||||||
|
lastProgress = newProgress;
|
||||||
|
else
|
||||||
|
lastProgress = lastProgress + delta * ImGui.getIO().getDeltaTime() * speed;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render(String label, ImVec2 size, float progress) {
|
||||||
|
updateProgress(progress);
|
||||||
|
ImGui.progressBar(lastProgress, size, label);
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render(float progress) {
|
||||||
|
updateProgress(progress);
|
||||||
|
ImGui.progressBar(lastProgress);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,4 +1,4 @@
|
|||||||
package gui;
|
package gui.widget;
|
||||||
|
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
import java.util.HashSet;
|
import java.util.HashSet;
|
||||||
@@ -6,8 +6,14 @@ import java.util.List;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
|
||||||
|
import common.ConsumerSignal;
|
||||||
import common.Signal;
|
import common.Signal;
|
||||||
|
import gui.ColorGenerator;
|
||||||
import gui.ColorGenerator.Color;
|
import gui.ColorGenerator.Color;
|
||||||
|
import gui.RenderableMultidoku;
|
||||||
|
import gui.constants.Fonts;
|
||||||
|
import gui.constants.Options;
|
||||||
|
import gui.constants.Symbols;
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
import imgui.ImVec2;
|
import imgui.ImVec2;
|
||||||
import imgui.ImVec4;
|
import imgui.ImVec4;
|
||||||
@@ -33,6 +39,7 @@ public class SudokuRenderer {
|
|||||||
private final Set<Cell> diagonals = new HashSet<>();
|
private final Set<Cell> diagonals = new HashSet<>();
|
||||||
|
|
||||||
public final Signal onResolve = new Signal();
|
public final Signal onResolve = new Signal();
|
||||||
|
public final ConsumerSignal<Cell> onCellChange = new ConsumerSignal<>();
|
||||||
|
|
||||||
public SudokuRenderer(MultiDoku doku) {
|
public SudokuRenderer(MultiDoku doku) {
|
||||||
this.doku = RenderableMultidoku.fromMultidoku(doku);
|
this.doku = RenderableMultidoku.fromMultidoku(doku);
|
||||||
@@ -64,6 +71,9 @@ public class SudokuRenderer {
|
|||||||
|
|
||||||
private void renderPopup() {
|
private void renderPopup() {
|
||||||
if (ImGui.beginPopup("editPopup")) {
|
if (ImGui.beginPopup("editPopup")) {
|
||||||
|
if (currentCell == null)
|
||||||
|
ImGui.closeCurrentPopup();
|
||||||
|
else {
|
||||||
Block block = currentCell.getBlock();
|
Block block = currentCell.getBlock();
|
||||||
int symbolCount = block.getCells().size();
|
int symbolCount = block.getCells().size();
|
||||||
for (int i = 0; i < symbolCount; i++) {
|
for (int i = 0; i < symbolCount; i++) {
|
||||||
@@ -72,17 +82,20 @@ public class SudokuRenderer {
|
|||||||
if (currentCell.getSymbolIndex() == i) {
|
if (currentCell.getSymbolIndex() == i) {
|
||||||
if (ImGui.button("X", cellSize)) {
|
if (ImGui.button("X", cellSize)) {
|
||||||
currentCell.setSymbolIndex(Cell.NOSYMBOL);
|
currentCell.setSymbolIndex(Cell.NOSYMBOL);
|
||||||
|
this.onCellChange.emit(currentCell);
|
||||||
ImGui.closeCurrentPopup();
|
ImGui.closeCurrentPopup();
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
if (ImGui.button(Options.Symboles.getSymbols().get(i), cellSize)) {
|
if (ImGui.button(Options.Symboles.getSymbols().get(i), cellSize)) {
|
||||||
currentCell.trySetValue(i);
|
currentCell.setSymbolIndex(i);
|
||||||
|
this.onCellChange.emit(currentCell);
|
||||||
if (this.doku.getDoku().isSolved())
|
if (this.doku.getDoku().isSolved())
|
||||||
this.onResolve.emit();
|
this.onResolve.emit();
|
||||||
ImGui.closeCurrentPopup();
|
ImGui.closeCurrentPopup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
ImGui.endPopup();
|
ImGui.endPopup();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -98,7 +111,7 @@ public class SudokuRenderer {
|
|||||||
if (offsetX > 0) {
|
if (offsetX > 0) {
|
||||||
ImGui.setCursorPosX(offsetX);
|
ImGui.setCursorPosX(offsetX);
|
||||||
}
|
}
|
||||||
ImGui.beginChild(1, new ImVec2(cellSize.x * doku.getWidth(), cellSize.y * doku.getHeight()));
|
ImGui.beginChild("sudokuChild", new ImVec2(cellSize.x * doku.getWidth(), cellSize.y * doku.getHeight()));
|
||||||
|
|
||||||
ImGui.pushStyleVar(ImGuiStyleVar.FrameBorderSize, 2.0f);
|
ImGui.pushStyleVar(ImGuiStyleVar.FrameBorderSize, 2.0f);
|
||||||
ImGui.pushStyleVar(ImGuiStyleVar.ItemSpacing, new ImVec2(0.0f, 0.0f));
|
ImGui.pushStyleVar(ImGuiStyleVar.ItemSpacing, new ImVec2(0.0f, 0.0f));
|
||||||
@@ -108,6 +121,7 @@ public class SudokuRenderer {
|
|||||||
ImGui.sameLine();
|
ImGui.sameLine();
|
||||||
int index = y * doku.getWidth() + x;
|
int index = y * doku.getWidth() + x;
|
||||||
Cell cell = doku.getCell(x, y);
|
Cell cell = doku.getCell(x, y);
|
||||||
|
ImGui.beginDisabled(cell == null);
|
||||||
if (cell == null) {
|
if (cell == null) {
|
||||||
ImGui.pushStyleColor(ImGuiCol.Border, TRANSPARENT);
|
ImGui.pushStyleColor(ImGuiCol.Border, TRANSPARENT);
|
||||||
ImGui.pushStyleColor(ImGuiCol.Button, TRANSPARENT);
|
ImGui.pushStyleColor(ImGuiCol.Button, TRANSPARENT);
|
||||||
@@ -132,6 +146,7 @@ public class SudokuRenderer {
|
|||||||
currentCell = cell;
|
currentCell = cell;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
ImGui.endDisabled();
|
||||||
ImGui.popStyleColor(2);
|
ImGui.popStyleColor(2);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -1,69 +1,105 @@
|
|||||||
package gui;
|
package gui.widget;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import common.Signal;
|
import common.ConsumerSignal;
|
||||||
|
import gui.constants.SudokuType;
|
||||||
import imgui.ImGui;
|
import imgui.ImGui;
|
||||||
import imgui.extension.imguifiledialog.ImGuiFileDialog;
|
import imgui.extension.imguifiledialog.ImGuiFileDialog;
|
||||||
import imgui.extension.imguifiledialog.flag.ImGuiFileDialogFlags;
|
import imgui.extension.imguifiledialog.flag.ImGuiFileDialogFlags;
|
||||||
import imgui.type.ImBoolean;
|
import imgui.type.ImBoolean;
|
||||||
import imgui.type.ImInt;
|
import imgui.type.ImInt;
|
||||||
import sudoku.constraint.Constraint;
|
import sudoku.constraint.Constraint;
|
||||||
|
import sudoku.constraint.IConstraint;
|
||||||
import sudoku.structure.Difficulty;
|
import sudoku.structure.Difficulty;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.SudokuFactory;
|
import sudoku.structure.SudokuFactory;
|
||||||
|
|
||||||
public class SudokuSelector {
|
public class SudokuSelector {
|
||||||
|
|
||||||
public final Signal onSelect = new Signal();
|
public final ConsumerSignal<MultiDoku> onSelect = new ConsumerSignal<>();
|
||||||
private MultiDoku doku;
|
private MultiDoku doku;
|
||||||
|
|
||||||
private final boolean canGenEmptyGrid;
|
private final boolean canGenEmptyGrid;
|
||||||
|
|
||||||
private final ImInt sudokuType = new ImInt(0);
|
private final ImInt sudokuType = new ImInt(0);
|
||||||
|
|
||||||
private final ImInt difficulty = new ImInt(Difficulty.Medium.ordinal());
|
private final ImInt difficulty = new ImInt(Difficulty.Easy.ordinal());
|
||||||
private final List<ImBoolean> contraints = new ArrayList<>();
|
private final List<ImBoolean> contraints = new ArrayList<>();
|
||||||
|
|
||||||
private static final String[] sudokuTypes = { "Carré", "Rectangle", "Multidoku" };
|
|
||||||
private static final int SQUARE = 0, RECTANGLE = 1, MULTIDOKU = 2;
|
|
||||||
|
|
||||||
private final ImInt sudokuSize = new ImInt(3);
|
private final ImInt sudokuSize = new ImInt(3);
|
||||||
|
|
||||||
private final ImInt sudokuWidth = new ImInt(3);
|
private final ImInt sudokuWidth = new ImInt(3);
|
||||||
private final ImInt sudokuHeight = new ImInt(3);
|
private final ImInt sudokuHeight = new ImInt(3);
|
||||||
|
|
||||||
public SudokuSelector(boolean canGenEmptyGrid) {
|
private final String confirmMessage;
|
||||||
|
|
||||||
|
private Thread genThread = null;
|
||||||
|
|
||||||
|
private final SmoothProgressBar genProgressBar;
|
||||||
|
|
||||||
|
private volatile boolean genDone = false;
|
||||||
|
|
||||||
|
public SudokuSelector(boolean canGenEmptyGrid, String confirmMessage) {
|
||||||
this.canGenEmptyGrid = canGenEmptyGrid;
|
this.canGenEmptyGrid = canGenEmptyGrid;
|
||||||
|
this.confirmMessage = confirmMessage;
|
||||||
initConstraints();
|
initConstraints();
|
||||||
|
this.genProgressBar = new SmoothProgressBar();
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Constraint> getConstraints() {
|
private List<IConstraint> getConstraints() {
|
||||||
List<Constraint> constraints = new ArrayList<>();
|
List<IConstraint> constraints = new ArrayList<>();
|
||||||
for (int i = 0; i < this.contraints.size(); i++) {
|
for (int i = 0; i < this.contraints.size(); i++) {
|
||||||
if (this.contraints.get(i).get())
|
if (this.contraints.get(i).get())
|
||||||
constraints.add(Constraint.values()[i]);
|
constraints.add(Constraint.values()[i].getConstraint());
|
||||||
}
|
}
|
||||||
return constraints;
|
return constraints;
|
||||||
}
|
}
|
||||||
|
|
||||||
private void initConstraints() {
|
private void initConstraints() {
|
||||||
for (Constraint cons : Constraint.values()) {
|
for (Constraint cons : Constraint.values()) {
|
||||||
contraints.add(new ImBoolean(SudokuFactory.DEFAULT_CONSTRAINTS.contains(cons)));
|
contraints.add(new ImBoolean(SudokuFactory.DEFAULT_CONSTRAINTS.contains(cons.getConstraint())));
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void stopGenThread() {
|
||||||
|
if (this.genThread != null) {
|
||||||
|
this.genThread.interrupt();
|
||||||
|
this.genThread = null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
private void renderGenProgress() {
|
||||||
|
if (ImGui.beginPopup("genProgress")) {
|
||||||
|
ImGui.text("Chargement de la grille ...");
|
||||||
|
int filled = this.doku.getFilledCells().size();
|
||||||
|
int total = this.doku.getCells().size();
|
||||||
|
this.genProgressBar.render(filled / (float) total);
|
||||||
|
if (genDone)
|
||||||
|
ImGui.closeCurrentPopup();
|
||||||
|
ImGui.endPopup();
|
||||||
|
} else {
|
||||||
|
stopGenThread();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void selectSudoku(MultiDoku doku, boolean empty) {
|
private void selectSudoku(MultiDoku doku, boolean empty) {
|
||||||
this.doku = doku;
|
this.doku = doku;
|
||||||
if (!empty) {
|
this.genDone = false;
|
||||||
|
ImGui.openPopup("genProgress");
|
||||||
|
this.genThread = new Thread(() -> {
|
||||||
try {
|
try {
|
||||||
|
if (!empty) {
|
||||||
SudokuFactory.fillDoku(doku, Difficulty.values()[difficulty.get()]);
|
SudokuFactory.fillDoku(doku, Difficulty.values()[difficulty.get()]);
|
||||||
|
}
|
||||||
|
this.genDone = true;
|
||||||
|
this.onSelect.emit(this.doku);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
}
|
});
|
||||||
this.onSelect.emit();
|
this.genThread.start();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void renderFileDialog() {
|
public void renderFileDialog() {
|
||||||
@@ -75,7 +111,7 @@ public class SudokuSelector {
|
|||||||
String filePath = entry.getValue();
|
String filePath = entry.getValue();
|
||||||
this.doku = SudokuFactory.fromfile(filePath);
|
this.doku = SudokuFactory.fromfile(filePath);
|
||||||
if (this.doku != null)
|
if (this.doku != null)
|
||||||
this.onSelect.emit();
|
this.onSelect.emit(this.doku);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
}
|
}
|
||||||
@@ -97,8 +133,9 @@ public class SudokuSelector {
|
|||||||
SudokuType currentType = SudokuType.values()[sudokuType.get()];
|
SudokuType currentType = SudokuType.values()[sudokuType.get()];
|
||||||
switch (currentType.getMakerParamCount()) {
|
switch (currentType.getMakerParamCount()) {
|
||||||
case 1:
|
case 1:
|
||||||
ImGui.inputInt("Taille", sudokuSize);
|
if (ImGui.inputInt("Taille", sudokuSize))
|
||||||
if (ImGui.button("Résoudre un sudoku")) {
|
sudokuSize.set(Math.clamp(sudokuSize.get(), 1, 10));
|
||||||
|
if (ImGui.button(confirmMessage)) {
|
||||||
selectSudoku(currentType.createDoku(getConstraints(), sudokuSize.get()), false);
|
selectSudoku(currentType.createDoku(getConstraints(), sudokuSize.get()), false);
|
||||||
}
|
}
|
||||||
if (canGenEmptyGrid && ImGui.button("Générer une grille vide")) {
|
if (canGenEmptyGrid && ImGui.button("Générer une grille vide")) {
|
||||||
@@ -107,9 +144,11 @@ public class SudokuSelector {
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case 2:
|
case 2:
|
||||||
ImGui.inputInt("Largeur", sudokuHeight);
|
if (ImGui.inputInt("Longueur", sudokuWidth))
|
||||||
ImGui.inputInt("Longueur", sudokuWidth);
|
sudokuWidth.set(Math.clamp(sudokuWidth.get(), 1, 10));
|
||||||
if (ImGui.button("Résoudre un sudoku")) {
|
if (ImGui.inputInt("Hauteur", sudokuHeight))
|
||||||
|
sudokuHeight.set(Math.clamp(sudokuHeight.get(), 1, 10));
|
||||||
|
if (ImGui.button(confirmMessage)) {
|
||||||
selectSudoku(currentType.createDoku(getConstraints(), sudokuWidth.get(), sudokuHeight.get()),
|
selectSudoku(currentType.createDoku(getConstraints(), sudokuWidth.get(), sudokuHeight.get()),
|
||||||
false);
|
false);
|
||||||
}
|
}
|
||||||
@@ -126,11 +165,12 @@ public class SudokuSelector {
|
|||||||
if (ImGui.button("À partir d'un fichier")) {
|
if (ImGui.button("À partir d'un fichier")) {
|
||||||
ImGuiFileDialog.openDialog("browse-sudoku", "Choisissez un fichier", ".json", ".");
|
ImGuiFileDialog.openDialog("browse-sudoku", "Choisissez un fichier", ".json", ".");
|
||||||
}
|
}
|
||||||
|
renderGenProgress();
|
||||||
renderFileDialog();
|
renderFileDialog();
|
||||||
}
|
}
|
||||||
|
|
||||||
public MultiDoku getDoku() {
|
public void clean() {
|
||||||
return doku;
|
stopGenThread();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
29
app/src/main/java/gui/widget/TimerRenderer.java
Normal file
29
app/src/main/java/gui/widget/TimerRenderer.java
Normal file
@@ -0,0 +1,29 @@
|
|||||||
|
package gui.widget;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
|
import imgui.ImGui;
|
||||||
|
|
||||||
|
public class TimerRenderer {
|
||||||
|
|
||||||
|
private final long endTime;
|
||||||
|
|
||||||
|
public TimerRenderer(Instant startTime, long duration) {
|
||||||
|
this.endTime = startTime.getEpochSecond() + duration;
|
||||||
|
}
|
||||||
|
|
||||||
|
private long getTimeRemaining() {
|
||||||
|
long currentTime = Instant.now().getEpochSecond();
|
||||||
|
return endTime - currentTime;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void render() {
|
||||||
|
long seconds = getTimeRemaining();
|
||||||
|
long minutes = seconds / 60;
|
||||||
|
String text = String.format("%02d:%02d", minutes, seconds % 60);
|
||||||
|
var textSize = ImGui.calcTextSize(text);
|
||||||
|
ImGui.setCursorPosX(ImGui.getIO().getDisplaySizeX() / 2.0f - textSize.x / 2.0f);
|
||||||
|
ImGui.text(text);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -22,7 +22,7 @@ public class ConnexionThread extends Thread {
|
|||||||
// System.out.println(objectInputStream.available());
|
// System.out.println(objectInputStream.available());
|
||||||
Object o = objectInputStream.readObject();
|
Object o = objectInputStream.readObject();
|
||||||
if (o instanceof Packet packet) {
|
if (o instanceof Packet packet) {
|
||||||
connexion.visitPacket(packet);
|
connexion.visit(packet);
|
||||||
}
|
}
|
||||||
} catch (ClassNotFoundException | IOException e) {
|
} catch (ClassNotFoundException | IOException e) {
|
||||||
e.printStackTrace();
|
e.printStackTrace();
|
||||||
|
|||||||
@@ -2,12 +2,16 @@ package network.client;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.UnknownHostException;
|
import java.net.UnknownHostException;
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
|
import common.ConsumerSignal;
|
||||||
import common.Signal;
|
import common.Signal;
|
||||||
import game.Game;
|
import game.Game;
|
||||||
import game.Player;
|
import game.Player;
|
||||||
|
import network.protocol.packets.ChangeCellPacket;
|
||||||
import network.protocol.packets.LoginPacket;
|
import network.protocol.packets.LoginPacket;
|
||||||
|
import sudoku.structure.Cell;
|
||||||
|
import sudoku.structure.MultiDoku;
|
||||||
|
import sudoku.structure.Sudoku;
|
||||||
|
|
||||||
public class Client {
|
public class Client {
|
||||||
private final ClientConnexion clientConnection;
|
private final ClientConnexion clientConnection;
|
||||||
@@ -17,15 +21,16 @@ public class Client {
|
|||||||
public final Signal onDisconnect = new Signal();
|
public final Signal onDisconnect = new Signal();
|
||||||
public final Signal onClosed = new Signal();
|
public final Signal onClosed = new Signal();
|
||||||
public final Signal onGameStarted = new Signal();
|
public final Signal onGameStarted = new Signal();
|
||||||
|
public final ConsumerSignal<Player> onGameEnd = new ConsumerSignal<>();
|
||||||
|
|
||||||
|
Player player;
|
||||||
|
|
||||||
String disconnectReason = null;
|
String disconnectReason = null;
|
||||||
|
|
||||||
public Client(String address, short port) throws UnknownHostException, IOException {
|
public Client(String pseudo, String address, short port) throws UnknownHostException, IOException {
|
||||||
this.clientConnection = new ClientConnexion(address, port, this);
|
this.clientConnection = new ClientConnexion(address, port, this);
|
||||||
this.game = new Game();
|
this.game = new Game();
|
||||||
// temp
|
login(pseudo);
|
||||||
Random r = new Random();
|
|
||||||
login("Player" + r.nextInt());
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public void login(String pseudo) {
|
public void login(String pseudo) {
|
||||||
@@ -54,4 +59,20 @@ public class Client {
|
|||||||
stop();
|
stop();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void sendCellChange(Cell cell) {
|
||||||
|
MultiDoku doku = getGame().getDoku();
|
||||||
|
for (int sudokuIndex = 0; sudokuIndex < doku.getNbSubGrids(); sudokuIndex++) {
|
||||||
|
Sudoku sudoku = doku.getSubGrid(sudokuIndex);
|
||||||
|
int cellIndex = sudoku.getCells().indexOf(cell);
|
||||||
|
if (cellIndex != -1) {
|
||||||
|
this.clientConnection.sendPacket(new ChangeCellPacket(sudokuIndex, cellIndex, cell.getSymbolIndex()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public Player getPlayer() {
|
||||||
|
return player;
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -6,19 +6,21 @@ import java.net.UnknownHostException;
|
|||||||
|
|
||||||
import game.Player;
|
import game.Player;
|
||||||
import network.Connexion;
|
import network.Connexion;
|
||||||
|
import network.protocol.packets.ChangeCellPacket;
|
||||||
import network.protocol.packets.ConnexionInfoPacket;
|
import network.protocol.packets.ConnexionInfoPacket;
|
||||||
import network.protocol.packets.DisconnectPacket;
|
import network.protocol.packets.DisconnectPacket;
|
||||||
|
import network.protocol.packets.EndGamePacket;
|
||||||
import network.protocol.packets.KeepAlivePacket;
|
import network.protocol.packets.KeepAlivePacket;
|
||||||
import network.protocol.packets.LoginPacket;
|
import network.protocol.packets.LoginPacket;
|
||||||
import network.protocol.packets.PlayerJoinPacket;
|
import network.protocol.packets.PlayerJoinPacket;
|
||||||
import network.protocol.packets.PlayerLeavePacket;
|
import network.protocol.packets.PlayerLeavePacket;
|
||||||
import network.protocol.packets.StartGamePacket;
|
import network.protocol.packets.StartGamePacket;
|
||||||
|
import network.protocol.packets.UpdatePlayerScorePacket;
|
||||||
import sudoku.io.SudokuSerializer;
|
import sudoku.io.SudokuSerializer;
|
||||||
|
|
||||||
public class ClientConnexion extends Connexion {
|
public class ClientConnexion extends Connexion {
|
||||||
|
|
||||||
private final Client client;
|
private final Client client;
|
||||||
private Player player = null;
|
|
||||||
|
|
||||||
public ClientConnexion(String address, short port, Client client) throws UnknownHostException, IOException {
|
public ClientConnexion(String address, short port, Client client) throws UnknownHostException, IOException {
|
||||||
super(new Socket(address, port));
|
super(new Socket(address, port));
|
||||||
@@ -29,13 +31,14 @@ public class ClientConnexion extends Connexion {
|
|||||||
public void close() {
|
public void close() {
|
||||||
if (!this.isClosed()) {
|
if (!this.isClosed()) {
|
||||||
super.close();
|
super.close();
|
||||||
|
sendPacket(new DisconnectPacket(""));
|
||||||
client.onDisconnect.emit();
|
client.onDisconnect.emit();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visitPacket(ConnexionInfoPacket packet) {
|
public void visitPacket(ConnexionInfoPacket packet) {
|
||||||
this.player = this.client.getGame().getPlayerById(packet.getConnectionId());
|
this.client.player = this.client.getGame().getPlayerById(packet.getConnectionId());
|
||||||
client.onConnect.emit();
|
client.onConnect.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -69,8 +72,28 @@ public class ClientConnexion extends Connexion {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void visitPacket(StartGamePacket packet) {
|
public void visitPacket(StartGamePacket packet) {
|
||||||
this.client.getGame().startGame(SudokuSerializer.deserializeSudoku(packet.getSerializedSudoku()));
|
this.client.getGame().startGame(SudokuSerializer.deserializeSudoku(packet.getSerializedSudoku()),
|
||||||
|
packet.getInstant(), packet.getGameDuration());
|
||||||
this.client.onGameStarted.emit();
|
this.client.onGameStarted.emit();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitPacket(EndGamePacket packet) {
|
||||||
|
Player winner = this.client.getGame().getLeaderboard().getFirst();
|
||||||
|
this.client.getGame().stopGame();
|
||||||
|
this.client.onGameEnd.emit(winner);
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitPacket(UpdatePlayerScorePacket packet) {
|
||||||
|
Player player = this.client.getGame().getPlayerById(packet.getPlayerId());
|
||||||
|
assert (player != null);
|
||||||
|
this.client.getGame().setPlayerRemainingCells(player, packet.getCellsLeft());
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitPacket(ChangeCellPacket packet) {
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'visitPacketChangeCell'");
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,16 +1,19 @@
|
|||||||
package network.protocol;
|
package network.protocol;
|
||||||
|
|
||||||
|
import network.protocol.packets.ChangeCellPacket;
|
||||||
import network.protocol.packets.ConnexionInfoPacket;
|
import network.protocol.packets.ConnexionInfoPacket;
|
||||||
import network.protocol.packets.DisconnectPacket;
|
import network.protocol.packets.DisconnectPacket;
|
||||||
|
import network.protocol.packets.EndGamePacket;
|
||||||
import network.protocol.packets.KeepAlivePacket;
|
import network.protocol.packets.KeepAlivePacket;
|
||||||
import network.protocol.packets.LoginPacket;
|
import network.protocol.packets.LoginPacket;
|
||||||
import network.protocol.packets.PlayerJoinPacket;
|
import network.protocol.packets.PlayerJoinPacket;
|
||||||
import network.protocol.packets.PlayerLeavePacket;
|
import network.protocol.packets.PlayerLeavePacket;
|
||||||
import network.protocol.packets.StartGamePacket;
|
import network.protocol.packets.StartGamePacket;
|
||||||
|
import network.protocol.packets.UpdatePlayerScorePacket;
|
||||||
|
|
||||||
public interface PacketVisitor {
|
public interface PacketVisitor {
|
||||||
|
|
||||||
default void visitPacket(Packet packet) {
|
default void visit(Packet packet) {
|
||||||
packet.accept(this);
|
packet.accept(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -21,5 +24,8 @@ public interface PacketVisitor {
|
|||||||
void visitPacket(PlayerJoinPacket packet);
|
void visitPacket(PlayerJoinPacket packet);
|
||||||
void visitPacket(PlayerLeavePacket packet);
|
void visitPacket(PlayerLeavePacket packet);
|
||||||
void visitPacket(StartGamePacket packet);
|
void visitPacket(StartGamePacket packet);
|
||||||
|
void visitPacket(EndGamePacket packet);
|
||||||
|
void visitPacket(UpdatePlayerScorePacket packet);
|
||||||
|
void visitPacket(ChangeCellPacket packet);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,6 @@ package network.protocol;
|
|||||||
|
|
||||||
public enum Packets {
|
public enum Packets {
|
||||||
|
|
||||||
ConnectionInfo, KeepAlive, Disconnect, Login, PlayerJoin, PlayerLeave, StartGame
|
ConnectionInfo, KeepAlive, Disconnect, Login, PlayerJoin, PlayerLeave, StartGame, ChangeCell, EndGame, UpdatePlayerScore
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -0,0 +1,38 @@
|
|||||||
|
package network.protocol.packets;
|
||||||
|
|
||||||
|
import network.protocol.Packet;
|
||||||
|
import network.protocol.PacketVisitor;
|
||||||
|
import network.protocol.Packets;
|
||||||
|
|
||||||
|
public class ChangeCellPacket extends Packet {
|
||||||
|
|
||||||
|
static private final long serialVersionUID = Packets.ChangeCell.ordinal();
|
||||||
|
|
||||||
|
private final int sudokuIndex;
|
||||||
|
private final int cellIndex;
|
||||||
|
private final int newValue;
|
||||||
|
|
||||||
|
public ChangeCellPacket(int sudokuIndex, int cellIndex, int newValue) {
|
||||||
|
this.sudokuIndex = sudokuIndex;
|
||||||
|
this.cellIndex = cellIndex;
|
||||||
|
this.newValue = newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getSudokuIndex() {
|
||||||
|
return sudokuIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCellIndex() {
|
||||||
|
return cellIndex;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNewValue() {
|
||||||
|
return newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accept(PacketVisitor packetVisitor) {
|
||||||
|
packetVisitor.visitPacket(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -0,0 +1,18 @@
|
|||||||
|
package network.protocol.packets;
|
||||||
|
|
||||||
|
import network.protocol.Packet;
|
||||||
|
import network.protocol.PacketVisitor;
|
||||||
|
import network.protocol.Packets;
|
||||||
|
|
||||||
|
public class EndGamePacket extends Packet {
|
||||||
|
|
||||||
|
static private final long serialVersionUID = Packets.EndGame.ordinal();
|
||||||
|
|
||||||
|
public EndGamePacket() { }
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accept(PacketVisitor packetVisitor) {
|
||||||
|
packetVisitor.visitPacket(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,7 @@
|
|||||||
package network.protocol.packets;
|
package network.protocol.packets;
|
||||||
|
|
||||||
|
import java.time.Instant;
|
||||||
|
|
||||||
import network.protocol.Packet;
|
import network.protocol.Packet;
|
||||||
import network.protocol.PacketVisitor;
|
import network.protocol.PacketVisitor;
|
||||||
import network.protocol.Packets;
|
import network.protocol.Packets;
|
||||||
@@ -9,15 +11,28 @@ public class StartGamePacket extends Packet {
|
|||||||
static private final long serialVersionUID = Packets.StartGame.ordinal();
|
static private final long serialVersionUID = Packets.StartGame.ordinal();
|
||||||
|
|
||||||
private final String serializedSudoku;
|
private final String serializedSudoku;
|
||||||
|
// used to resume game
|
||||||
|
private final Instant instant;
|
||||||
|
private final long gameDuration;
|
||||||
|
|
||||||
public StartGamePacket(String serializedSudoku) {
|
public StartGamePacket(String serializedSudoku, Instant instant, long gameDuration) {
|
||||||
this.serializedSudoku = serializedSudoku;
|
this.serializedSudoku = serializedSudoku;
|
||||||
|
this.instant = instant;
|
||||||
|
this.gameDuration = gameDuration;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getSerializedSudoku() {
|
public String getSerializedSudoku() {
|
||||||
return serializedSudoku;
|
return serializedSudoku;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public Instant getInstant() {
|
||||||
|
return instant;
|
||||||
|
}
|
||||||
|
|
||||||
|
public long getGameDuration() {
|
||||||
|
return gameDuration;
|
||||||
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public void accept(PacketVisitor packetVisitor) {
|
public void accept(PacketVisitor packetVisitor) {
|
||||||
packetVisitor.visitPacket(this);
|
packetVisitor.visitPacket(this);
|
||||||
|
|||||||
@@ -0,0 +1,32 @@
|
|||||||
|
package network.protocol.packets;
|
||||||
|
|
||||||
|
import network.protocol.Packet;
|
||||||
|
import network.protocol.PacketVisitor;
|
||||||
|
import network.protocol.Packets;
|
||||||
|
|
||||||
|
public class UpdatePlayerScorePacket extends Packet {
|
||||||
|
|
||||||
|
static private final long serialVersionUID = Packets.UpdatePlayerScore.ordinal();
|
||||||
|
|
||||||
|
private final int playerId;
|
||||||
|
private final int cellsLeft;
|
||||||
|
|
||||||
|
public UpdatePlayerScorePacket(int playerId, int cellsLeft) {
|
||||||
|
this.playerId = playerId;
|
||||||
|
this.cellsLeft = cellsLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getPlayerId() {
|
||||||
|
return playerId;
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getCellsLeft() {
|
||||||
|
return cellsLeft;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void accept(PacketVisitor packetVisitor) {
|
||||||
|
packetVisitor.visitPacket(this);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -2,12 +2,15 @@ package network.server;
|
|||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.ServerSocket;
|
import java.net.ServerSocket;
|
||||||
|
import java.time.Instant;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import game.Game;
|
import game.Game;
|
||||||
import game.Player;
|
import game.Player;
|
||||||
|
import game.Game.GameState;
|
||||||
import network.protocol.Packet;
|
import network.protocol.Packet;
|
||||||
|
import network.protocol.packets.EndGamePacket;
|
||||||
import network.protocol.packets.StartGamePacket;
|
import network.protocol.packets.StartGamePacket;
|
||||||
import sudoku.io.SudokuSerializer;
|
import sudoku.io.SudokuSerializer;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
@@ -37,7 +40,16 @@ public class Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void update() {
|
private void checkTimer() {
|
||||||
|
if (getGame() == null || getGame().getGameState() != GameState.GameGoing)
|
||||||
|
return;
|
||||||
|
long now = Instant.now().getEpochSecond();
|
||||||
|
long end = getGame().getStartTime().getEpochSecond() + getGame().getGameDuration();
|
||||||
|
if (now > end)
|
||||||
|
stopGame();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkConnexions() {
|
||||||
for (var it = connexions.iterator(); it.hasNext();) {
|
for (var it = connexions.iterator(); it.hasNext();) {
|
||||||
ServerConnexion connexion = it.next();
|
ServerConnexion connexion = it.next();
|
||||||
if (!connexion.update()) {
|
if (!connexion.update()) {
|
||||||
@@ -48,6 +60,11 @@ public class Server {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void update() {
|
||||||
|
checkTimer();
|
||||||
|
checkConnexions();
|
||||||
|
}
|
||||||
|
|
||||||
public void stop() {
|
public void stop() {
|
||||||
this.acceptThread.cancel();
|
this.acceptThread.cancel();
|
||||||
this.logicThread.cancel();
|
this.logicThread.cancel();
|
||||||
@@ -68,9 +85,19 @@ public class Server {
|
|||||||
return game;
|
return game;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void startGame(MultiDoku doku) {
|
public void startGame(MultiDoku doku, long gameDuration) {
|
||||||
this.game.startGame(doku);
|
Instant now = Instant.now();
|
||||||
broadcastPacket(new StartGamePacket(SudokuSerializer.serializeSudoku(doku).toString()));
|
this.game.startGame(doku, now, gameDuration);
|
||||||
|
for (ServerConnexion connexion : this.connexions) {
|
||||||
|
connexion.setSudoku(doku.clone());
|
||||||
|
}
|
||||||
|
broadcastPacket(new StartGamePacket(SudokuSerializer.serializeSudoku(doku).toString(), now, gameDuration));
|
||||||
|
}
|
||||||
|
|
||||||
|
public void stopGame() {
|
||||||
|
// we don't need to specify the winner since it has to be the first
|
||||||
|
broadcastPacket(new EndGamePacket());
|
||||||
|
getGame().stopGame();
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,17 +3,23 @@ package network.server;
|
|||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.net.Socket;
|
import java.net.Socket;
|
||||||
|
|
||||||
|
import game.Game;
|
||||||
import game.Player;
|
import game.Player;
|
||||||
import game.Game.GameState;
|
import game.Game.GameState;
|
||||||
import network.Connexion;
|
import network.Connexion;
|
||||||
|
import network.protocol.packets.ChangeCellPacket;
|
||||||
import network.protocol.packets.ConnexionInfoPacket;
|
import network.protocol.packets.ConnexionInfoPacket;
|
||||||
import network.protocol.packets.DisconnectPacket;
|
import network.protocol.packets.DisconnectPacket;
|
||||||
|
import network.protocol.packets.EndGamePacket;
|
||||||
import network.protocol.packets.KeepAlivePacket;
|
import network.protocol.packets.KeepAlivePacket;
|
||||||
import network.protocol.packets.LoginPacket;
|
import network.protocol.packets.LoginPacket;
|
||||||
import network.protocol.packets.PlayerJoinPacket;
|
import network.protocol.packets.PlayerJoinPacket;
|
||||||
import network.protocol.packets.PlayerLeavePacket;
|
import network.protocol.packets.PlayerLeavePacket;
|
||||||
import network.protocol.packets.StartGamePacket;
|
import network.protocol.packets.StartGamePacket;
|
||||||
|
import network.protocol.packets.UpdatePlayerScorePacket;
|
||||||
import sudoku.io.SudokuSerializer;
|
import sudoku.io.SudokuSerializer;
|
||||||
|
import sudoku.structure.Cell;
|
||||||
|
import sudoku.structure.MultiDoku;
|
||||||
|
|
||||||
public class ServerConnexion extends Connexion {
|
public class ServerConnexion extends Connexion {
|
||||||
|
|
||||||
@@ -21,6 +27,7 @@ public class ServerConnexion extends Connexion {
|
|||||||
private final KeepAliveHandler keepAliveHandler;
|
private final KeepAliveHandler keepAliveHandler;
|
||||||
private boolean shouldClose = false;
|
private boolean shouldClose = false;
|
||||||
private Player player = null;
|
private Player player = null;
|
||||||
|
private MultiDoku doku;
|
||||||
|
|
||||||
public ServerConnexion(Socket socket, Server server) throws IOException {
|
public ServerConnexion(Socket socket, Server server) throws IOException {
|
||||||
super(socket);
|
super(socket);
|
||||||
@@ -29,7 +36,7 @@ public class ServerConnexion extends Connexion {
|
|||||||
}
|
}
|
||||||
|
|
||||||
public boolean update() {
|
public boolean update() {
|
||||||
if (shouldClose | isClosed())
|
if (shouldClose || isClosed())
|
||||||
return false;
|
return false;
|
||||||
return this.keepAliveHandler.update();
|
return this.keepAliveHandler.update();
|
||||||
}
|
}
|
||||||
@@ -54,13 +61,22 @@ public class ServerConnexion extends Connexion {
|
|||||||
private void finishLogin() {
|
private void finishLogin() {
|
||||||
// send players that have already joined (excluding this one)
|
// send players that have already joined (excluding this one)
|
||||||
for (Player p : this.server.getGame().getPlayers().values()) {
|
for (Player p : this.server.getGame().getPlayers().values()) {
|
||||||
if (p.getId() != player.getId())
|
if (p.getId() != player.getId()) {
|
||||||
sendPacket(new PlayerJoinPacket(p));
|
sendPacket(new PlayerJoinPacket(p));
|
||||||
|
sendPacket(new UpdatePlayerScorePacket(p.getId(), p.getRemainingCells()));
|
||||||
}
|
}
|
||||||
|
}
|
||||||
|
|
||||||
this.server.broadcastPacket(new PlayerJoinPacket(player));
|
this.server.broadcastPacket(new PlayerJoinPacket(player));
|
||||||
sendPacket(new ConnexionInfoPacket(player.getId()));
|
sendPacket(new ConnexionInfoPacket(player.getId()));
|
||||||
if (this.server.getGame().getGameState() == GameState.GameGoing) {
|
|
||||||
sendPacket(new StartGamePacket(SudokuSerializer.serializeSudoku(this.server.getGame().getDoku()).toString()));
|
Game game = this.server.getGame();
|
||||||
|
|
||||||
|
if (game.getGameState() == GameState.GameGoing) {
|
||||||
|
setSudoku(game.getDoku().clone());
|
||||||
|
sendPacket(
|
||||||
|
new StartGamePacket(SudokuSerializer.serializeSudoku(game.getDoku()).toString(),
|
||||||
|
game.getStartTime(), game.getGameDuration()));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -102,4 +118,50 @@ public class ServerConnexion extends Connexion {
|
|||||||
throw new UnsupportedOperationException("Unimplemented method 'visitPacketStartGame'");
|
throw new UnsupportedOperationException("Unimplemented method 'visitPacketStartGame'");
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitPacket(EndGamePacket packet) {
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'visitPacket'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitPacket(UpdatePlayerScorePacket packet) {
|
||||||
|
throw new UnsupportedOperationException("Unimplemented method 'visitPacket'");
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public void visitPacket(ChangeCellPacket packet) {
|
||||||
|
Cell cell = this.doku.getSubGrid(packet.getSudokuIndex()).getCell(packet.getCellIndex());
|
||||||
|
if (cell.getSymbolIndex() == Cell.NOSYMBOL && packet.getNewValue() == Cell.NOSYMBOL)
|
||||||
|
return;
|
||||||
|
if (cell.getSymbolIndex() != Cell.NOSYMBOL && packet.getNewValue() != Cell.NOSYMBOL) {
|
||||||
|
cell.trySetValue(packet.getNewValue());
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
if (cell.getSymbolIndex() != Cell.NOSYMBOL && packet.getNewValue() == Cell.NOSYMBOL) {
|
||||||
|
cell.empty();
|
||||||
|
this.server.getGame().setPlayerRemainingCells(player, player.getRemainingCells() + 1);
|
||||||
|
this.server.broadcastPacket(new UpdatePlayerScorePacket(player.getId(), player.getRemainingCells()));
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
// on rajoute un chiffre à la grille
|
||||||
|
if (cell.trySetValue(packet.getNewValue())) {
|
||||||
|
this.server.getGame().setPlayerRemainingCells(player, player.getRemainingCells() - 1);
|
||||||
|
this.server.broadcastPacket(new UpdatePlayerScorePacket(player.getId(), player.getRemainingCells()));
|
||||||
|
}
|
||||||
|
checkWin();
|
||||||
|
}
|
||||||
|
|
||||||
|
private void checkWin() {
|
||||||
|
if (this.player.getRemainingCells() == 0) {
|
||||||
|
this.server.stopGame();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setSudoku(MultiDoku doku) {
|
||||||
|
this.doku = doku;
|
||||||
|
assert (player != null);
|
||||||
|
this.server.getGame().setPlayerRemainingCells(player, this.doku.getEmptyCells().size());
|
||||||
|
this.server.broadcastPacket(new UpdatePlayerScorePacket(player.getId(), player.getRemainingCells()));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -19,7 +19,7 @@ public class ServerLogicThread extends Thread {
|
|||||||
try {
|
try {
|
||||||
Thread.sleep(50);
|
Thread.sleep(50);
|
||||||
} catch (InterruptedException e) {
|
} catch (InterruptedException e) {
|
||||||
// e.printStackTrace();
|
e.printStackTrace();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,15 +3,48 @@
|
|||||||
*/
|
*/
|
||||||
package sudoku;
|
package sudoku;
|
||||||
|
|
||||||
|
import gui.RenderableMultidoku;
|
||||||
|
import gui.constants.Symbols;
|
||||||
import sudoku.io.ConsoleInterface;
|
import sudoku.io.ConsoleInterface;
|
||||||
|
import sudoku.io.SudokuPrinter;
|
||||||
|
import sudoku.io.SudokuSerializer;
|
||||||
|
import sudoku.solver.RandomSolver;
|
||||||
|
import sudoku.structure.MultiDoku;
|
||||||
|
import sudoku.structure.SudokuFactory;
|
||||||
|
|
||||||
public class Main {
|
public class Main {
|
||||||
public String getGreeting() {
|
public String getGreeting() {
|
||||||
return "Hello World!";
|
return "Hello World!";
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void voidTest(){
|
||||||
|
MultiDoku md = SudokuFactory.createBasicXShapedMultidoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
||||||
|
SudokuPrinter.printMultiDoku(RenderableMultidoku.fromMultidoku(md), Symbols.Numbers, 3, 3);
|
||||||
|
SudokuSerializer.saveMultiDoku(md);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void filledTest(){
|
||||||
|
MultiDoku md = SudokuFactory.createBasicXShapedMultidoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
||||||
|
new RandomSolver().solve(md);
|
||||||
|
SudokuPrinter.printMultiDoku(RenderableMultidoku.fromMultidoku(md), Symbols.Numbers, 3, 3);
|
||||||
|
SudokuSerializer.saveMultiDoku(md);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void overwriteTest(int n){
|
||||||
|
MultiDoku md = SudokuFactory.createBasicXShapedMultidoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
||||||
|
new RandomSolver().solve(md);
|
||||||
|
SudokuPrinter.printMultiDoku(RenderableMultidoku.fromMultidoku(md), Symbols.Numbers, 3, 3);
|
||||||
|
SudokuSerializer.saveMultiDoku(md, n);
|
||||||
|
}
|
||||||
|
|
||||||
public static void main(String[] args) {
|
public static void main(String[] args) {
|
||||||
ConsoleInterface console = new ConsoleInterface();
|
ConsoleInterface console = new ConsoleInterface();
|
||||||
console.start();
|
/*
|
||||||
|
voidTest();
|
||||||
|
filledTest();
|
||||||
|
overwriteTest(0);
|
||||||
|
overwriteTest(17)
|
||||||
|
*/
|
||||||
|
console.welcome();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package sudoku.constraint;
|
|||||||
import sudoku.structure.Block;
|
import sudoku.structure.Block;
|
||||||
import sudoku.structure.Sudoku;
|
import sudoku.structure.Sudoku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contrainte de bloc
|
||||||
|
*/
|
||||||
public class BlockConstraint implements IConstraint{
|
public class BlockConstraint implements IConstraint{
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -3,6 +3,9 @@ package sudoku.constraint;
|
|||||||
import sudoku.structure.Cell;
|
import sudoku.structure.Cell;
|
||||||
import sudoku.structure.Sudoku;
|
import sudoku.structure.Sudoku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contrainte de colonne
|
||||||
|
*/
|
||||||
public class ColumnConstraint implements IConstraint {
|
public class ColumnConstraint implements IConstraint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,9 +1,9 @@
|
|||||||
package sudoku.constraint;
|
package sudoku.constraint;
|
||||||
|
|
||||||
import java.util.List;
|
/**
|
||||||
|
* Enumération utilisée afin de simplifier l'affichage en graphique.
|
||||||
import sudoku.structure.Sudoku;
|
* Un sudoku peut tout de même contenir des contraintes qui ne sont pas dans cette énumération.
|
||||||
|
*/
|
||||||
public enum Constraint {
|
public enum Constraint {
|
||||||
|
|
||||||
Block("Bloc", new BlockConstraint()),
|
Block("Bloc", new BlockConstraint()),
|
||||||
@@ -19,14 +19,6 @@ public enum Constraint {
|
|||||||
this.displayName = displayName;
|
this.displayName = displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean canBePlaced(Sudoku s, int x, int y, int newValue) {
|
|
||||||
return getConstraint().canBePlaced(s, x, y, newValue);
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Integer> getPossibleSymbols(final Sudoku s, int x, int y) {
|
|
||||||
return getConstraint().getPossibleSymbols(s, x, y);
|
|
||||||
}
|
|
||||||
|
|
||||||
public String getDisplayName() {
|
public String getDisplayName() {
|
||||||
return displayName;
|
return displayName;
|
||||||
}
|
}
|
||||||
@@ -45,8 +37,4 @@ public enum Constraint {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String[] getConstraintNames() {
|
|
||||||
return constraintNames;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package sudoku.constraint;
|
|||||||
|
|
||||||
import sudoku.structure.Sudoku;
|
import sudoku.structure.Sudoku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contrainte de diagonale
|
||||||
|
*/
|
||||||
public class DiagonalConstraint implements IConstraint {
|
public class DiagonalConstraint implements IConstraint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,22 +1,12 @@
|
|||||||
package sudoku.constraint;
|
package sudoku.constraint;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
|
||||||
|
|
||||||
import sudoku.structure.Sudoku;
|
import sudoku.structure.Sudoku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Interface de base pour la déclaration d'une contrainte
|
||||||
|
* Elle est en théorie assez générique pour implémenter n'importe quelle
|
||||||
|
* contrainte
|
||||||
|
*/
|
||||||
public interface IConstraint {
|
public interface IConstraint {
|
||||||
|
|
||||||
boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex);
|
boolean canBePlaced(final Sudoku s, int x, int y, int newSymbolIndex);
|
||||||
|
|
||||||
default List<Integer> getPossibleSymbols(final Sudoku s, int x, int y) {
|
|
||||||
List<Integer> possibilities = new ArrayList<>();
|
|
||||||
for (int i = 0; i < s.getSize(); i++) {
|
|
||||||
if (canBePlaced(s, x, y, i)) {
|
|
||||||
possibilities.add(i);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return possibilities;
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -2,6 +2,9 @@ package sudoku.constraint;
|
|||||||
|
|
||||||
import sudoku.structure.Sudoku;
|
import sudoku.structure.Sudoku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Contrainte de ligne
|
||||||
|
*/
|
||||||
public class LineConstraint implements IConstraint {
|
public class LineConstraint implements IConstraint {
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
|
|||||||
@@ -1,71 +1,176 @@
|
|||||||
package sudoku.io;
|
package sudoku.io;
|
||||||
|
|
||||||
|
import gui.RenderableMultidoku;
|
||||||
|
import gui.constants.Symbols;
|
||||||
|
import sudoku.constraint.*;
|
||||||
|
import sudoku.solver.*;
|
||||||
|
import sudoku.structure.*;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Scanner;
|
import java.util.Scanner;
|
||||||
|
|
||||||
import sudoku.constraint.Constraint;
|
|
||||||
import sudoku.solver.RandomSolver;
|
|
||||||
import sudoku.structure.Difficulty;
|
|
||||||
import sudoku.structure.MultiDoku;
|
|
||||||
import sudoku.structure.Sudoku;
|
|
||||||
import sudoku.structure.SudokuFactory;
|
|
||||||
|
|
||||||
public class ConsoleInterface {
|
public class ConsoleInterface {
|
||||||
public Scanner reader = new Scanner(System.in);
|
private final Scanner reader = new Scanner(System.in);
|
||||||
|
|
||||||
public void start(){
|
/**
|
||||||
welcome();
|
* Début de la séquence console, affiche un message de bienvenue et les crédits
|
||||||
|
* du projet
|
||||||
|
* puis donne à l'utilisateur le choix de récupérer un doku sauvegardé
|
||||||
|
* ou d'en créer un nouveau.
|
||||||
|
*/
|
||||||
|
public void welcome() {
|
||||||
|
System.out.println("Welcome to our Sudoku Solver!");
|
||||||
|
System.out.println("This is the project of Melvyn Bauvent, Lilas Grenier and Simon Pribylski.");
|
||||||
|
|
||||||
|
System.out.println("Do you have a save sudoku you would like to continue? (y/n, default n)");
|
||||||
|
if (reader.next().equalsIgnoreCase("y")) {
|
||||||
|
useSavedDoku();
|
||||||
|
} else {
|
||||||
|
createDoku();
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demande à l'utilisateur un fichier de sauvegarde et le laisse jouer au
|
||||||
|
* MultiDoku.
|
||||||
|
* qui y est sauvegardé
|
||||||
|
*/
|
||||||
|
private void useSavedDoku() {
|
||||||
|
System.out.println("What save should we use? Please enter the save number.");
|
||||||
|
MultiDoku md = getSavedDoku();
|
||||||
|
int blockWidth = md.getSubGrid(0).getBlockWidth();
|
||||||
|
int blockHeight = md.getSubGrid(0).getBlocks().getFirst().getCells().size() / blockWidth;
|
||||||
|
List<String> listSymbols = pickSymbols(blockWidth * blockHeight);
|
||||||
|
System.out.println("This is the saved sudoku:");
|
||||||
|
showMultidoku(md, listSymbols, blockWidth, blockHeight);
|
||||||
|
do {
|
||||||
|
turn(md, listSymbols, blockWidth, blockHeight);
|
||||||
|
} while (!md.isSolved());
|
||||||
|
congrats();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demande à l'utilisateur les paramètres du doku à générer.
|
||||||
|
*/
|
||||||
|
private void createDoku() {
|
||||||
System.out.println("First of all, you need to tell me the size of the sudoku you want to generate.");
|
System.out.println("First of all, you need to tell me the size of the sudoku you want to generate.");
|
||||||
int width = getBlockWidth();
|
int width = getBlockWidth();
|
||||||
int height = getBlockHeight();
|
int height = getBlockHeight();
|
||||||
System.out.println("Your sudoku will have blocks of a " + width + " x " + height + " format.");
|
System.out.println("Your sudoku will have blocks of a " + width + " x " + height + " format.");
|
||||||
int numberOfSymbols = width * height;
|
int numberOfSymbols = width * height;
|
||||||
System.out.println("Would you like to pick the " + numberOfSymbols + " symbols from the sudoku? (y/n, default 'no' will use numbers)" );
|
List<String> listSymbols = pickSymbols(numberOfSymbols);
|
||||||
List<String> listSymbols = new ArrayList<>();
|
List<IConstraint> listConstraints = getListConstraints();
|
||||||
if(reader.next().equalsIgnoreCase("y")){
|
System.out.println("Now that we have the size of our sudoku, " +
|
||||||
pickSymbols(listSymbols, numberOfSymbols);
|
"would you rather have a single grid ('one', default), " +
|
||||||
}
|
|
||||||
else {
|
|
||||||
// TODO
|
|
||||||
System.out.println("Simon doit finir sa partie.");
|
|
||||||
assert false;
|
|
||||||
}
|
|
||||||
List<Constraint> listConstraints = getListConstraints();
|
|
||||||
|
|
||||||
|
|
||||||
System.out.println("Now that we have the size of our sudoku, would you rather have a single grid ('one', default), " +
|
|
||||||
"or a a multidoku composed of 5 subgrids ('multi') ?");
|
"or a a multidoku composed of 5 subgrids ('multi') ?");
|
||||||
List<Sudoku> subGrids = new ArrayList<>();
|
|
||||||
MultiDoku doku;
|
MultiDoku doku;
|
||||||
if (reader.next().equalsIgnoreCase("multi")) {
|
if (reader.next().equalsIgnoreCase("multi")) {
|
||||||
|
doku = SudokuFactory.createBasicXShapedMultidoku(width, height, listConstraints);
|
||||||
|
} else {
|
||||||
doku = SudokuFactory.createBasicEmptyRectangleDoku(width, height, listConstraints);
|
doku = SudokuFactory.createBasicEmptyRectangleDoku(width, height, listConstraints);
|
||||||
}
|
}
|
||||||
else {
|
|
||||||
doku = SudokuFactory.createBasicXShapedMultidoku(width, height, listConstraints);
|
|
||||||
}
|
|
||||||
System.out.println("Your sudoku will look like this:");
|
System.out.println("Your sudoku will look like this:");
|
||||||
// TODO printMultiDoku method not yet implemented
|
showMultidoku(doku, listSymbols, width, height);
|
||||||
SudokuPrinter.printMultiDoku(doku, width, height);
|
System.out.println(
|
||||||
System.out.println("We now will fill this sudoku.");
|
"You can now manually fill this sudoku ('fill'), or generate a playable one from this template ('generate', default):");
|
||||||
System.out.println("What level of difficulty would you like? ('very easy', 'easy', 'medium' (default), 'hard', 'full' (sudoku fully completed))");
|
if (reader.next().equalsIgnoreCase("fill")) {
|
||||||
|
findSolution(doku, listSymbols, width, height);
|
||||||
|
} else {
|
||||||
|
playableDoku(doku, listSymbols, width, height);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remplit un doku vide en fonction de la difficulté que l'utilisateur
|
||||||
|
* renseigne,
|
||||||
|
* et le laisse jouer.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku vide à remplir
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private void playableDoku(MultiDoku doku, List<String> listSymbols, int width, int height) {
|
||||||
|
System.out.println("We will now fill this sudoku.");
|
||||||
|
System.out.println("What level of difficulty would you like?" +
|
||||||
|
" ('very easy', 'easy', 'medium' (default), 'hard', 'full' (sudoku fully completed))");
|
||||||
String difficulty = reader.next().toLowerCase();
|
String difficulty = reader.next().toLowerCase();
|
||||||
if (difficulty.equals("full")) {
|
if (difficulty.equals("full")) {
|
||||||
generateFullDoku(doku);
|
generateFullDoku(doku);
|
||||||
}
|
|
||||||
else {
|
|
||||||
generatePartialDoku(doku, difficulty);
|
|
||||||
}
|
|
||||||
System.out.println("Here's your sudoku !");
|
System.out.println("Here's your sudoku !");
|
||||||
SudokuPrinter.printMultiDoku(doku, width, height);
|
showMultidoku(doku, listSymbols, width, height);
|
||||||
|
exit();
|
||||||
|
} else {
|
||||||
|
generatePartialDoku(doku, difficulty);
|
||||||
|
System.out.println("Here's your sudoku !");
|
||||||
|
showMultidoku(doku, listSymbols, width, height);
|
||||||
|
do {
|
||||||
|
turn(doku, listSymbols, width, height);
|
||||||
|
} while (!doku.isSolved());
|
||||||
|
congrats();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public void welcome(){
|
/**
|
||||||
System.out.println("Welcome to our Sudoku Solver!");
|
* Permet à l'utilisateur de remplir manuellement un sudoku vide, et de le
|
||||||
System.out.println("This is the project of Melvyn Bauvent, Lilas Grenier and Simon Priblyski.");
|
* remplir
|
||||||
|
* quand souhaité.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku vide à remplir
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private void findSolution(MultiDoku doku, List<String> listSymbols, int width, int height) {
|
||||||
|
do {
|
||||||
|
turn(doku, listSymbols, width, height);
|
||||||
|
} while (!doku.isSolved());
|
||||||
|
System.out.println("This doku can be solved like this :");
|
||||||
|
showMultidoku(doku, listSymbols, width, height);
|
||||||
|
exit();
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBlockWidth() {
|
/**
|
||||||
|
* Message de félicitation quand l'utilisateur a rempli son doku.
|
||||||
|
*/
|
||||||
|
private void congrats() {
|
||||||
|
System.out.println("Congrats! You've solved this sudoku! We hope this was fun! Let's play together again!");
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie un MultiDoku préenregistré, dont le numéro de sauvegarde est
|
||||||
|
* renseigné
|
||||||
|
* par l'utilisateur.
|
||||||
|
*
|
||||||
|
* @return Mutidoku, multidoku enregistré à la sauveagrde de numéro donné.
|
||||||
|
*/
|
||||||
|
private MultiDoku getSavedDoku() {
|
||||||
|
int nbSave;
|
||||||
|
MultiDoku md = null;
|
||||||
|
do {
|
||||||
|
nbSave = reader.nextInt();
|
||||||
|
if (nbSave == -1) {
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
|
try {
|
||||||
|
md = SudokuSerializer.getSavedMultiDoku(nbSave);
|
||||||
|
} catch (Exception e) {
|
||||||
|
System.out.println(
|
||||||
|
"There seems to be a problem with this save, please try again or write '-1' to abort.");
|
||||||
|
}
|
||||||
|
} while (md == null);
|
||||||
|
return md;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Demande à l'utilisateur la largeur d'un bloc du sudoku à générer.
|
||||||
|
*
|
||||||
|
* @return int, largeur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private int getBlockWidth() {
|
||||||
System.out.println("Width of a block: ");
|
System.out.println("Width of a block: ");
|
||||||
int widthBlock = reader.nextInt();
|
int widthBlock = reader.nextInt();
|
||||||
checkValidSize(widthBlock);
|
checkValidSize(widthBlock);
|
||||||
@@ -77,7 +182,12 @@ public class ConsoleInterface {
|
|||||||
return widthBlock;
|
return widthBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBlockHeight() {
|
/**
|
||||||
|
* Demande à l'utilisateur la hauteur d'un bloc du sudoku à générer.
|
||||||
|
*
|
||||||
|
* @return int, hauteur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private int getBlockHeight() {
|
||||||
System.out.println("Height of a block: ");
|
System.out.println("Height of a block: ");
|
||||||
int heightBlock = reader.nextInt();
|
int heightBlock = reader.nextInt();
|
||||||
checkValidSize(heightBlock);
|
checkValidSize(heightBlock);
|
||||||
@@ -89,11 +199,28 @@ public class ConsoleInterface {
|
|||||||
return heightBlock;
|
return heightBlock;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vérifie si la taille passée en paramètres est une taille valide.
|
||||||
|
*
|
||||||
|
* @param size int, longueur à vérifier
|
||||||
|
* @return true si size>0, false sinon.
|
||||||
|
*/
|
||||||
private Boolean checkValidSize(int size) {
|
private Boolean checkValidSize(int size) {
|
||||||
return (size > 0);
|
return (size > 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
private void pickSymbols(List<String> listSymbols, int numberOfSymbols) {
|
/**
|
||||||
|
* Permet à l'utilisateur de choisir les symboles qu'il souhaite utiliser pour
|
||||||
|
* l'affichage.
|
||||||
|
*
|
||||||
|
* @param numberOfSymbols int, nombre de symboles à choisir
|
||||||
|
* @return LIst~String~, liste des symboles à utiliser
|
||||||
|
*/
|
||||||
|
private List<String> pickSymbols(int numberOfSymbols) {
|
||||||
|
System.out.println("Would you like to pick the " + numberOfSymbols
|
||||||
|
+ " symbols from the sudoku? (y/n, default 'no')");
|
||||||
|
if (reader.next().equalsIgnoreCase("y")) {
|
||||||
|
List<String> listSymbols = new ArrayList<>();
|
||||||
System.out.println("You have chosen to pick your own symbols.");
|
System.out.println("You have chosen to pick your own symbols.");
|
||||||
for (int i = 0; i < numberOfSymbols; i++) {
|
for (int i = 0; i < numberOfSymbols; i++) {
|
||||||
System.out.println("Choose for the symbol number " + i + ": ");
|
System.out.println("Choose for the symbol number " + i + ": ");
|
||||||
@@ -105,24 +232,51 @@ public class ConsoleInterface {
|
|||||||
listSymbols.add(newSymbol);
|
listSymbols.add(newSymbol);
|
||||||
}
|
}
|
||||||
System.out.println("You chose the symbols: " + listSymbols.toString());
|
System.out.println("You chose the symbols: " + listSymbols.toString());
|
||||||
|
return listSymbols;
|
||||||
|
} else {
|
||||||
|
System.out.println(
|
||||||
|
"What existing sets of symbols do you want to use? Numbers ('n', default), letters ('l'), or emojis ('e', may not work on all consoles)?");
|
||||||
|
return switch (reader.next().toLowerCase()) {
|
||||||
|
case "l" -> Symbols.Letters.getSymbols();
|
||||||
|
case "e" -> Symbols.Emojis.getSymbols();
|
||||||
|
default -> Symbols.Numbers.getSymbols();
|
||||||
|
};
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private List<Constraint> getListConstraints() {
|
/**
|
||||||
List<Constraint> listConstraints = SudokuFactory.DEFAULT_CONSTRAINTS;
|
* Permet à l'utilisateur de choisir les contraintes qu'il souhaite utiliser
|
||||||
System.out.println("The sudoku have constraints of blocks, lines and columns. Would you like to add the diagonal constraints ? (y/n, default 'no')");
|
* pour son sudoku.
|
||||||
|
*
|
||||||
|
* @return List~IConstraint~, liste des contraintes à utiliser
|
||||||
|
*/
|
||||||
|
private List<IConstraint> getListConstraints() {
|
||||||
|
List<IConstraint> listConstraints = SudokuFactory.DEFAULT_CONSTRAINTS;
|
||||||
|
System.out.println(
|
||||||
|
"The sudoku have constraints of blocks, lines and columns. Would you like to add the diagonal constraints ? (y/n, default 'no')");
|
||||||
if (reader.next().equalsIgnoreCase("y")) {
|
if (reader.next().equalsIgnoreCase("y")) {
|
||||||
listConstraints.add(Constraint.Diagonal);
|
listConstraints.add(Constraint.Diagonal.getConstraint());
|
||||||
}
|
}
|
||||||
return listConstraints;
|
return listConstraints;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remplit un sudoku selon la difficulté passée en paramètre.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, doku vide à remplir selon la difficulté.
|
||||||
|
* @param difficultyName String, difficulté de résolution du doku à remplir.
|
||||||
|
*/
|
||||||
private void generatePartialDoku(MultiDoku doku, String difficultyName) {
|
private void generatePartialDoku(MultiDoku doku, String difficultyName) {
|
||||||
Difficulty difficulty;
|
Difficulty difficulty;
|
||||||
switch (difficultyName) {
|
switch (difficultyName) {
|
||||||
case "very easy": difficulty = Difficulty.VeryEasy;
|
case "very easy":
|
||||||
case "easy": difficulty = Difficulty.Easy;
|
difficulty = Difficulty.VeryEasy;
|
||||||
case "hard": difficulty = Difficulty.Hard;
|
case "easy":
|
||||||
default: difficulty = Difficulty.Medium;
|
difficulty = Difficulty.Easy;
|
||||||
|
case "hard":
|
||||||
|
difficulty = Difficulty.Hard;
|
||||||
|
default:
|
||||||
|
difficulty = Difficulty.Medium;
|
||||||
}
|
}
|
||||||
try {
|
try {
|
||||||
SudokuFactory.fillDoku(doku, difficulty);
|
SudokuFactory.fillDoku(doku, difficulty);
|
||||||
@@ -131,8 +285,251 @@ public class ConsoleInterface {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remplit entièrement le doku passé en paramètre.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, doku à remplir
|
||||||
|
*/
|
||||||
private void generateFullDoku(MultiDoku doku) {
|
private void generateFullDoku(MultiDoku doku) {
|
||||||
new RandomSolver().solve(doku);
|
new RandomSolver().solve(doku);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Affiche le doku passé en paramètre.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku à afficher
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private void showMultidoku(MultiDoku doku, List<String> listSymbols, int width, int height) {
|
||||||
|
showMultiDoku(RenderableMultidoku.fromMultidoku(doku), listSymbols, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Affiche le doku passé en paramètre.
|
||||||
|
*
|
||||||
|
* @param doku RenderableMultiDoku, MultiDoku à afficher
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private void showMultiDoku(RenderableMultidoku doku, List<String> listSymbols, int width, int height) {
|
||||||
|
SudokuPrinter.printMultiDokuWithIndex(doku, listSymbols, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet à l'utilisateur de sauvegarder l'état de son doku, soit dans un
|
||||||
|
* nouveau fichier
|
||||||
|
* de sauvegarde, soit en écrasant une sauvegarde précédente.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku à sauvegarder
|
||||||
|
*/
|
||||||
|
private void saveMultiDoku(MultiDoku doku) {
|
||||||
|
System.out.println("Number of the file to overwrite ('-1' or unused save file number to create a new save) :");
|
||||||
|
int n = reader.nextInt();
|
||||||
|
String path = SudokuSerializer.saveMultiDoku(doku, n);
|
||||||
|
System.out.println("The path to your save is: " + path);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Tour de jeu de l'utilisateur, présenté avec les choix de remplir une case du
|
||||||
|
* doku,
|
||||||
|
* de sauvegarder son état actuel dans un fichier de sauvegarde,
|
||||||
|
* de le résoudre tel qu'il est,
|
||||||
|
* ou de quitter l'application.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku actuel
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private void turn(MultiDoku doku, List<String> listSymbols, int width, int height) {
|
||||||
|
System.out.println(
|
||||||
|
"You can now put a number in a cell ('play', default), show a solution ('solution'), save the grid ('save') or exit the program ('exit').");
|
||||||
|
switch (reader.next()) {
|
||||||
|
case "save":
|
||||||
|
saveMultiDoku(doku);
|
||||||
|
break;
|
||||||
|
|
||||||
|
case "solution":
|
||||||
|
solve(doku, listSymbols, width, height);
|
||||||
|
break;
|
||||||
|
case "exit":
|
||||||
|
exit();
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
play(doku, listSymbols, width, height);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Applique l'étape passée en paramètre.
|
||||||
|
*
|
||||||
|
* @param step SolverStep, étape à appliquer
|
||||||
|
*/
|
||||||
|
private void applyStep(SolverStep step) {
|
||||||
|
step.getCell().setSymbolIndex(step.getNewValue());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'afficher une étape de résolution du doku complété.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku actuel
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
* @param step SolverStep, étape de résolution à afficher
|
||||||
|
* @return boolean, valant true si l'utilisateur veut afficher l'étape, false
|
||||||
|
* sinon
|
||||||
|
*/
|
||||||
|
private boolean showStep(MultiDoku doku, List<String> listSymbols, int width, int height, SolverStep step) {
|
||||||
|
System.out.println("Here is the step : \n");
|
||||||
|
showMultidoku(doku, listSymbols, width, height);
|
||||||
|
applyStep(step);
|
||||||
|
System.out.println("\nTurns into :\n");
|
||||||
|
showMultidoku(doku, listSymbols, width, height);
|
||||||
|
System.out.println("Do you want to see the next step ? (y/n, default n)");
|
||||||
|
return reader.next().equals("y");
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Permet d'afficher les étapes de résolution du doku complété si l'utilisateur
|
||||||
|
* le souhaite.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku actuel
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
* @param steps List~SolverStep~, liste des étapes de résolution
|
||||||
|
*/
|
||||||
|
private void showSolveSteps(MultiDoku doku, List<String> listSymbols, int width, int height,
|
||||||
|
List<SolverStep> steps) {
|
||||||
|
System.out.println("Would you like to see the steps of the solver ? (y/n, default n)");
|
||||||
|
doku.getStateManager().popState();
|
||||||
|
if (reader.next().equalsIgnoreCase("y")) {
|
||||||
|
int stepCount = 0;
|
||||||
|
while (stepCount < steps.size() && showStep(doku, listSymbols, width, height, steps.get(stepCount))) {
|
||||||
|
stepCount++;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Résout le doku en fonction du solver que choisit l'utilisateur.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku actuel
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private void solve(MultiDoku doku, List<String> listSymbols, int width, int height) {
|
||||||
|
System.out.println(
|
||||||
|
"Pick a solver to use : random ('random', default), human ('human') or mixed solver ('mixed').");
|
||||||
|
List<SolverStep> steps = new ArrayList<>();
|
||||||
|
doku.getStateManager().pushState();
|
||||||
|
switch (reader.next()) {
|
||||||
|
case "human":
|
||||||
|
new HumanSolver().solve(doku, steps);
|
||||||
|
break;
|
||||||
|
case "mixed":
|
||||||
|
new MixedSolver().solve(doku, steps);
|
||||||
|
break;
|
||||||
|
default:
|
||||||
|
new RandomSolver().solve(doku, steps);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
showMultidoku(doku, listSymbols, width, height);
|
||||||
|
showSolveSteps(doku, listSymbols, width, height, steps);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Remplissage d'une Cell du doku en fonction des coordonnées et du symboles que
|
||||||
|
* l'utilisateur choisit.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku actuel
|
||||||
|
* @param listSymbols List~String~, liste des symboles à utiliser
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
*/
|
||||||
|
private void play(MultiDoku doku, List<String> listSymbols, int width, int height) {
|
||||||
|
int x, y;
|
||||||
|
RenderableMultidoku rdoku = RenderableMultidoku.fromMultidoku(doku);
|
||||||
|
do {
|
||||||
|
System.out.println("Line of the cell to fill:");
|
||||||
|
y = reader.nextInt();
|
||||||
|
System.out.println("Column of the cell to fill:");
|
||||||
|
x = reader.nextInt();
|
||||||
|
} while (!isValidCoordinates(rdoku, width, height, x - 1, y - 1));
|
||||||
|
Cell cell = rdoku.getCell(x - 1, y - 1);
|
||||||
|
System.out.println("Character to put in the (" + x + ", " + y + ") cell:");
|
||||||
|
String character = reader.next();
|
||||||
|
while (!isValidSymbol(character, listSymbols, width * height)) {
|
||||||
|
System.out.println("This is not a valid symbol; try again:");
|
||||||
|
character = reader.next();
|
||||||
|
}
|
||||||
|
cell.setSymbolIndex(indexOfSymbol(character, listSymbols, width * height));
|
||||||
|
showMultiDoku(rdoku, listSymbols, width, height);
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vérifie que la Cell identifiée par les coordonées x et y dans le
|
||||||
|
* RenderableMultiDOku fourni
|
||||||
|
* existe et est modifiable.
|
||||||
|
*
|
||||||
|
* @param doku RenderableMultiDoku, MultiDoku actuel
|
||||||
|
* @param width int, largeur d'un bloc du sudoku
|
||||||
|
* @param height int, hauteur d'un bloc du sudoku
|
||||||
|
* @param x int, abscisse de la Cell à vérifier
|
||||||
|
* @param y int, ordonnée de la Cell à vérifier
|
||||||
|
* @return Boolean true si la Cell aux coordonéees données peut être modifiée,
|
||||||
|
* false sinon
|
||||||
|
*/
|
||||||
|
private boolean isValidCoordinates(RenderableMultidoku doku, int width, int height, int x, int y) {
|
||||||
|
Cell cell = doku.getCell(x, y);
|
||||||
|
return ((cell != null) && cell.isMutable());
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie l'index du symbole passé en paramètre.
|
||||||
|
*
|
||||||
|
* @param symbol String, symbole dont on veut l'index
|
||||||
|
* @param listSymbols List~String~, liste des symboles possibles
|
||||||
|
* @param nbSymbols int, nombre de symboles possibles
|
||||||
|
* @return int, index du symbole si celui-ci est valide, Cell.NOSYMBOL sinon.
|
||||||
|
*/
|
||||||
|
private int indexOfSymbol(String symbol, List<String> listSymbols, int nbSymbols) {
|
||||||
|
for (int i = 0; i < nbSymbols; i++) {
|
||||||
|
if (listSymbols.get(i).equals(symbol)) {
|
||||||
|
return i;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return Cell.NOSYMBOL;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vérifie que le symbol passé en paramètre est valide.
|
||||||
|
*
|
||||||
|
* @param symbol String, symbole dont on vérifie la validité
|
||||||
|
* @param listSymbols List~String~, liste des symboles possibles
|
||||||
|
* @param size int, nombre de symboles possibles
|
||||||
|
* @return boolean, valant true si le symbole est valide, false sinon.
|
||||||
|
*/
|
||||||
|
private boolean isValidSymbol(String symbol, List<String> listSymbols, int size) {
|
||||||
|
for (int i = 0; i < size; i++) {
|
||||||
|
if (listSymbols.get(i).equals(symbol)) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Affiche un message d'aurevoir et ferme l'application.
|
||||||
|
*/
|
||||||
|
private void exit() {
|
||||||
|
System.out.println("Thank you for playing!");
|
||||||
|
System.exit(0);
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,7 +0,0 @@
|
|||||||
package sudoku.io;
|
|
||||||
|
|
||||||
public class SudokuFile {
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -1,18 +1,39 @@
|
|||||||
package sudoku.io;
|
package sudoku.io;
|
||||||
|
|
||||||
|
import gui.RenderableMultidoku;
|
||||||
|
import gui.constants.Symbols;
|
||||||
|
import sudoku.structure.Cell;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.Sudoku;
|
import sudoku.structure.Sudoku;
|
||||||
|
|
||||||
public class SudokuPrinter {
|
import java.util.List;
|
||||||
|
|
||||||
public static void printRectangleSudoku(final Sudoku s, int blockWidth, int blockHeight) {
|
public class SudokuPrinter {
|
||||||
|
public static final String ANSI_RESET = "\u001B[0m";
|
||||||
|
public static final String ANSI_RED = "\u001B[31m";
|
||||||
|
public static final String ANSI_GREEN = "\u001B[32m";
|
||||||
|
public static final String ANSI_YELLOW = "\u001B[33m";
|
||||||
|
public static final String ANSI_BLUE = "\u001B[34m";
|
||||||
|
public static final String ANSI_PURPLE = "\u001B[35m";
|
||||||
|
public static final String ANSI_CYAN = "\u001B[36m";
|
||||||
|
|
||||||
|
public static void printRectangleSudoku(final Sudoku s, int blockWidth, int blockHeight, Symbols symbols) {
|
||||||
|
printRectangleSudoku(s, blockWidth, blockHeight, symbols.getSymbols());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printRectangleSudoku(final Sudoku s, int blockWidth, int blockHeight, List<String> listSymbols) {
|
||||||
for (int y = 0; y < s.getSize(); y++) {
|
for (int y = 0; y < s.getSize(); y++) {
|
||||||
if (y % blockHeight == 0 && y > 0) {
|
if (y % blockHeight == 0 && y > 0) {
|
||||||
System.out.println();
|
System.out.println();
|
||||||
}
|
}
|
||||||
StringBuilder line = new StringBuilder("[ ");
|
StringBuilder line = new StringBuilder("[ ");
|
||||||
for (int x = 0; x < s.getSize(); x++) {
|
for (int x = 0; x < s.getSize(); x++) {
|
||||||
line.append((s.getCell(x, y).getSymbolIndex() + 1)).append(" ");
|
Cell c = s.getCell(x, y);
|
||||||
|
if (c.getSymbolIndex() == Cell.NOSYMBOL) {
|
||||||
|
line.append(" ");
|
||||||
|
} else {
|
||||||
|
line.append(listSymbols.get(c.getSymbolIndex())).append(" ");
|
||||||
|
}
|
||||||
if (x % blockWidth == blockWidth - 1 && x != blockWidth * blockHeight - 1) {
|
if (x % blockWidth == blockWidth - 1 && x != blockWidth * blockHeight - 1) {
|
||||||
line.append("| ");
|
line.append("| ");
|
||||||
}
|
}
|
||||||
@@ -22,7 +43,118 @@ public class SudokuPrinter {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public static String toStringRectangleSudoku(final Sudoku s, int blockWidth, int blockHeight) {
|
public static void printRectangleSudokuWithIndex(final Sudoku s, int blockWidth, int blockHeight,
|
||||||
|
List<String> listSymbols) {
|
||||||
|
StringBuilder header = new StringBuilder("");
|
||||||
|
header.append(" ");
|
||||||
|
for (int x = 0; x < blockWidth*blockHeight; x++) {
|
||||||
|
header.append(x + 1).append(" ");
|
||||||
|
if (x % blockWidth == blockWidth - 1 && x != blockWidth * blockHeight - 1) {
|
||||||
|
header.append(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
header.append("\n");
|
||||||
|
System.out.println(header);
|
||||||
|
for (int y = 0; y < s.getSize(); y++) {
|
||||||
|
if (y % blockHeight == 0 && y > 0) {
|
||||||
|
System.out.println();
|
||||||
|
}
|
||||||
|
StringBuilder line = new StringBuilder(y + 1);
|
||||||
|
line.append(" [ ");
|
||||||
|
for (int x = 0; x < s.getSize(); x++) {
|
||||||
|
Cell c = s.getCell(x, y);
|
||||||
|
if (c.getSymbolIndex() == Cell.NOSYMBOL) {
|
||||||
|
line.append(" ");
|
||||||
|
} else {
|
||||||
|
line.append(listSymbols.get(c.getSymbolIndex())).append(" ");
|
||||||
|
}
|
||||||
|
if (x % blockWidth == blockWidth - 1 && x != blockWidth * blockHeight - 1) {
|
||||||
|
line.append("| ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
line.append("]");
|
||||||
|
System.out.println(line);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printMultiDoku(final RenderableMultidoku rm, Symbols symbols, int blockWidth, int blockHeight) {
|
||||||
|
printMultiDoku(rm, symbols.getSymbols(), blockWidth, blockHeight);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printMultiDoku(final RenderableMultidoku rm, List<String> listSymbols, int blockWidth,
|
||||||
|
int blockHeight) {
|
||||||
|
StringBuilder line = new StringBuilder("\n");
|
||||||
|
int nBlockInWidth = rm.getWidth() / blockWidth;
|
||||||
|
for (int y = 0; y < rm.getHeight(); y++) {
|
||||||
|
if (y % blockHeight == 0) {
|
||||||
|
line.append("__".repeat(Math.max(0, rm.getWidth() + nBlockInWidth))).append("_\n");
|
||||||
|
}
|
||||||
|
line.append("[ ");
|
||||||
|
for (int x = 0; x < rm.getWidth(); x++) {
|
||||||
|
if (x % blockWidth == 0 && x > 0) {
|
||||||
|
line.append("| ");
|
||||||
|
}
|
||||||
|
Cell cell = rm.getCell(x, y);
|
||||||
|
if (cell != null) {
|
||||||
|
if (cell.getSymbolIndex() == Cell.NOSYMBOL) {
|
||||||
|
line.append("- ");
|
||||||
|
} else {
|
||||||
|
line.append(listSymbols.get(cell.getSymbolIndex())).append(" ");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
line.append(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
line.append("]\n");
|
||||||
|
}
|
||||||
|
line.append("__".repeat(Math.max(0, rm.getWidth() + nBlockInWidth))).append("_\n");
|
||||||
|
System.out.println(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static void printMultiDokuWithIndex(final RenderableMultidoku rm, List<String> listSymbols, int blockWidth,
|
||||||
|
int blockHeight) {
|
||||||
|
StringBuilder line = new StringBuilder("\n");
|
||||||
|
line.append(" ");
|
||||||
|
for (int x = 0; x < rm.getWidth(); x++) {
|
||||||
|
line.append(x + 1).append(" ");
|
||||||
|
if (x % blockWidth == blockWidth - 1 && x != blockWidth * blockHeight - 1) {
|
||||||
|
line.append(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
line.append("\n");
|
||||||
|
int nBlockInWidth = rm.getWidth() / blockWidth;
|
||||||
|
for (int y = 0; y < rm.getHeight(); y++) {
|
||||||
|
if (y % blockHeight == 0) {
|
||||||
|
line.append(" ").append("__".repeat(Math.max(0, rm.getWidth() + nBlockInWidth))).append("_\n");
|
||||||
|
}
|
||||||
|
line.append(y+1).append(" [ ");
|
||||||
|
for (int x = 0; x < rm.getWidth(); x++) {
|
||||||
|
if (x % blockWidth == 0 && x > 0) {
|
||||||
|
line.append("| ");
|
||||||
|
}
|
||||||
|
Cell cell = rm.getCell(x, y);
|
||||||
|
if (cell != null) {
|
||||||
|
if (cell.getSymbolIndex() == Cell.NOSYMBOL) {
|
||||||
|
line.append("- ");
|
||||||
|
} else {
|
||||||
|
line.append(listSymbols.get(cell.getSymbolIndex())).append(" ");
|
||||||
|
}
|
||||||
|
} else {
|
||||||
|
line.append(" ");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
line.append("]\n");
|
||||||
|
}
|
||||||
|
line.append(" ").append("__".repeat(Math.max(0, rm.getWidth() + nBlockInWidth))).append("_\n");
|
||||||
|
System.out.println(line);
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toStringRectangleSudoku(final Sudoku s, int blockWidth, int blockHeight, Symbols symbols) {
|
||||||
|
return toStringRectangleSudoku(s, blockWidth, blockHeight, symbols.getSymbols());
|
||||||
|
}
|
||||||
|
|
||||||
|
public static String toStringRectangleSudoku(final Sudoku s, int blockWidth, int blockHeight,
|
||||||
|
List<String> listSymbols) {
|
||||||
StringBuilder result = new StringBuilder();
|
StringBuilder result = new StringBuilder();
|
||||||
for (int y = 0; y < s.getSize(); y++) {
|
for (int y = 0; y < s.getSize(); y++) {
|
||||||
// Ajouter une ligne vide entre les blocs horizontaux
|
// Ajouter une ligne vide entre les blocs horizontaux
|
||||||
@@ -32,7 +164,12 @@ public class SudokuPrinter {
|
|||||||
StringBuilder line = new StringBuilder("[ ");
|
StringBuilder line = new StringBuilder("[ ");
|
||||||
for (int x = 0; x < s.getSize(); x++) {
|
for (int x = 0; x < s.getSize(); x++) {
|
||||||
// Ajouter la valeur de la cellule
|
// Ajouter la valeur de la cellule
|
||||||
line.append((s.getCell(x, y).getSymbolIndex() + 1)).append(" ");
|
Cell cell = s.getCell(x, y);
|
||||||
|
if (cell.getSymbolIndex() == Cell.NOSYMBOL) {
|
||||||
|
line.append(" ");
|
||||||
|
} else {
|
||||||
|
line.append(listSymbols.get(cell.getSymbolIndex())).append(" ");
|
||||||
|
}
|
||||||
|
|
||||||
// Ajouter un séparateur vertical entre les blocs
|
// Ajouter un séparateur vertical entre les blocs
|
||||||
if (x % blockWidth == blockWidth - 1 && x != s.getSize() - 1) {
|
if (x % blockWidth == blockWidth - 1 && x != s.getSize() - 1) {
|
||||||
@@ -45,7 +182,21 @@ public class SudokuPrinter {
|
|||||||
return result.toString();
|
return result.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void printMultiDoku(final MultiDoku doku, int blockWidth, int blockHeight){
|
public static void printMultiDoku(final MultiDoku doku, int blockWidth, int blockHeight, Symbols symbols) {
|
||||||
// TODO
|
if (doku.getNbSubGrids() == 1) {
|
||||||
|
printRectangleSudoku(doku.getSubGrid(0), blockWidth, blockHeight, symbols);
|
||||||
|
} else {
|
||||||
|
printMultiDoku(RenderableMultidoku.fromMultidoku(doku), symbols, blockWidth, blockHeight);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static void printMultiDokuWithIndex(final MultiDoku doku, int blockWidth, int blockHeight, Symbols symbols) {
|
||||||
|
if (doku.getNbSubGrids() == 1) {
|
||||||
|
printRectangleSudokuWithIndex(doku.getSubGrid(0), blockWidth, blockHeight, symbols.getSymbols());
|
||||||
|
} else {
|
||||||
|
printMultiDokuWithIndex(RenderableMultidoku.fromMultidoku(doku), symbols.getSymbols(), blockWidth,
|
||||||
|
blockHeight);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
|
|||||||
@@ -1,15 +0,0 @@
|
|||||||
package sudoku.io;
|
|
||||||
|
|
||||||
public class SudokuSave {
|
|
||||||
|
|
||||||
public static enum AlgoResolution {
|
|
||||||
Backtracking,
|
|
||||||
NoBacktring
|
|
||||||
}
|
|
||||||
|
|
||||||
// private final MultiDoku sudoku;
|
|
||||||
// private final AlgoResolution resolution;
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
}
|
|
||||||
@@ -12,13 +12,23 @@ import org.json.JSONArray;
|
|||||||
import org.json.JSONObject;
|
import org.json.JSONObject;
|
||||||
|
|
||||||
import sudoku.constraint.Constraint;
|
import sudoku.constraint.Constraint;
|
||||||
|
import sudoku.constraint.IConstraint;
|
||||||
import sudoku.structure.Block;
|
import sudoku.structure.Block;
|
||||||
import sudoku.structure.Cell;
|
import sudoku.structure.Cell;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.Sudoku;
|
import sudoku.structure.Sudoku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Classe permettant d'effectuer des opérations sur les sudokus afin de les
|
||||||
|
* charger/sauvegarder
|
||||||
|
*/
|
||||||
public class SudokuSerializer {
|
public class SudokuSerializer {
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Convertit un sudoku en object JSON
|
||||||
|
* @param multidoku le sudoku à sérialiser
|
||||||
|
* @return le JSON
|
||||||
|
*/
|
||||||
public static JSONObject serializeSudoku(final MultiDoku multidoku) {
|
public static JSONObject serializeSudoku(final MultiDoku multidoku) {
|
||||||
List<Cell> cellIds = new ArrayList<>();
|
List<Cell> cellIds = new ArrayList<>();
|
||||||
List<Block> blockIds = new ArrayList<>();
|
List<Block> blockIds = new ArrayList<>();
|
||||||
@@ -99,8 +109,17 @@ public class SudokuSerializer {
|
|||||||
|
|
||||||
// serialize constraints
|
// serialize constraints
|
||||||
|
|
||||||
for (Constraint cons : sudoku.getConstraints()) {
|
for (IConstraint cons : sudoku.getConstraints()) {
|
||||||
constraintsJsonArray.put(cons.ordinal());
|
boolean constraintSerialized = false;
|
||||||
|
for (Constraint enumCons : Constraint.values()) {
|
||||||
|
if (cons.getClass().isAssignableFrom(enumCons.getConstraint().getClass())) {
|
||||||
|
constraintSerialized = true;
|
||||||
|
constraintsJsonArray.put(enumCons.ordinal());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
if (!constraintSerialized) {
|
||||||
|
System.out.println("La contrainte " + cons.getClass() + " n'a pas pu être sérialisé !");
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
jsonSudoku.put("constraints", constraintsJsonArray);
|
jsonSudoku.put("constraints", constraintsJsonArray);
|
||||||
@@ -117,6 +136,14 @@ public class SudokuSerializer {
|
|||||||
return jsonRoot;
|
return jsonRoot;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Crée le répertoire save afin d'y sauvegarder les sudokus
|
||||||
|
*/
|
||||||
|
private static void createSaveDir() {
|
||||||
|
File f = new File("save");
|
||||||
|
f.mkdir();
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Save a serialized MultiDoku in a JSON file.
|
* Save a serialized MultiDoku in a JSON file.
|
||||||
*
|
*
|
||||||
@@ -124,17 +151,15 @@ public class SudokuSerializer {
|
|||||||
* @return String, the path of the save.
|
* @return String, the path of the save.
|
||||||
*/
|
*/
|
||||||
public static String saveMultiDoku(final MultiDoku doku) {
|
public static String saveMultiDoku(final MultiDoku doku) {
|
||||||
|
createSaveDir();
|
||||||
JSONObject jsonRoot = serializeSudoku(doku);
|
JSONObject jsonRoot = serializeSudoku(doku);
|
||||||
|
|
||||||
File f = new File("save", "save.json");
|
File f = new File("save", "save.json");
|
||||||
int i = 0;
|
int i = 0;
|
||||||
|
|
||||||
while (f.exists()) {
|
while (f.exists()) {
|
||||||
String newName = "save-" + ++i + ".json";
|
String newName = "save-" + ++i + ".json";
|
||||||
f = new File("save", newName);
|
f = new File("save", newName);
|
||||||
}
|
}
|
||||||
|
|
||||||
try (FileWriter file = new FileWriter(f)) {
|
try (FileWriter file = new FileWriter(f)) {
|
||||||
file.write(jsonRoot.toString(3));
|
file.write(jsonRoot.toString(3));
|
||||||
} catch (IOException e) {
|
} catch (IOException e) {
|
||||||
@@ -143,11 +168,31 @@ public class SudokuSerializer {
|
|||||||
return f.getAbsolutePath();
|
return f.getAbsolutePath();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public static String saveMultiDoku(final MultiDoku doku, final int saveToOverwrite) {
|
||||||
|
createSaveDir();
|
||||||
|
File f;
|
||||||
|
if (saveToOverwrite == 0) {
|
||||||
|
f = new File("save", "save.json");
|
||||||
|
} else {
|
||||||
|
f = new File("save", "save-" + saveToOverwrite + ".json");
|
||||||
|
}
|
||||||
|
if (!f.exists()) {
|
||||||
|
return saveMultiDoku(doku);
|
||||||
|
} else {
|
||||||
|
try (FileWriter file = new FileWriter(f)) {
|
||||||
|
file.write(serializeSudoku(doku).toString(3));
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
}
|
||||||
|
return f.getAbsolutePath();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Get a MultiDoku from a pre-existing json save file.
|
* Get a MultiDoku from a pre-existing json save file.
|
||||||
*
|
*
|
||||||
* @param numberSave int, number of the save file to open.
|
* @param numberSave int, number of the save file to open.
|
||||||
* @return MultiDoku, MultoDoku contained in the file.
|
* @return MultiDoku, MultiDoku contained in the file.
|
||||||
* @throws Exception when the given save file does not exist.
|
* @throws Exception when the given save file does not exist.
|
||||||
*/
|
*/
|
||||||
public static MultiDoku getSavedMultiDoku(int numberSave) throws Exception {
|
public static MultiDoku getSavedMultiDoku(int numberSave) throws Exception {
|
||||||
@@ -169,11 +214,21 @@ public class SudokuSerializer {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Construit un sudoku à partir d'un String en JSON
|
||||||
|
* @param json le sudoku sérialisé
|
||||||
|
* @return le sudoku désérialisé
|
||||||
|
*/
|
||||||
public static MultiDoku deserializeSudoku(final String json) {
|
public static MultiDoku deserializeSudoku(final String json) {
|
||||||
JSONObject jsonRoot = new JSONObject(json);
|
JSONObject jsonRoot = new JSONObject(json);
|
||||||
return deserializeSudoku(jsonRoot);
|
return deserializeSudoku(jsonRoot);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Désérialise un sudoku d'un objet JSON
|
||||||
|
* @param jsonObject l'objet à désérialiser
|
||||||
|
* @return le sudoku correspondant
|
||||||
|
*/
|
||||||
public static MultiDoku deserializeSudoku(final JSONObject jsonObject) {
|
public static MultiDoku deserializeSudoku(final JSONObject jsonObject) {
|
||||||
|
|
||||||
List<Cell> cells = new ArrayList<>();
|
List<Cell> cells = new ArrayList<>();
|
||||||
@@ -217,7 +272,7 @@ public class SudokuSerializer {
|
|||||||
|
|
||||||
List<Cell> sudokuCells = new ArrayList<>();
|
List<Cell> sudokuCells = new ArrayList<>();
|
||||||
List<Block> sudokuBlocks = new ArrayList<>();
|
List<Block> sudokuBlocks = new ArrayList<>();
|
||||||
List<Constraint> sudokuConstraints = new ArrayList<>();
|
List<IConstraint> sudokuConstraints = new ArrayList<>();
|
||||||
|
|
||||||
for (int j = 0; j < sudokuCellsJsonArray.length(); j++) {
|
for (int j = 0; j < sudokuCellsJsonArray.length(); j++) {
|
||||||
int cellID = sudokuCellsJsonArray.getInt(j);
|
int cellID = sudokuCellsJsonArray.getInt(j);
|
||||||
@@ -231,7 +286,7 @@ public class SudokuSerializer {
|
|||||||
|
|
||||||
for (int j = 0; j < sudokuConstraintsJsonArray.length(); j++) {
|
for (int j = 0; j < sudokuConstraintsJsonArray.length(); j++) {
|
||||||
int constraintID = sudokuConstraintsJsonArray.getInt(j);
|
int constraintID = sudokuConstraintsJsonArray.getInt(j);
|
||||||
sudokuConstraints.add(Constraint.values()[constraintID]);
|
sudokuConstraints.add(Constraint.values()[constraintID].getConstraint());
|
||||||
}
|
}
|
||||||
|
|
||||||
Sudoku s = new Sudoku(sudokuCells, sudokuBlocks, sudokuConstraints);
|
Sudoku s = new Sudoku(sudokuCells, sudokuBlocks, sudokuConstraints);
|
||||||
|
|||||||
@@ -15,7 +15,7 @@ public class BacktrackingSolver implements Solver {
|
|||||||
* @return boolean, valant true si le MultiDoku est résolu, false sinon.
|
* @return boolean, valant true si le MultiDoku est résolu, false sinon.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean solve(MultiDoku doku) {
|
public boolean solve(MultiDoku doku, List<SolverStep> steps) {
|
||||||
if (Thread.interrupted())
|
if (Thread.interrupted())
|
||||||
throw new CancellationException("User wants to stop the solver");
|
throw new CancellationException("User wants to stop the solver");
|
||||||
|
|
||||||
@@ -34,14 +34,14 @@ public class BacktrackingSolver implements Solver {
|
|||||||
}
|
}
|
||||||
|
|
||||||
for (int symbol : possibleSymbols) {
|
for (int symbol : possibleSymbols) {
|
||||||
|
|
||||||
cellToFill.setSymbolIndex(symbol);
|
cellToFill.setSymbolIndex(symbol);
|
||||||
if (this.solve(doku)) {
|
addStep(cellToFill, steps);
|
||||||
|
if (this.solve(doku, steps)) {
|
||||||
return true;
|
return true;
|
||||||
} else {
|
} else {
|
||||||
cellToFill.setSymbolIndex(Cell.NOSYMBOL);
|
cellToFill.setSymbolIndex(Cell.NOSYMBOL);
|
||||||
|
addStep(cellToFill, steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|||||||
59
app/src/main/java/sudoku/solver/HintHelper.java
Normal file
59
app/src/main/java/sudoku/solver/HintHelper.java
Normal file
@@ -0,0 +1,59 @@
|
|||||||
|
package sudoku.solver;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
import java.util.Random;
|
||||||
|
|
||||||
|
import sudoku.structure.Cell;
|
||||||
|
import sudoku.structure.MultiDoku;
|
||||||
|
|
||||||
|
public class HintHelper {
|
||||||
|
|
||||||
|
public record Hint(Cell cell, int newValue) {}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Si possible, donne un indice sur la résolution du doku passé en paramètre,
|
||||||
|
* selon la méthode de résolution rensaignée.
|
||||||
|
* @param doku MultiDoku, multidoku pour lequel on veut un indice
|
||||||
|
* @param solver Solver, méthode de résolution souhaitée
|
||||||
|
* @return Hint, indice sur une case à remplir, valant null si le doku n'a pas de solution.
|
||||||
|
*/
|
||||||
|
public static Hint getHint(MultiDoku doku, Solver solver) {
|
||||||
|
doku.getStateManager().pushState();
|
||||||
|
doku.clearMutableCells();
|
||||||
|
if (!solver.solve(doku))
|
||||||
|
return null;
|
||||||
|
var stateSolved = doku.getStateManager().popAndGetState();
|
||||||
|
// find differences
|
||||||
|
Map<Cell, Integer> newValues = new HashMap<>();
|
||||||
|
for (var entry : stateSolved.entrySet()) {
|
||||||
|
Cell cell = entry.getKey();
|
||||||
|
// we only want the cells that can be filled
|
||||||
|
if (!cell.isMutable())
|
||||||
|
continue;
|
||||||
|
int oldValue = cell.getSymbolIndex();
|
||||||
|
int newValue = stateSolved.get(cell);
|
||||||
|
if (oldValue == newValue)
|
||||||
|
continue;
|
||||||
|
// we have to clear the cell
|
||||||
|
if (newValue == Cell.NOSYMBOL)
|
||||||
|
return new Hint(cell, newValue);
|
||||||
|
// we have to change the cell value
|
||||||
|
if (oldValue != Cell.NOSYMBOL)
|
||||||
|
return new Hint(cell, newValue);
|
||||||
|
|
||||||
|
// there is a valid move
|
||||||
|
newValues.put(cell, newValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
// this is too complex just for fetching a random entry, but whatever ...
|
||||||
|
Random r = new Random();
|
||||||
|
List<Cell> cells = new ArrayList<>(newValues.keySet());
|
||||||
|
Cell randomCell = cells.get(r.nextInt(cells.size()));
|
||||||
|
int randomCellValue = newValues.get(randomCell);
|
||||||
|
return new Hint(randomCell, randomCellValue);
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,13 +1,9 @@
|
|||||||
package sudoku.solver;
|
package sudoku.solver;
|
||||||
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.concurrent.CancellationException;
|
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import sudoku.io.SudokuPrinter;
|
|
||||||
import sudoku.structure.Cell;
|
import sudoku.structure.Cell;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.Sudoku;
|
|
||||||
|
|
||||||
public class HumanSolver implements Solver {
|
public class HumanSolver implements Solver {
|
||||||
|
|
||||||
@@ -18,38 +14,26 @@ public class HumanSolver implements Solver {
|
|||||||
* @return boolean, valant true si le MultiDoku est résolu, false sinon.
|
* @return boolean, valant true si le MultiDoku est résolu, false sinon.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean solve(MultiDoku doku) {
|
public boolean solve(MultiDoku doku, List<SolverStep> steps) {
|
||||||
if (Thread.interrupted())
|
while (!doku.isSolved()) {
|
||||||
throw new CancellationException("User wants to stop the solver");
|
boolean filledCell = false;
|
||||||
|
for (Cell cell : doku.getCells()) {
|
||||||
|
if (!cell.isMutable() || !cell.isEmpty())
|
||||||
|
continue;
|
||||||
|
|
||||||
Sudoku sudoku = doku.getSubGrid(0);
|
List<Integer> possibleSymbols = cell.getPossibleSymbols();
|
||||||
logger.log(Level.FINE,
|
if (possibleSymbols.size() == 1) {
|
||||||
'\n' + SudokuPrinter.toStringRectangleSudoku(sudoku,
|
cell.setSymbolIndex(possibleSymbols.getFirst());
|
||||||
sudoku.getBlockWidth() == 0 ? sudoku.getSize() : sudoku.getBlockWidth(),
|
addStep(cell, steps);
|
||||||
sudoku.getBlockWidth() == 0 ? sudoku.getSize() : sudoku.getSize() / sudoku.getBlockWidth()));
|
filledCell = true;
|
||||||
|
|
||||||
if (doku.isSolved()) {
|
|
||||||
return true;
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
List<Cell> cellsToFill = doku.getEmptyCells();
|
// on ne peut plus remplir de cases, on abandonne
|
||||||
if (cellsToFill.isEmpty()) {
|
if (!filledCell)
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Cell cellToFill : cellsToFill) {
|
return true;
|
||||||
|
|
||||||
List<Integer> possibleSymbols = cellToFill.getPossibleSymbols();
|
|
||||||
if (possibleSymbols.size() != 1) {
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
cellToFill.setSymbolIndex(possibleSymbols.getFirst());
|
|
||||||
|
|
||||||
return this.solve(doku);
|
|
||||||
}
|
|
||||||
|
|
||||||
return doku.isSolved();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,79 +1,87 @@
|
|||||||
package sudoku.solver;
|
package sudoku.solver;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
|
||||||
import java.util.concurrent.CancellationException;
|
import java.util.concurrent.CancellationException;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import sudoku.io.SudokuPrinter;
|
|
||||||
import sudoku.structure.Cell;
|
import sudoku.structure.Cell;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.Sudoku;
|
|
||||||
|
|
||||||
public class MixedSolver implements Solver {
|
public class MixedSolver implements Solver {
|
||||||
|
|
||||||
|
private List<Cell> findCellsToBacktrack(MultiDoku doku, int maxPossibilities) {
|
||||||
|
List<Cell> cells = new ArrayList<>();
|
||||||
|
for (Cell cell : doku.getCells()) {
|
||||||
|
if (!cell.isMutable() || !cell.isEmpty())
|
||||||
|
continue;
|
||||||
|
|
||||||
|
List<Integer> possibleSymbols = cell.getPossibleSymbols();
|
||||||
|
if (possibleSymbols.size() == maxPossibilities) {
|
||||||
|
cells.add(cell);
|
||||||
|
}
|
||||||
|
|
||||||
|
// une cellule nous empêche de continuer
|
||||||
|
if (possibleSymbols.size() == 0)
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
return cells;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Résout le MultiDoku passé en paramètre, avec règles de déduction et
|
* Résout le MultiDoku passé en paramètre, avec règles de déduction et
|
||||||
* backtracking.
|
* backtracking.
|
||||||
*
|
*
|
||||||
* @param doku MultiDoku, MultiDoku à résoudre.
|
* @param doku MultiDoku, MultiDoku à résoudre.
|
||||||
* @param rand Random, pour tester aléatoirement les symboles, lors du
|
|
||||||
* backtracking.
|
|
||||||
* @return boolean, valant true si le MultiDoku est résolu, false sinon.
|
* @return boolean, valant true si le MultiDoku est résolu, false sinon.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean solve(MultiDoku doku) {
|
public boolean solve(MultiDoku doku, List<SolverStep> steps) {
|
||||||
Random rand = new Random();
|
|
||||||
|
|
||||||
if (Thread.interrupted()) {
|
if (Thread.interrupted()) {
|
||||||
throw new CancellationException("User wants to stop the solver");
|
throw new CancellationException("User wants to stop the solver");
|
||||||
}
|
}
|
||||||
|
|
||||||
Sudoku sudoku = doku.getSubGrid(0);
|
if (doku.isSolved())
|
||||||
logger.log(Level.FINE,
|
|
||||||
'\n' + SudokuPrinter.toStringRectangleSudoku(
|
|
||||||
sudoku,
|
|
||||||
sudoku.getBlockWidth() == 0 ? sudoku.getSize() : sudoku.getBlockWidth(),
|
|
||||||
sudoku.getBlockWidth() == 0 ? sudoku.getSize() : sudoku.getSize() / sudoku.getBlockWidth()));
|
|
||||||
|
|
||||||
if (doku.isSolved()) {
|
|
||||||
return true;
|
return true;
|
||||||
}
|
|
||||||
|
|
||||||
List<Cell> cellsToFill = doku.getEmptyCells();
|
if (findCellsToBacktrack(doku, 0) == null)
|
||||||
if (cellsToFill.isEmpty()) {
|
|
||||||
return false;
|
return false;
|
||||||
}
|
|
||||||
|
|
||||||
// Règles de déduction
|
for (Cell cell : doku.getCells()) {
|
||||||
for (Cell cellToFill : cellsToFill) {
|
if (!cell.isMutable() || !cell.isEmpty())
|
||||||
|
|
||||||
List<Integer> possibleSymbols = cellToFill.getPossibleSymbols();
|
|
||||||
if (possibleSymbols.size() != 1) {
|
|
||||||
continue;
|
continue;
|
||||||
|
|
||||||
|
List<Integer> possibleSymbols = cell.getPossibleSymbols();
|
||||||
|
if (possibleSymbols.size() == 1) {
|
||||||
|
cell.setSymbolIndex(possibleSymbols.getFirst());
|
||||||
|
addStep(cell, steps);
|
||||||
|
if (solve(doku, steps))
|
||||||
|
return true;
|
||||||
|
cell.setSymbolIndex(Cell.NOSYMBOL);
|
||||||
|
addStep(cell, steps);
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
cellToFill.setSymbolIndex(possibleSymbols.getFirst());
|
|
||||||
|
|
||||||
return this.solve(doku);
|
|
||||||
}
|
}
|
||||||
|
// on ne peut plus remplir de cases, on tente de backtrack
|
||||||
// Si ça ne marche pas
|
int maxPossibilities = 2;
|
||||||
// On fait du backtracking
|
List<Cell> backtrackCells = new ArrayList<>();
|
||||||
Cell cellToFill = doku.getRandomEmptyCell(rand);
|
while (backtrackCells.isEmpty()) {
|
||||||
List<Integer> possibleSymbols = cellToFill.getPossibleSymbols();
|
backtrackCells = findCellsToBacktrack(doku, maxPossibilities);
|
||||||
|
if (backtrackCells == null || maxPossibilities > doku.getSubGrid(0).getSize())
|
||||||
while (!possibleSymbols.isEmpty()) {
|
return false;
|
||||||
int nextPossibleSymbolIndex = rand.nextInt(possibleSymbols.size());
|
maxPossibilities++;
|
||||||
int nextSymbol = possibleSymbols.get(nextPossibleSymbolIndex);
|
}
|
||||||
|
// on fait du backtracking
|
||||||
cellToFill.setSymbolIndex(nextSymbol);
|
for (Cell backtrackCell : backtrackCells) {
|
||||||
if (this.solve(doku)) {
|
List<Integer> possibilities = backtrackCell.getPossibleSymbols();
|
||||||
|
for (int symbol : possibilities) {
|
||||||
|
backtrackCell.setSymbolIndex(symbol);
|
||||||
|
addStep(backtrackCell, steps);
|
||||||
|
if (solve(doku, steps))
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
cellToFill.setSymbolIndex(Cell.NOSYMBOL);
|
backtrackCell.setSymbolIndex(Cell.NOSYMBOL);
|
||||||
possibleSymbols.remove(nextPossibleSymbolIndex);
|
addStep(backtrackCell, steps);
|
||||||
}
|
}
|
||||||
|
|
||||||
return false;
|
return false;
|
||||||
|
|||||||
@@ -3,12 +3,9 @@ package sudoku.solver;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
import java.util.concurrent.CancellationException;
|
import java.util.concurrent.CancellationException;
|
||||||
import java.util.logging.Level;
|
|
||||||
|
|
||||||
import sudoku.io.SudokuPrinter;
|
|
||||||
import sudoku.structure.Cell;
|
import sudoku.structure.Cell;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.Sudoku;
|
|
||||||
|
|
||||||
public class RandomSolver implements Solver {
|
public class RandomSolver implements Solver {
|
||||||
|
|
||||||
@@ -18,22 +15,15 @@ public class RandomSolver implements Solver {
|
|||||||
* de backtracking.
|
* de backtracking.
|
||||||
*
|
*
|
||||||
* @param doku Multidoku, à résoudre
|
* @param doku Multidoku, à résoudre
|
||||||
* @param rand Random, pour tester aléatoirement les symboles
|
|
||||||
* @return boolean, true s'il est résolu ou false s'il ne l'est pas.
|
* @return boolean, true s'il est résolu ou false s'il ne l'est pas.
|
||||||
*/
|
*/
|
||||||
@Override
|
@Override
|
||||||
public boolean solve(MultiDoku doku) {
|
public boolean solve(MultiDoku doku, List<SolverStep> steps) {
|
||||||
Random rand = new Random();
|
Random rand = new Random();
|
||||||
|
|
||||||
if (Thread.interrupted())
|
if (Thread.interrupted())
|
||||||
throw new CancellationException("User wants to stop the solver");
|
throw new CancellationException("User wants to stop the solver");
|
||||||
|
|
||||||
Sudoku sudoku = doku.getSubGrid(0);
|
|
||||||
logger.log(Level.FINE,
|
|
||||||
'\n' + SudokuPrinter.toStringRectangleSudoku(sudoku,
|
|
||||||
sudoku.getBlockWidth() == 0 ? sudoku.getSize() : sudoku.getBlockWidth(),
|
|
||||||
sudoku.getBlockWidth() == 0 ? sudoku.getSize() : sudoku.getSize() / sudoku.getBlockWidth()));
|
|
||||||
|
|
||||||
if (doku.isSolved()) {
|
if (doku.isSolved()) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@@ -50,10 +40,12 @@ public class RandomSolver implements Solver {
|
|||||||
int nextSymbol = possibleSymbols.get(nextPossibleSymbolIndex);
|
int nextSymbol = possibleSymbols.get(nextPossibleSymbolIndex);
|
||||||
|
|
||||||
cellToFill.setSymbolIndex(nextSymbol);
|
cellToFill.setSymbolIndex(nextSymbol);
|
||||||
if (this.solve(doku)) {
|
addStep(cellToFill, steps);
|
||||||
|
if (this.solve(doku, steps)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
cellToFill.setSymbolIndex(Cell.NOSYMBOL);
|
cellToFill.setSymbolIndex(Cell.NOSYMBOL);
|
||||||
|
addStep(cellToFill, steps);
|
||||||
possibleSymbols.remove(nextPossibleSymbolIndex);
|
possibleSymbols.remove(nextPossibleSymbolIndex);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -13,7 +13,11 @@ public interface Solver {
|
|||||||
*/
|
*/
|
||||||
public static final Logger logger = Logger.getLogger("SolverLogger");
|
public static final Logger logger = Logger.getLogger("SolverLogger");
|
||||||
|
|
||||||
boolean solve(MultiDoku doku);
|
boolean solve(MultiDoku doku, List<SolverStep> solverSteps);
|
||||||
|
|
||||||
|
default boolean solve(MultiDoku doku) {
|
||||||
|
return solve(doku, null);
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Compte le nombre de solutions possibles au MultiDoku passé en paramètres.
|
* Compte le nombre de solutions possibles au MultiDoku passé en paramètres.
|
||||||
@@ -38,10 +42,27 @@ public interface Solver {
|
|||||||
cellToFill.setSymbolIndex(symbol);
|
cellToFill.setSymbolIndex(symbol);
|
||||||
if (solve(doku)) {
|
if (solve(doku)) {
|
||||||
result++;
|
result++;
|
||||||
|
if (result > 1) {
|
||||||
|
doku.getStateManager().popState();
|
||||||
|
return result;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
doku.getStateManager().popState();
|
doku.getStateManager().popState();
|
||||||
}
|
}
|
||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Méthode utilisée en interne afin de rajouter une étape si l'utilisateur le
|
||||||
|
* souhaite (steps non null)
|
||||||
|
*
|
||||||
|
* @param cell la cellule qui a été modifiée
|
||||||
|
* @param steps la liste d'étape à mettre à jour
|
||||||
|
*/
|
||||||
|
default void addStep(Cell cell, List<SolverStep> steps) {
|
||||||
|
if (steps == null)
|
||||||
|
return;
|
||||||
|
steps.add(new SolverStep(cell));
|
||||||
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
23
app/src/main/java/sudoku/solver/SolverStep.java
Normal file
23
app/src/main/java/sudoku/solver/SolverStep.java
Normal file
@@ -0,0 +1,23 @@
|
|||||||
|
package sudoku.solver;
|
||||||
|
|
||||||
|
import sudoku.structure.Cell;
|
||||||
|
|
||||||
|
public class SolverStep {
|
||||||
|
|
||||||
|
private final Cell cell;
|
||||||
|
private final int newValue;
|
||||||
|
|
||||||
|
public SolverStep(Cell cell) {
|
||||||
|
this.cell = cell;
|
||||||
|
this.newValue = cell.getSymbolIndex();
|
||||||
|
}
|
||||||
|
|
||||||
|
public int getNewValue() {
|
||||||
|
return newValue;
|
||||||
|
}
|
||||||
|
|
||||||
|
public Cell getCell() {
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
||||||
@@ -1,5 +1,6 @@
|
|||||||
package sudoku.solver;
|
package sudoku.solver;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
import java.util.concurrent.CancellationException;
|
import java.util.concurrent.CancellationException;
|
||||||
|
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
@@ -8,9 +9,9 @@ import sudoku.structure.Sudoku;
|
|||||||
/**
|
/**
|
||||||
* Class de test non utilisé
|
* Class de test non utilisé
|
||||||
*/
|
*/
|
||||||
public class StupidSolver {
|
public class StupidSolver implements Solver{
|
||||||
|
|
||||||
private static boolean solve(Sudoku sudoku, int index) {
|
private boolean solve(Sudoku sudoku, int index, List<SolverStep> steps) {
|
||||||
// mécanisme d'abandon
|
// mécanisme d'abandon
|
||||||
if (Thread.interrupted())
|
if (Thread.interrupted())
|
||||||
throw new CancellationException("User wants to stop the solver");
|
throw new CancellationException("User wants to stop the solver");
|
||||||
@@ -21,27 +22,30 @@ public class StupidSolver {
|
|||||||
|
|
||||||
// si la case n'est pas modifiable, on passe à la suivante
|
// si la case n'est pas modifiable, on passe à la suivante
|
||||||
if (!sudoku.getCell(index).isMutable())
|
if (!sudoku.getCell(index).isMutable())
|
||||||
return solve(sudoku, index + 1);
|
return solve(sudoku, index + 1, steps);
|
||||||
|
|
||||||
for (int symbol = 0; symbol < sudoku.getSize(); symbol++) {
|
for (int symbol = 0; symbol < sudoku.getSize(); symbol++) {
|
||||||
if (sudoku.getCell(index).trySetValue(symbol)) {
|
if (sudoku.getCell(index).trySetValue(symbol)) {
|
||||||
|
addStep(sudoku.getCell(index), steps);
|
||||||
// on tente de placer sur la case suivante
|
// on tente de placer sur la case suivante
|
||||||
if (solve(sudoku, index + 1)) {
|
if (solve(sudoku, index + 1, steps)) {
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
// on a tout essayé et rien n'a fonctionné
|
// on a tout essayé et rien n'a fonctionné
|
||||||
sudoku.getCell(index).empty();
|
sudoku.getCell(index).empty();
|
||||||
|
addStep(sudoku.getCell(index), steps);
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static boolean solve(MultiDoku doku) {
|
@Override
|
||||||
|
public boolean solve(MultiDoku doku, List<SolverStep> steps) {
|
||||||
if (doku.isSolved())
|
if (doku.isSolved())
|
||||||
return true;
|
return true;
|
||||||
|
|
||||||
for (Sudoku sudoku : doku.getSubGrids()) {
|
for (Sudoku sudoku : doku.getSubGrids()) {
|
||||||
if (!solve(sudoku, 0))
|
if (!solve(sudoku, 0, steps))
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
return true;
|
return true;
|
||||||
|
|||||||
@@ -4,28 +4,41 @@ import java.util.ArrayList;
|
|||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Class qui représente les block de chaque sudoku,
|
* Class qui représente les Block de chaque Sudoku,
|
||||||
* Un block étant un ensemble de cellule avec une contrainte de block qui lui
|
* Un Block étant un ensemble de cellule avec une contrainte de block qui lui
|
||||||
* ait associé
|
* ait associé.
|
||||||
*/
|
*/
|
||||||
public class Block {
|
public class Block {
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="ATTRIBUTS">
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* L'ensemble des cellules du block
|
* L'ensemble des cellules du block.
|
||||||
*/
|
*/
|
||||||
private final List<Cell> cells;
|
private final List<Cell> cells;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* List de sudoku qui contiennent le block
|
* Liste de Sudoku qui contiennent le block
|
||||||
* Pour un acces plus rapide aux sudokus
|
* Pour un accès plus rapide aux sudokus.
|
||||||
*/
|
*/
|
||||||
private final List<Sudoku> sudokus;
|
private final List<Sudoku> sudokus;
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="METHODES">
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Crée un Block avec une liste de Cell donnée.
|
||||||
|
* @param cells List~Cell~
|
||||||
|
*/
|
||||||
public Block(List<Cell> cells) {
|
public Block(List<Cell> cells) {
|
||||||
this.cells = cells;
|
this.cells = cells;
|
||||||
this.sudokus = new ArrayList<>();
|
this.sudokus = new ArrayList<>();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Crée un Block avec une liste de Cell vide.
|
||||||
|
*/
|
||||||
public Block() {
|
public Block() {
|
||||||
this(new ArrayList<>());
|
this(new ArrayList<>());
|
||||||
}
|
}
|
||||||
@@ -33,13 +46,16 @@ public class Block {
|
|||||||
public List<Cell> getCells() {
|
public List<Cell> getCells() {
|
||||||
return cells;
|
return cells;
|
||||||
}
|
}
|
||||||
|
public List<Sudoku> getSudokus() {
|
||||||
|
return sudokus;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Ajoute une Cell au Block
|
* Ajoute une Cell au Block
|
||||||
*
|
*
|
||||||
* @param newCell Cell, à ajouter
|
* @param newCell Cell, à ajouter
|
||||||
*/
|
*/
|
||||||
void addCell(Cell newCell) {
|
public void addCell(Cell newCell) {
|
||||||
this.cells.add(newCell);
|
this.cells.add(newCell);
|
||||||
}
|
}
|
||||||
|
|
||||||
@@ -57,16 +73,5 @@ public class Block {
|
|||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public boolean containsCell(Cell cell) {
|
// </editor-fold>
|
||||||
for (Cell cellTmp : this.cells) {
|
|
||||||
if (cellTmp.equals(cell)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
|
|
||||||
public List<Sudoku> getSudokus() {
|
|
||||||
return sudokus;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -9,6 +9,8 @@ import java.util.List;
|
|||||||
*/
|
*/
|
||||||
public class Cell {
|
public class Cell {
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="ATTRIBUTS">
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Constante de valeur d'index de symbole quand il n'y en a pas,
|
* Constante de valeur d'index de symbole quand il n'y en a pas,
|
||||||
* soit que la Cell est vide.
|
* soit que la Cell est vide.
|
||||||
@@ -29,6 +31,10 @@ public class Cell {
|
|||||||
*/
|
*/
|
||||||
private boolean isMutable = true;
|
private boolean isMutable = true;
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="METHODES">
|
||||||
|
|
||||||
public Cell() {
|
public Cell() {
|
||||||
this(Cell.NOSYMBOL);
|
this(Cell.NOSYMBOL);
|
||||||
}
|
}
|
||||||
@@ -46,6 +52,22 @@ public class Cell {
|
|||||||
return this.symbolIndex;
|
return this.symbolIndex;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie le Block qui la contient.
|
||||||
|
* @return Block.
|
||||||
|
*/
|
||||||
|
public Block getBlock() {
|
||||||
|
return this.blockContainer;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie si la Cell est modifiable
|
||||||
|
* @return boolean, true si elle est modifiable ou false sinon.
|
||||||
|
*/
|
||||||
|
public boolean isMutable() {
|
||||||
|
return this.isMutable;
|
||||||
|
}
|
||||||
|
|
||||||
public void setSymbolIndex(int symbolIndex) {
|
public void setSymbolIndex(int symbolIndex) {
|
||||||
this.symbolIndex = symbolIndex;
|
this.symbolIndex = symbolIndex;
|
||||||
}
|
}
|
||||||
@@ -57,22 +79,16 @@ public class Cell {
|
|||||||
this.isMutable = false;
|
this.isMutable = false;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Block getBlock() {
|
|
||||||
return this.blockContainer;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlock(Block block) {
|
public void setBlock(Block block) {
|
||||||
this.blockContainer = block;
|
this.blockContainer = block;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Remove the current symbolIndex and returns it
|
* Vide la Cell.
|
||||||
* @return integer symbolIndex cleared
|
|
||||||
*/
|
*/
|
||||||
public int clearCurrentSymbol() {
|
public void clearCurrentSymbol() {
|
||||||
int i = this.symbolIndex;
|
|
||||||
setSymbolIndex(NOSYMBOL);
|
setSymbolIndex(NOSYMBOL);
|
||||||
return i;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -83,14 +99,6 @@ public class Cell {
|
|||||||
return this.symbolIndex == Cell.NOSYMBOL;
|
return this.symbolIndex == Cell.NOSYMBOL;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* Renvoie si la Cell est modifiable
|
|
||||||
* @return boolean, true si elle est modifiable ou false sinon.
|
|
||||||
*/
|
|
||||||
public boolean isMutable() {
|
|
||||||
return this.isMutable;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vide la Cell, en renvoie l'ancien index du symbole qui était dedans.
|
* Vide la Cell, en renvoie l'ancien index du symbole qui était dedans.
|
||||||
* @return int, index du symbole anciennement contenue dans la Cell.
|
* @return int, index du symbole anciennement contenue dans la Cell.
|
||||||
@@ -101,6 +109,11 @@ public class Cell {
|
|||||||
return oldSymbol;
|
return oldSymbol;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vérifie si la Cell peut prendre ce symbole par rapport aux contraintes de ses Sudokus.
|
||||||
|
* @param value int, index du symbole
|
||||||
|
* @return boolean, true si elle peut, false sinon.
|
||||||
|
*/
|
||||||
public boolean canHaveValue(int value) {
|
public boolean canHaveValue(int value) {
|
||||||
for (Sudoku s :getBlock().getSudokus()) {
|
for (Sudoku s :getBlock().getSudokus()) {
|
||||||
int cellIndex = s.getCells().indexOf(this);
|
int cellIndex = s.getCells().indexOf(this);
|
||||||
@@ -116,6 +129,10 @@ public class Cell {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie les symboles que peut prendre cette Cell par rapport aux contraintes de ses Sudokus.
|
||||||
|
* @return List~Integer~, la liste des symboles possibles.
|
||||||
|
*/
|
||||||
public List<Integer> getPossibleSymbols() {
|
public List<Integer> getPossibleSymbols() {
|
||||||
List<Integer> result = new ArrayList<>();
|
List<Integer> result = new ArrayList<>();
|
||||||
for (int i = 0; i < getBlock().getSudokus().get(0).getSize(); i++) {
|
for (int i = 0; i < getBlock().getSudokus().get(0).getSize(); i++) {
|
||||||
@@ -125,10 +142,19 @@ public class Cell {
|
|||||||
return result;
|
return result;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Essaye de placer la valeur et renvoie false si ce n'est pas possible.
|
||||||
|
* @param newValue int, valeur à placer.
|
||||||
|
* @return boolean, true si la Cell à pris la valeur newValue, false sinon.
|
||||||
|
*/
|
||||||
public boolean trySetValue(int newValue) {
|
public boolean trySetValue(int newValue) {
|
||||||
|
if (!isMutable())
|
||||||
|
return false;
|
||||||
if (!canHaveValue(newValue))
|
if (!canHaveValue(newValue))
|
||||||
return false;
|
return false;
|
||||||
setSymbolIndex(newValue);
|
setSymbolIndex(newValue);
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,10 +1,12 @@
|
|||||||
package sudoku.structure;
|
package sudoku.structure;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Représente les coordonnées d'une Cell
|
* Représente les coordonnées d'une Cell.
|
||||||
*/
|
*/
|
||||||
public class Coordinate {
|
public class Coordinate {
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="ATTRIBUTS">
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* L'abscisse de la Cell.
|
* L'abscisse de la Cell.
|
||||||
*/
|
*/
|
||||||
@@ -14,6 +16,10 @@ public class Coordinate {
|
|||||||
*/
|
*/
|
||||||
private int y;
|
private int y;
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="METHODES">
|
||||||
|
|
||||||
public Coordinate(int x, int y) {
|
public Coordinate(int x, int y) {
|
||||||
this.x = x;
|
this.x = x;
|
||||||
this.y = y;
|
this.y = y;
|
||||||
@@ -35,16 +41,23 @@ public class Coordinate {
|
|||||||
this.y = y;
|
this.y = y;
|
||||||
}
|
}
|
||||||
|
|
||||||
public int calculateIndex(int size) {
|
/**
|
||||||
return this.y * size + this.x;
|
* Ajoute la Coordiante donnée à celle-ci.
|
||||||
}
|
* @param other Coordiante, à ajouter.
|
||||||
|
* @return Coordinate, le résultat de l'addition.
|
||||||
|
*/
|
||||||
public Coordinate add(Coordinate other) {
|
public Coordinate add(Coordinate other) {
|
||||||
return new Coordinate(this.x + other.x, this.y + other.y);
|
return new Coordinate(this.x + other.x, this.y + other.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Soustrait la Coordiante donnée à celle-ci.
|
||||||
|
* @param other Coordiante, à soustraire.
|
||||||
|
* @return Coordinate, le résultat de la soustraction.
|
||||||
|
*/
|
||||||
public Coordinate sub(Coordinate other) {
|
public Coordinate sub(Coordinate other) {
|
||||||
return new Coordinate(this.x - other.x, this.y - other.y);
|
return new Coordinate(this.x - other.x, this.y - other.y);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,26 +1,32 @@
|
|||||||
package sudoku.structure;
|
package sudoku.structure;
|
||||||
|
|
||||||
//TODO: melvyn va passer par là
|
/**
|
||||||
|
* Les difficultés d'un Sudoku,
|
||||||
|
* représente le nombre de cases à enlever, en proportion, à un Sudoku.
|
||||||
|
* Par exemple, avec 0.1 de factor, on enlevera 10% des cases.
|
||||||
|
*/
|
||||||
public enum Difficulty {
|
public enum Difficulty {
|
||||||
|
|
||||||
VeryEasy("Très facile", 0.1), Easy("Facile", 0.25), Medium("Moyen", 0.5), Hard("Difficile", 0.75), VeryHard("Impossible", 0.78);
|
VeryEasy("Très facile", 0.1),
|
||||||
|
Easy("Facile", 0.25),
|
||||||
|
Medium("Moyen", 0.5),
|
||||||
|
Hard("Difficile", 0.75),
|
||||||
|
VeryHard("Impossible", 0.78);
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Le pourcentage de Cell à enlever.
|
||||||
|
*/
|
||||||
final double factor;
|
final double factor;
|
||||||
|
/**
|
||||||
|
* Le nom de la difficulté.
|
||||||
|
*/
|
||||||
final String displayName;
|
final String displayName;
|
||||||
|
|
||||||
private Difficulty(String displayName, double factor) {
|
Difficulty(String displayName, double factor) {
|
||||||
this.factor = factor;
|
this.factor = factor;
|
||||||
this.displayName = displayName;
|
this.displayName = displayName;
|
||||||
}
|
}
|
||||||
|
|
||||||
public String getDisplayName() {
|
|
||||||
return displayName;
|
|
||||||
}
|
|
||||||
|
|
||||||
public double getFactor() {
|
|
||||||
return factor;
|
|
||||||
}
|
|
||||||
|
|
||||||
private static final String[] difficultyNames;
|
private static final String[] difficultyNames;
|
||||||
|
|
||||||
static {
|
static {
|
||||||
@@ -31,6 +37,14 @@ public enum Difficulty {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public String getDisplayName() {
|
||||||
|
return displayName;
|
||||||
|
}
|
||||||
|
|
||||||
|
public double getFactor() {
|
||||||
|
return factor;
|
||||||
|
}
|
||||||
|
|
||||||
public static String[] getDifficultyNames() {
|
public static String[] getDifficultyNames() {
|
||||||
return difficultyNames;
|
return difficultyNames;
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,28 +1,99 @@
|
|||||||
package sudoku.structure;
|
package sudoku.structure;
|
||||||
|
|
||||||
import java.util.*;
|
|
||||||
|
|
||||||
import sudoku.io.SudokuSerializer;
|
import sudoku.io.SudokuSerializer;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashSet;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Set;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class MultiDoku
|
* Class : MultiDoku
|
||||||
* @brief Représente une grille de Multidoku.
|
* Brief : Représente une grille de Multidoku.
|
||||||
* Une grille de sudoku est un multidoku avec un seul sous-sudoku
|
* Une grille de sudoku est un multidoku avec un seul sous-sudoku.
|
||||||
*/
|
*/
|
||||||
public class MultiDoku {
|
public class MultiDoku {
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="ATTRIBUTS">
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liste des sous-Sudoku contenue dans le multidoku.
|
* Liste des sous-Sudoku contenue dans le multidoku.
|
||||||
*/
|
*/
|
||||||
private final List<Sudoku> subGrids;
|
private final List<Sudoku> subGrids;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Pile, qui contient des états du MultiDoku,
|
||||||
|
* utile pour la résolution.
|
||||||
|
*/
|
||||||
private final StateManager stateManager;
|
private final StateManager stateManager;
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="METHODES">
|
||||||
|
|
||||||
public MultiDoku(List<Sudoku> subGrids) {
|
public MultiDoku(List<Sudoku> subGrids) {
|
||||||
this.subGrids = subGrids;
|
this.subGrids = subGrids;
|
||||||
this.stateManager = new StateManager(this);
|
this.stateManager = new StateManager(this);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Check si le MultiDoku est résolu, c'est à dire complet et cohérent avec ses contraintes.
|
||||||
|
*
|
||||||
|
* @return boolean, true s'il est résolu et false sinon.
|
||||||
|
*/
|
||||||
|
public boolean isSolved() {
|
||||||
|
for (Sudoku sudoku : this.subGrids) {
|
||||||
|
if (!sudoku.isSolved())
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie la liste des Cells préalablement remplies du MultiDoku.
|
||||||
|
*
|
||||||
|
* @return List~Cell~, vide si aucune Cell n'est remplie.
|
||||||
|
*/
|
||||||
|
public List<Cell> getFilledCells() {
|
||||||
|
List<Cell> result = new ArrayList<>();
|
||||||
|
for (Cell cell : this.getCells()) {
|
||||||
|
if (!cell.isEmpty()) {
|
||||||
|
result.add(cell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie la liste des Cells vides du MultiDoku.
|
||||||
|
*
|
||||||
|
* @return List~Cell~, vide si aucune Cell ne l'est.
|
||||||
|
*/
|
||||||
|
public List<Cell> getEmptyCells() {
|
||||||
|
List<Cell> result = new ArrayList<>();
|
||||||
|
for (Cell cell : this.getCells()) {
|
||||||
|
if (cell.isEmpty()) {
|
||||||
|
result.add(cell);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return result;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie la 1re Cell vide des sous-Sudoku.
|
||||||
|
*
|
||||||
|
* @return Cell, une Cell vide, ou null s'il n'y en a pas.
|
||||||
|
*/
|
||||||
|
public Cell getFirstEmptyCell() {
|
||||||
|
for (Sudoku sudoku : this.subGrids) {
|
||||||
|
Cell cellTmp = sudoku.getFirstEmptyCell();
|
||||||
|
if (cellTmp != null) {
|
||||||
|
return cellTmp;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie le nombre de sudoku contenu dans ce MultiDoku.
|
* Renvoie le nombre de sudoku contenu dans ce MultiDoku.
|
||||||
*
|
*
|
||||||
@@ -46,7 +117,7 @@ public class MultiDoku {
|
|||||||
* Renvoie la liste des Cells contenue dans ce MultiDoku,
|
* Renvoie la liste des Cells contenue dans ce MultiDoku,
|
||||||
* soit les Cells contenues de chaques sous-Sudoku.
|
* soit les Cells contenues de chaques sous-Sudoku.
|
||||||
*
|
*
|
||||||
* @return List<Cell>
|
* @return List~Cell~
|
||||||
*/
|
*/
|
||||||
public List<Cell> getCells() {
|
public List<Cell> getCells() {
|
||||||
Set<Cell> cellsSet = new HashSet<>();
|
Set<Cell> cellsSet = new HashSet<>();
|
||||||
@@ -56,95 +127,6 @@ public class MultiDoku {
|
|||||||
return new ArrayList<>(cellsSet);
|
return new ArrayList<>(cellsSet);
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
|
||||||
public String toString() {
|
|
||||||
StringBuilder sb = new StringBuilder();
|
|
||||||
sb.append("Multidoku {");
|
|
||||||
for (Sudoku sudoku : subGrids) {
|
|
||||||
sb.append("\n\t").append(sudoku.toString());
|
|
||||||
}
|
|
||||||
sb.append("\n}");
|
|
||||||
return sb.toString();
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renvoie les sous-Sudoku
|
|
||||||
*
|
|
||||||
* @return List<Sudoku>
|
|
||||||
*/
|
|
||||||
public List<Sudoku> getSubGrids() {
|
|
||||||
return this.subGrids;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Check si le MultiDoku est valide, en fonction de ses sous-Sudokus.
|
|
||||||
*
|
|
||||||
* @return boolean, true s'il est valide et false sinon.
|
|
||||||
*/
|
|
||||||
public boolean isSolved() {
|
|
||||||
for (Sudoku sudoku : this.subGrids) {
|
|
||||||
if (!sudoku.isSolved())
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renvoie la 1re Cell vide des sous-Sudoku.
|
|
||||||
*
|
|
||||||
* @return Cell, une Cell vide, ou null s'il n'y en a pas.
|
|
||||||
*/
|
|
||||||
public Cell getFirstEmptyCell() {
|
|
||||||
for (Sudoku sudoku : this.subGrids) {
|
|
||||||
Cell cellTmp = sudoku.getFirstEmptyCell();
|
|
||||||
if (cellTmp != null) {
|
|
||||||
return cellTmp;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renvoie la liste des Cells préalablement remplies du MultiDoku.
|
|
||||||
*
|
|
||||||
* @return List<Cell>, vide si aucune Cell n'est remplie.
|
|
||||||
*/
|
|
||||||
public List<Cell> getFilledCells() {
|
|
||||||
List<Cell> result = new ArrayList<>();
|
|
||||||
for (Cell cell : this.getCells()) {
|
|
||||||
if (!cell.isEmpty()) {
|
|
||||||
result.add(cell);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Renvoie la liste des Cells vides du MultiDoku.
|
|
||||||
*
|
|
||||||
* @return List<Cell>, vide si aucune Cell ne l'est.
|
|
||||||
*/
|
|
||||||
public List<Cell> getEmptyCells() {
|
|
||||||
List<Cell> result = new ArrayList<>();
|
|
||||||
for (Cell cell : this.getCells()) {
|
|
||||||
if (cell.isEmpty()) {
|
|
||||||
result.add(cell);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return result;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vide une Cell donnée.
|
|
||||||
*
|
|
||||||
* @param cell Cell, à vider.
|
|
||||||
*/
|
|
||||||
public void empty(Cell cell) {
|
|
||||||
List<Cell> cells = getCells();
|
|
||||||
Cell cellToEmpty = cells.get(cells.indexOf(cell));
|
|
||||||
cellToEmpty.setSymbolIndex(Cell.NOSYMBOL);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Renvoie le nombre de Cell contenue dans le MultiDoku.
|
* Renvoie le nombre de Cell contenue dans le MultiDoku.
|
||||||
*
|
*
|
||||||
@@ -163,19 +145,64 @@ public class MultiDoku {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vide les Cells modifiable.
|
||||||
|
*/
|
||||||
|
public void clearMutableCells() {
|
||||||
|
for (Sudoku s : getSubGrids()) {
|
||||||
|
for (Cell cell : s.getCells()) {
|
||||||
|
if (cell.isMutable())
|
||||||
|
cell.clearCurrentSymbol();
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie les sous-Sudoku
|
||||||
|
*
|
||||||
|
* @return List~Sudoku~
|
||||||
|
*/
|
||||||
|
public List<Sudoku> getSubGrids() {
|
||||||
|
return this.subGrids;
|
||||||
|
}
|
||||||
|
|
||||||
public StateManager getStateManager() {
|
public StateManager getStateManager() {
|
||||||
return stateManager;
|
return stateManager;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
@Override
|
||||||
* Renvoie une Cell vide choisie aléatoirement.
|
public boolean equals(Object other) {
|
||||||
*
|
if (!(other instanceof MultiDoku otherDoku))
|
||||||
* @param rand Random, pour le choix aléatoire.
|
return false;
|
||||||
* @return Cell, une Cell vide.
|
if (this.getNbSubGrids() != otherDoku.getNbSubGrids())
|
||||||
*/
|
return false;
|
||||||
public Cell getRandomEmptyCell(Random rand) {
|
for (int i = 0; i < this.getNbSubGrids(); i++) {
|
||||||
List<Cell> emptyCells = getEmptyCells();
|
Sudoku sudoku = this.getSubGrid(i);
|
||||||
int randomIndex = rand.nextInt(emptyCells.size());
|
Sudoku otherSudoku = otherDoku.getSubGrid(i);
|
||||||
return emptyCells.get(randomIndex);
|
if (sudoku.getSize() != otherSudoku.getSize())
|
||||||
|
return false;
|
||||||
|
for (int j = 0; j < sudoku.getSize() * sudoku.getSize(); j++) {
|
||||||
|
if (sudoku.getCell(i).getSymbolIndex() != otherSudoku.getCell(i).getSymbolIndex())
|
||||||
|
return false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String toString() {
|
||||||
|
StringBuilder sb = new StringBuilder();
|
||||||
|
sb.append("Multidoku {");
|
||||||
|
for (Sudoku sudoku : subGrids) {
|
||||||
|
sb.append("\n\t").append(sudoku.toString());
|
||||||
|
}
|
||||||
|
sb.append("\n}");
|
||||||
|
return sb.toString();
|
||||||
|
}
|
||||||
|
|
||||||
|
public MultiDoku clone() {
|
||||||
|
return SudokuSerializer.deserializeSudoku(SudokuSerializer.serializeSudoku(this));
|
||||||
|
}
|
||||||
|
|
||||||
|
// </editor-fold>
|
||||||
|
}
|
||||||
|
|||||||
@@ -4,38 +4,56 @@ import java.util.HashMap;
|
|||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Stack;
|
import java.util.Stack;
|
||||||
|
|
||||||
//TODO: doc
|
/**
|
||||||
|
* Une pile, qui réprésente les états d'un MultiDoku,
|
||||||
|
* utile pour les Solvers.
|
||||||
|
*/
|
||||||
public class StateManager {
|
public class StateManager {
|
||||||
|
|
||||||
private final Stack<Map<Cell, Integer>> states;
|
/**
|
||||||
|
* Le MultiDoku auquel il est associé.
|
||||||
|
*/
|
||||||
private final MultiDoku doku;
|
private final MultiDoku doku;
|
||||||
|
|
||||||
|
/**
|
||||||
|
* La pile des états du MultiDoku associé.
|
||||||
|
*/
|
||||||
|
private final Stack<Map<Cell, Integer>> states;
|
||||||
|
|
||||||
public StateManager(MultiDoku doku) {
|
public StateManager(MultiDoku doku) {
|
||||||
this.states = new Stack<>();
|
this.states = new Stack<>();
|
||||||
this.doku = doku;
|
this.doku = doku;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void pushState() {
|
public Map<Cell, Integer> pushState() {
|
||||||
states.add(new HashMap<>());
|
states.add(saveState());
|
||||||
saveState();
|
return states.getLast();
|
||||||
}
|
}
|
||||||
|
|
||||||
public void popState() {
|
public void popState() {
|
||||||
assert (states.size() > 0);
|
assert (!states.isEmpty());
|
||||||
restoreState();
|
restoreState(states.pop());
|
||||||
states.pop();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
private void restoreState() {
|
public Map<Cell, Integer> popAndGetState() {
|
||||||
for (var entry : this.states.getLast().entrySet()) {
|
assert (!states.isEmpty());
|
||||||
|
var currentState = saveState();
|
||||||
|
restoreState(states.pop());
|
||||||
|
return currentState;
|
||||||
|
}
|
||||||
|
|
||||||
|
private void restoreState(Map<Cell, Integer> state) {
|
||||||
|
for (var entry : state.entrySet()) {
|
||||||
entry.getKey().setSymbolIndex(entry.getValue());
|
entry.getKey().setSymbolIndex(entry.getValue());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
private void saveState() {
|
private Map<Cell, Integer> saveState() {
|
||||||
|
Map<Cell, Integer> state = new HashMap<>();
|
||||||
for (Cell cell : this.doku.getCells()) {
|
for (Cell cell : this.doku.getCells()) {
|
||||||
states.getLast().put(cell, cell.getSymbolIndex());
|
state.put(cell, cell.getSymbolIndex());
|
||||||
}
|
}
|
||||||
|
return state;
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,37 +1,44 @@
|
|||||||
package sudoku.structure;
|
package sudoku.structure;
|
||||||
|
|
||||||
import sudoku.constraint.BlockConstraint;
|
|
||||||
import sudoku.constraint.Constraint;
|
import sudoku.constraint.Constraint;
|
||||||
import sudoku.constraint.IConstraint;
|
import sudoku.constraint.IConstraint;
|
||||||
import sudoku.io.SudokuPrinter;
|
|
||||||
|
|
||||||
import java.util.ArrayList;
|
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @class Sudoku
|
* Class : Sudoku
|
||||||
* @brief Représent un Sudoku
|
* Brief : Représent un Sudoku
|
||||||
*/
|
*/
|
||||||
public class Sudoku {
|
public class Sudoku {
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="ATTRIBUTS">
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liste des Block contenus dans le Sudoku.
|
* Liste des Block contenus dans le Sudoku.
|
||||||
*/
|
*/
|
||||||
private final List<Block> blocks;
|
private final List<Block> blocks;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liste des Cells contenus dans le Sudoku.
|
* Liste des Cells contenus dans le Sudoku.
|
||||||
*/
|
*/
|
||||||
private List<Cell> cells = new ArrayList<>();
|
private final List<Cell> cells;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Liste des contraintes (TODO) du Sudoku.
|
* Liste des contraintes (TODO) du Sudoku.
|
||||||
*/
|
*/
|
||||||
private final List<Constraint> constraints;
|
private final List<IConstraint> constraints;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Largeur des Blocks s'ils sont rectangulaires, valant 0 si ce n'est pas le cas.
|
* Largeur des Blocks s'ils sont rectangulaires,
|
||||||
|
* valant 0 si ce n'est pas le cas.
|
||||||
*/
|
*/
|
||||||
private int blockWidth;
|
private int blockWidth;
|
||||||
|
|
||||||
public Sudoku(List<Cell> cells, List<Block> blocks, List<Constraint> constraints) {
|
// </editor-fold>
|
||||||
|
|
||||||
|
// <editor-fold defaultstate="collapsed" desc="METHODES">
|
||||||
|
|
||||||
|
public Sudoku(List<Cell> cells, List<Block> blocks, List<IConstraint> constraints) {
|
||||||
this.cells = cells;
|
this.cells = cells;
|
||||||
this.blocks = blocks;
|
this.blocks = blocks;
|
||||||
this.constraints = constraints;
|
this.constraints = constraints;
|
||||||
@@ -49,6 +56,7 @@ public class Sudoku {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Transforme des coordonées d'une Cell en index.
|
* Transforme des coordonées d'une Cell en index.
|
||||||
|
*
|
||||||
* @param x int, abscisse.
|
* @param x int, abscisse.
|
||||||
* @param y int, ordonnée.
|
* @param y int, ordonnée.
|
||||||
* @return int, index correspondant.
|
* @return int, index correspondant.
|
||||||
@@ -59,7 +67,9 @@ public class Sudoku {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Vérifie que des coordonnées correspondent bien à une Cell dans le Sudoku.
|
* Vérifie que des coordonnées correspondent bien à une Cell dans le Sudoku.
|
||||||
* @return boolean, valant true si les coordonnées sont dans les bornes du Sudoku, false sinon.
|
*
|
||||||
|
* @return boolean, valant true si les coordonnées sont dans les bornes du
|
||||||
|
* Sudoku, false sinon.
|
||||||
*/
|
*/
|
||||||
public boolean isValidCoords(int x, int y) {
|
public boolean isValidCoords(int x, int y) {
|
||||||
int index = toIndex(x, y);
|
int index = toIndex(x, y);
|
||||||
@@ -68,21 +78,25 @@ public class Sudoku {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Vérifie que l'index correspond bien à une Cell dans le Sudoku.
|
* Vérifie que l'index correspond bien à une Cell dans le Sudoku.
|
||||||
* @return boolean, valant true si l'index est dans les bornes du Sudoku, false sinon.
|
*
|
||||||
|
* @return boolean, valant true si l'index est dans les bornes du Sudoku, false
|
||||||
|
* sinon.
|
||||||
*/
|
*/
|
||||||
public boolean isValidCoords(int index) {
|
public boolean isValidCoords(int index) {
|
||||||
return index < getSize() * getSize();
|
return index < getSize() * getSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Teste si on peut placer la value dans la Cell aux coordonnées x, y d'après les contraintes du Sudoku.
|
* Teste si on peut placer la value dans la Cell aux coordonnées x, y d'après
|
||||||
|
* les contraintes du Sudoku.
|
||||||
|
*
|
||||||
* @param x int, abscisse de la Cell voulue.
|
* @param x int, abscisse de la Cell voulue.
|
||||||
* @param y int, ordonnée de la Cell voulue.
|
* @param y int, ordonnée de la Cell voulue.
|
||||||
* @param value int, index du symbole qu'on veut placer.
|
* @param value int, index du symbole qu'on veut placer.
|
||||||
* @return boolean, true si on peut la placer et false sinon.
|
* @return boolean, true si on peut la placer et false sinon.
|
||||||
*/
|
*/
|
||||||
public boolean canBePlaced(int x, int y, int value) {
|
public boolean canBePlaced(int x, int y, int value) {
|
||||||
for (Constraint constraint : this.constraints) {
|
for (IConstraint constraint : this.constraints) {
|
||||||
if (!constraint.canBePlaced(this, x, y, value)) {
|
if (!constraint.canBePlaced(this, x, y, value)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
@@ -91,34 +105,84 @@ public class Sudoku {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vide la Cell dotn les coordonnées sont renseignées de son symbole.
|
* Vérifie si le Sudoku est résolue, soit complet et cohérent avec ses
|
||||||
* @param x int, abscisse de la Cell voulue.
|
* contraintes.
|
||||||
* @param y int, coordonnée de la Cell voulue.
|
*
|
||||||
|
* @return boolean, valant true si le Sudoku est résolu, false sinon.
|
||||||
*/
|
*/
|
||||||
|
public boolean isSolved() {
|
||||||
public void clearCell(int x, int y) {
|
boolean isComplete = isComplete();
|
||||||
assert (isValidCoords(x, y));
|
boolean isValid = isValid();
|
||||||
Cell cell = getCell(x, y);
|
return isComplete && isValid;
|
||||||
cell.setSymbolIndex(Cell.NOSYMBOL);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Vide toutes les Cell du Sudoku.
|
* Vérifie que le Sudoku est complet, soit qu'il n'y ait aucune case vide.
|
||||||
|
*
|
||||||
|
* @return boolean, true si le Sudoku est complet, false sinon.
|
||||||
*/
|
*/
|
||||||
public void clear() {
|
private boolean isComplete() {
|
||||||
for (int i = 0; i < getSize() * getSize(); i++) {
|
return getFirstEmptyCell() == null;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Vérifie si le Sudoku est valide, soit qu'il est cohérent avec ses
|
||||||
|
* contraintes.
|
||||||
|
*
|
||||||
|
* @return bollean, true si le Sudoku est valide, false sinon
|
||||||
|
*/
|
||||||
|
private boolean isValid() {
|
||||||
|
for (int i = 0; i < cells.size(); i++) {
|
||||||
Cell cell = getCell(i);
|
Cell cell = getCell(i);
|
||||||
if (cell.isMutable())
|
if (cell.isEmpty())
|
||||||
cell.setSymbolIndex(Cell.NOSYMBOL);
|
continue;
|
||||||
|
|
||||||
|
Coordinate coordinate = toCoords(i);
|
||||||
|
|
||||||
|
int symbolPlaced = cell.empty();
|
||||||
|
if (!canBePlaced(coordinate.getX(), coordinate.getY(), symbolPlaced)) {
|
||||||
|
cell.setSymbolIndex(symbolPlaced);
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
cell.setSymbolIndex(symbolPlaced);
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Renvoie la Cell aux coordonées données.
|
||||||
|
*
|
||||||
|
* @param x int, abscisse.
|
||||||
|
* @param y int, ordonnée.
|
||||||
|
* @return Cell, si une Cell existe aux coordonnées données, null sinon.
|
||||||
|
*/
|
||||||
|
public Cell getCell(int x, int y) {
|
||||||
|
int index = toIndex(x, y);
|
||||||
|
assert (isValidCoords(x, y));
|
||||||
|
try {
|
||||||
|
return this.cells.get(index);
|
||||||
|
} catch (IndexOutOfBoundsException e) {
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public int getBlockWidth() {
|
/**
|
||||||
return blockWidth;
|
* Renvoie la 1re Cell vide du Sudoku.
|
||||||
|
*
|
||||||
|
* @return Cell, une Cell vide, ou null s'il n'y en a pas.
|
||||||
|
*/
|
||||||
|
public Cell getFirstEmptyCell() {
|
||||||
|
for (Cell cell : this.cells) {
|
||||||
|
if (cell.isEmpty()) {
|
||||||
|
return cell;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place le symbole d'index value dans la Cell de coordonnées précisées.
|
* Place le symbole d'index value dans la Cell de coordonnées précisées.
|
||||||
|
*
|
||||||
* @param x int, abscisse de la Cell voulue.
|
* @param x int, abscisse de la Cell voulue.
|
||||||
* @param y int, coordonnée de la Cell voulue.
|
* @param y int, coordonnée de la Cell voulue.
|
||||||
* @param value int, index du symbole à placer.
|
* @param value int, index du symbole à placer.
|
||||||
@@ -126,7 +190,7 @@ public class Sudoku {
|
|||||||
*/
|
*/
|
||||||
public Cell setCellSymbol(int x, int y, int value) {
|
public Cell setCellSymbol(int x, int y, int value) {
|
||||||
assert (isValidCoords(x, y));
|
assert (isValidCoords(x, y));
|
||||||
for (Constraint constraint : this.constraints) {
|
for (IConstraint constraint : this.constraints) {
|
||||||
if (!constraint.canBePlaced(this, x, y, value)) {
|
if (!constraint.canBePlaced(this, x, y, value)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
@@ -138,7 +202,8 @@ public class Sudoku {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Place les symboles d'index contenus dans values dans les cases du Sudoku.
|
* Place les symboles d'index contenus dans values dans les cases du Sudoku.
|
||||||
* @param values List<Integer>, liste des index des symboles à placer.
|
*
|
||||||
|
* @param values List~Integer~, liste des index des symboles à placer.
|
||||||
* @return boolean, vaut true si les symboles ont été placés, false sinon.
|
* @return boolean, vaut true si les symboles ont été placés, false sinon.
|
||||||
*/
|
*/
|
||||||
public boolean setCellsSymbol(List<Integer> values) {
|
public boolean setCellsSymbol(List<Integer> values) {
|
||||||
@@ -155,8 +220,10 @@ public class Sudoku {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place les symboles d'index contenus dans values dans les cases du Sudoku et rend ces cases immuables.
|
* Place les symboles d'index contenus dans values dans les cases du Sudoku et
|
||||||
* @param values List<Integer>, liste des index des symboles à placer.
|
* rend ces cases immuables.
|
||||||
|
*
|
||||||
|
* @param values List~Integer~, liste des index des symboles à placer.
|
||||||
* @return boolean, vaut true si les symboles ont été placés, false sinon.
|
* @return boolean, vaut true si les symboles ont été placés, false sinon.
|
||||||
*/
|
*/
|
||||||
public boolean setImmutableCellsSymbol(List<Integer> values) {
|
public boolean setImmutableCellsSymbol(List<Integer> values) {
|
||||||
@@ -178,24 +245,14 @@ public class Sudoku {
|
|||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
||||||
public Cell getCell(int x, int y) {
|
public boolean hasConstraint(Constraint constraint) {
|
||||||
int index = toIndex(x, y);
|
return this.constraints.contains(constraint.getConstraint());
|
||||||
assert (isValidCoords(x, y));
|
|
||||||
try {
|
|
||||||
return this.cells.get(index);
|
|
||||||
} catch (IndexOutOfBoundsException e) {
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public Cell getCell(int i) {
|
public Cell getCell(int i) {
|
||||||
return this.cells.get(i);
|
return this.cells.get(i);
|
||||||
}
|
}
|
||||||
|
|
||||||
public List<Constraint> getConstraints() {
|
|
||||||
return constraints;
|
|
||||||
}
|
|
||||||
|
|
||||||
public int getSize() {
|
public int getSize() {
|
||||||
return this.blocks.size();
|
return this.blocks.size();
|
||||||
}
|
}
|
||||||
@@ -208,15 +265,19 @@ public class Sudoku {
|
|||||||
return this.blocks;
|
return this.blocks;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
public List<IConstraint> getConstraints() {
|
||||||
* Vérifie si une Cell appartient au Sudoku.
|
return constraints;
|
||||||
* @param cell Cell, cellule dont on veut vérifier l'appartenance au Sudoku.
|
|
||||||
* @return boolean, vaut true si la Cell appartient au Sudoku.
|
|
||||||
*/
|
|
||||||
public boolean contains(Cell cell) {
|
|
||||||
return this.cells.contains(cell);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public int getBlockWidth() {
|
||||||
|
return blockWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBlockWidth(int blockWidth) {
|
||||||
|
this.blockWidth = blockWidth;
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder sb = new StringBuilder();
|
StringBuilder sb = new StringBuilder();
|
||||||
sb.append("Sudoku {");
|
sb.append("Sudoku {");
|
||||||
@@ -231,65 +292,6 @@ public class Sudoku {
|
|||||||
return sb.toString();
|
return sb.toString();
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
// <editor-fold defaultstate="collapsed" desc="METHODES">
|
||||||
* Renvoie la 1re Cell vide du Sudoku.
|
|
||||||
* @return Cell, une Cell vide, ou null s'il n'y en a pas.
|
|
||||||
*/
|
|
||||||
public Cell getFirstEmptyCell() {
|
|
||||||
for (Cell cell : this.cells) {
|
|
||||||
if (cell.isEmpty()) {
|
|
||||||
return cell;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vérifie si le Sudoku est résolue, soit complet et cohérent avec ses contraintes.
|
|
||||||
* @return boolean, valant true si le Sudoku est résolu, false sinon.
|
|
||||||
*/
|
|
||||||
public boolean isSolved() {
|
|
||||||
boolean isComplete = isComplete();
|
|
||||||
boolean isValid = isValid();
|
|
||||||
return isComplete && isValid;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vérifie que le Sudoku est complet, soit qu'il n'y ait aucune case vide.
|
|
||||||
* @return boolean, true si le Sudoku est complet, false sinon.
|
|
||||||
*/
|
|
||||||
private boolean isComplete() {
|
|
||||||
return getFirstEmptyCell() == null;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Vérifie si le Sudoku est valide, soit qu'il est cohérent avec ses contraintes.
|
|
||||||
* @return bollean, true si le Sudoku est valide, false sinon
|
|
||||||
*/
|
|
||||||
private boolean isValid() {
|
|
||||||
for (int i = 0; i < cells.size(); i++) {
|
|
||||||
Cell cell = getCell(i);
|
|
||||||
if (cell.isEmpty())
|
|
||||||
continue;
|
|
||||||
|
|
||||||
Coordinate coordinate = toCoords(i);
|
|
||||||
|
|
||||||
int symbolPlaced = cell.empty();
|
|
||||||
if (!canBePlaced(coordinate.getX(), coordinate.getY(), symbolPlaced)) {
|
|
||||||
cell.setSymbolIndex(symbolPlaced);
|
|
||||||
return false;
|
|
||||||
}
|
|
||||||
cell.setSymbolIndex(symbolPlaced);
|
|
||||||
}
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
public void setBlockWidth(int blockWidth) {
|
|
||||||
this.blockWidth = blockWidth;
|
|
||||||
}
|
|
||||||
|
|
||||||
public boolean hasConstraint(Constraint constraint) {
|
|
||||||
return this.constraints.contains(constraint);
|
|
||||||
}
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,19 +1,19 @@
|
|||||||
package sudoku.structure;
|
package sudoku.structure;
|
||||||
|
|
||||||
|
import sudoku.constraint.Constraint;
|
||||||
|
import sudoku.constraint.IConstraint;
|
||||||
|
import sudoku.io.SudokuSerializer;
|
||||||
|
import sudoku.solver.RandomSolver;
|
||||||
|
import sudoku.solver.Solver;
|
||||||
|
|
||||||
import java.io.IOException;
|
import java.io.IOException;
|
||||||
import java.nio.file.Files;
|
import java.nio.file.Files;
|
||||||
import java.nio.file.Paths;
|
import java.nio.file.Paths;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
|
|
||||||
import sudoku.constraint.Constraint;
|
|
||||||
import sudoku.io.SudokuSerializer;
|
|
||||||
import sudoku.solver.RandomSolver;
|
|
||||||
import sudoku.solver.Solver;
|
|
||||||
|
|
||||||
public class SudokuFactory {
|
public class SudokuFactory {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
@@ -25,13 +25,18 @@ public class SudokuFactory {
|
|||||||
* Liste des contraintes par défaut d'un Multi- ou Sudoku.
|
* Liste des contraintes par défaut d'un Multi- ou Sudoku.
|
||||||
* Comprend les contraintes de blocs, de lignes, et de colonnes.
|
* Comprend les contraintes de blocs, de lignes, et de colonnes.
|
||||||
*/
|
*/
|
||||||
public static List<Constraint> DEFAULT_CONSTRAINTS = Arrays.asList(Constraint.Block, Constraint.Column,
|
public static List<IConstraint> DEFAULT_CONSTRAINTS = SudokuFactory
|
||||||
Constraint.Line);
|
.fromConstraints(Arrays.asList(
|
||||||
|
Constraint.Block,
|
||||||
|
Constraint.Column,
|
||||||
|
Constraint.Line)
|
||||||
|
);
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Créée des Cells et les met dans une liste de taille size.
|
* Créée des Cells et les met dans une liste de taille size.
|
||||||
|
*
|
||||||
* @param size int, nombre de Cells à initialiser.
|
* @param size int, nombre de Cells à initialiser.
|
||||||
* @return List<Cell>, liste des Cells initialisées.
|
* @return List~Cell~, liste des Cells initialisées.
|
||||||
*/
|
*/
|
||||||
private static List<Cell> initCells(int size) {
|
private static List<Cell> initCells(int size) {
|
||||||
List<Cell> cells = new ArrayList<>(size * size);
|
List<Cell> cells = new ArrayList<>(size * size);
|
||||||
@@ -42,11 +47,13 @@ public class SudokuFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Créée des Blocks de taille width par height à partir des cellules données, et les met dans une liste.
|
* Créée des Blocks de taille width par height à partir des cellules données, et
|
||||||
* @param cells List<Cell>, liste des Cells à découper en Blocks.
|
* les met dans une liste.
|
||||||
|
*
|
||||||
|
* @param cells List~Cell~, liste des Cells à découper en Blocks.
|
||||||
* @param width int, largeur des Blocks à créer.
|
* @param width int, largeur des Blocks à créer.
|
||||||
* @param height int, hauteur des Blocks à créer.
|
* @param height int, hauteur des Blocks à créer.
|
||||||
* @return List<Block>, liste des Blocks créés.
|
* @return List~Block~, liste des Blocks créés.
|
||||||
*/
|
*/
|
||||||
private static List<Block> initRectangleBlocs(List<Cell> cells, int width, int height) {
|
private static List<Block> initRectangleBlocs(List<Cell> cells, int width, int height) {
|
||||||
List<Block> blocs = new ArrayList<>();
|
List<Block> blocs = new ArrayList<>();
|
||||||
@@ -60,9 +67,6 @@ public class SudokuFactory {
|
|||||||
int index = ((y + blockY * height) * size + (x + blockX * width));
|
int index = ((y + blockY * height) * size + (x + blockX * width));
|
||||||
Cell blockCell = cells.get(index);
|
Cell blockCell = cells.get(index);
|
||||||
blockCell.setBlock(newBlock);
|
blockCell.setBlock(newBlock);
|
||||||
// List<Block> blockContainers = new ArrayList<>();
|
|
||||||
// blockContainers.add(newBlock);
|
|
||||||
// blockCell.setBlockContainers(blockContainers);
|
|
||||||
newBlock.addCell(blockCell);
|
newBlock.addCell(blockCell);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -72,89 +76,37 @@ public class SudokuFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Créée un MultiDoku vide dont les Blocks sont de taille widthBlock par heightBlock.
|
* Créée un MultiDoku vide dont les Blocks sont de taille widthBlock par
|
||||||
|
* heightBlock.
|
||||||
|
*
|
||||||
* @param widthBlock int, largeur des Blocks.
|
* @param widthBlock int, largeur des Blocks.
|
||||||
* @param heightBlock int, hauteur des Blocks.
|
* @param heightBlock int, hauteur des Blocks.
|
||||||
* @return MultiDoku, MultiDoku vide.
|
* @return MultiDoku, MultiDoku vide.
|
||||||
*/
|
*/
|
||||||
public static MultiDoku createBasicEmptyRectangleDoku(int widthBlock, int heightBlock,
|
public static MultiDoku createBasicEmptyRectangleDoku(int widthBlock, int heightBlock,
|
||||||
List<Constraint> constraints) {
|
List<IConstraint> constraints) {
|
||||||
return new MultiDoku(Arrays.asList(createRectangleSudoku(widthBlock, heightBlock, constraints)));
|
return new MultiDoku(List.of(createRectangleSudoku(widthBlock, heightBlock, constraints)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Créée un MultiDoku vide dont les Blocks sont carrés de longueur size.
|
* Créée un MultiDoku vide dont les Blocks sont carrés de longueur size.
|
||||||
|
*
|
||||||
* @param size int, taille des Blocks.
|
* @param size int, taille des Blocks.
|
||||||
* @return MultiDoku, MultiDoku vide.
|
* @return MultiDoku, MultiDoku vide.
|
||||||
*/
|
*/
|
||||||
public static MultiDoku createBasicEmptySquareDoku(int size, List<Constraint> constraints) {
|
public static MultiDoku createBasicEmptySquareDoku(int size, List<IConstraint> constraints) {
|
||||||
return new MultiDoku(Arrays.asList(createSquareSudoku(size, constraints)));
|
return new MultiDoku(List.of(createSquareSudoku(size, constraints)));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Place des Cells immutables de valeurs fournies, aux Coordinate fournies dans le MultiDoku doku fourni.
|
* Créée un Sudoku vide dont les Blocks sont de taille widthBlock par
|
||||||
* @param doku MultiDoku, MultiDoku à remplir.
|
* heightBlock.
|
||||||
* @param immutableCells Map<Coordinate, Integer>, association de Coordinate coordonnées et Integer valeurs, correspondant aux cases à remplir.
|
|
||||||
*/
|
|
||||||
public static void setImmutableCells(MultiDoku doku, Map<Coordinate, Integer> immutableCells) {
|
|
||||||
immutableCells.forEach((coordinate, symbol) -> {
|
|
||||||
for (Sudoku sudoku : doku.getSubGrids()) {
|
|
||||||
Cell cell = sudoku.getCell(coordinate.getX(), coordinate.getY());
|
|
||||||
if (cell != null) {
|
|
||||||
cell.setSymbolIndex(symbol);
|
|
||||||
cell.setImmutable();
|
|
||||||
}
|
|
||||||
}
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Créée un MultiDoku de difficulté difficulty à partir d'un MultiDoku fourni.
|
|
||||||
*
|
*
|
||||||
* @param doku MultiDoku, MultiDoku dont on doit vider des Cells.
|
|
||||||
* @param nbCellsToEmpty int, nombre de cases à retirer.
|
|
||||||
* @return boolean, valant true si un MultiDoku de difficulté donnée peut être créée, false sinon.
|
|
||||||
* @throws Exception si la difficulté n'est pas compatible avec la taille du MultiDoku.
|
|
||||||
*/
|
|
||||||
public static boolean newDokuFromFilledOne(MultiDoku doku, int nbCellsToEmpty, Solver solver) throws Exception {
|
|
||||||
|
|
||||||
if (nbCellsToEmpty >= doku.getCells().size()) {
|
|
||||||
throw new Exception();
|
|
||||||
}
|
|
||||||
|
|
||||||
if (nbCellsToEmpty == 0) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
|
|
||||||
List<Cell> cellsThatCanBeEmptied = doku.getFilledCells();
|
|
||||||
|
|
||||||
while (!cellsThatCanBeEmptied.isEmpty()) {
|
|
||||||
int index = random.nextInt(cellsThatCanBeEmptied.size());
|
|
||||||
Cell cellToEmpty = cellsThatCanBeEmptied.get(index);
|
|
||||||
|
|
||||||
int oldSymbol = cellToEmpty.empty();
|
|
||||||
|
|
||||||
int nbDokuSultions = solver.countSolution(doku);
|
|
||||||
if (nbDokuSultions == 1) {
|
|
||||||
if (newDokuFromFilledOne(doku, --nbCellsToEmpty, solver)) {
|
|
||||||
return true;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
cellToEmpty.setSymbolIndex(oldSymbol);
|
|
||||||
cellsThatCanBeEmptied.remove(cellToEmpty);
|
|
||||||
}
|
|
||||||
|
|
||||||
return newDokuFromFilledOne(doku, --nbCellsToEmpty, solver);
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* Créée un Sudoku vide dont les Blocks sont de taille widthBlock par heightBlock.
|
|
||||||
* @param widthBlock int, largeur des Blocks.
|
* @param widthBlock int, largeur des Blocks.
|
||||||
* @param heightBlock int, hauteur des Blocks.
|
* @param heightBlock int, hauteur des Blocks.
|
||||||
* @return Sudoku, Sudoku vide.
|
* @return Sudoku, Sudoku vide.
|
||||||
*/
|
*/
|
||||||
private static Sudoku createRectangleSudoku(int widthBlock, int heightBlock, List<Constraint> constraints) {
|
private static Sudoku createRectangleSudoku(int widthBlock, int heightBlock, List<IConstraint> constraints) {
|
||||||
int symbolCount = widthBlock * heightBlock;
|
int symbolCount = widthBlock * heightBlock;
|
||||||
List<Cell> cases = initCells(symbolCount);
|
List<Cell> cases = initCells(symbolCount);
|
||||||
List<Block> blocs = initRectangleBlocs(cases, widthBlock, heightBlock);
|
List<Block> blocs = initRectangleBlocs(cases, widthBlock, heightBlock);
|
||||||
@@ -168,34 +120,37 @@ public class SudokuFactory {
|
|||||||
|
|
||||||
/**
|
/**
|
||||||
* Créée un Sudoku vide dont les Blocks sont carrés de longueur size.
|
* Créée un Sudoku vide dont les Blocks sont carrés de longueur size.
|
||||||
|
*
|
||||||
* @param size int, taille des Blocks.
|
* @param size int, taille des Blocks.
|
||||||
* @return Sudoku, Sudoku vide.
|
* @return Sudoku, Sudoku vide.
|
||||||
*/
|
*/
|
||||||
private static Sudoku createSquareSudoku(int size, List<Constraint> constraints) {
|
private static Sudoku createSquareSudoku(int size, List<IConstraint> constraints) {
|
||||||
return createRectangleSudoku(size, size, constraints);
|
return createRectangleSudoku(size, size, constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Connecte deux Sudokus selon la décalage offset fourni.
|
* Connecte deux Sudokus selon la décalage offset fourni.
|
||||||
|
*
|
||||||
* @param sudoku1 Sudoku, premier sudoku à connecter.
|
* @param sudoku1 Sudoku, premier sudoku à connecter.
|
||||||
* @param sudoku2 Sudoku, second sudoku à connecter.
|
* @param sudoku2 Sudoku, second sudoku à connecter.
|
||||||
* @param offset Coordinate, décalage entre les deux Sudokus.
|
* @param offset Coordinate, décalage entre les deux Sudokus.
|
||||||
*/
|
*/
|
||||||
private static void linkSquareSudokus(Sudoku sudoku1, Sudoku sudoku2, Coordinate offset) {
|
private static void linkRectangleSudokus(Sudoku sudoku1, Sudoku sudoku2, Coordinate offset) {
|
||||||
int blockWidth = sudoku1.getBlockWidth();
|
int blockWidth = sudoku1.getBlockWidth();
|
||||||
for (int dx = 0; dx < blockWidth; dx++) {
|
int blockHeight = sudoku1.getSize() / blockWidth;
|
||||||
|
for (int dx = 0; dx < blockHeight; dx++) {
|
||||||
for (int dy = 0; dy < blockWidth; dy++) {
|
for (int dy = 0; dy < blockWidth; dy++) {
|
||||||
int block1X = dx + offset.getX();
|
int block1X = dx + offset.getX();
|
||||||
int block1Y = dy + offset.getY();
|
int block1Y = dy + offset.getY();
|
||||||
int block2X = dx;
|
int block2X = dx;
|
||||||
int block2Y = dy;
|
int block2Y = dy;
|
||||||
|
|
||||||
if ((block1X < blockWidth) && (block1X >= 0) && (block1Y >= 0) && (block1Y < blockWidth)) {
|
if ((block1X < blockHeight) && (block1X >= 0) && (block1Y >= 0) && (block1Y < blockWidth)) {
|
||||||
Block block1 = sudoku1.getBlocks().get(block1Y * blockWidth + block1X);
|
Block block1 = sudoku1.getBlocks().get(block1Y * blockHeight + block1X);
|
||||||
Block block2 = sudoku2.getBlocks().get(block2Y * blockWidth + block2X);
|
Block block2 = sudoku2.getBlocks().get(block2Y * blockHeight + block2X);
|
||||||
|
|
||||||
// on remplace le bloc
|
// on remplace le bloc
|
||||||
sudoku2.getBlocks().set(block2Y * blockWidth + block2X, block1);
|
sudoku2.getBlocks().set(block2Y * blockHeight + block2X, block1);
|
||||||
block1.getSudokus().add(sudoku2);
|
block1.getSudokus().add(sudoku2);
|
||||||
|
|
||||||
// on remplace les cellules
|
// on remplace les cellules
|
||||||
@@ -212,50 +167,37 @@ public class SudokuFactory {
|
|||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Créée un MultiDoku de Blocks carrés de taille size composé de cinq Sudokus, dont un central qui partage chacun de ses Blockss d'angle avec un autre Sudoku.
|
* Créée un MultiDoku de Blocks carrés de taille size composé de cinq Sudokus,
|
||||||
|
* dont un central qui partage chacun de ses Blockss d'angle avec un autre
|
||||||
|
* Sudoku.
|
||||||
|
* 2 3
|
||||||
|
* 1
|
||||||
|
* 4 5
|
||||||
|
*
|
||||||
* @param size int, largeur des Blocks unitraires des Sudokus à crééer.
|
* @param size int, largeur des Blocks unitraires des Sudokus à crééer.
|
||||||
* @return MultiDoku, MultiDoku de forme X.
|
* @return MultiDoku, MultiDoku de forme X.
|
||||||
*/
|
*/
|
||||||
public static MultiDoku createBasicXShapedMultidoku(int size, List<Constraint> constraints) {
|
public static MultiDoku createBasicXShapedMultidoku(int size, List<IConstraint> constraints) {
|
||||||
assert (size > 1);
|
assert (size > 1);
|
||||||
|
|
||||||
/*
|
return createBasicXShapedMultidoku(size, size, constraints);
|
||||||
* 2 3
|
|
||||||
* 1
|
|
||||||
* 4 5
|
|
||||||
*/
|
|
||||||
|
|
||||||
Sudoku sudoku1 = createSquareSudoku(size, constraints);
|
|
||||||
Sudoku sudoku2 = createSquareSudoku(size, constraints);
|
|
||||||
Sudoku sudoku3 = createSquareSudoku(size, constraints);
|
|
||||||
Sudoku sudoku4 = createSquareSudoku(size, constraints);
|
|
||||||
Sudoku sudoku5 = createSquareSudoku(size, constraints);
|
|
||||||
|
|
||||||
linkSquareSudokus(sudoku1, sudoku2, new Coordinate(1 - size, 1 - size));
|
|
||||||
linkSquareSudokus(sudoku1, sudoku3, new Coordinate(size - 1, 1 - size));
|
|
||||||
linkSquareSudokus(sudoku1, sudoku4, new Coordinate(1 - size, size - 1));
|
|
||||||
linkSquareSudokus(sudoku1, sudoku5, new Coordinate(size - 1, size - 1));
|
|
||||||
|
|
||||||
return new MultiDoku(Arrays.asList(sudoku1, sudoku2, sudoku3, sudoku4, sudoku5));
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Créée un MultiDoku de Blocks rectangulaires de forme width par height composé de cinq Sudokus,
|
* Créée un MultiDoku de Blocks rectangulaires de forme X, de taille width par height composé
|
||||||
|
* de cinq Sudokus,
|
||||||
* dont un central qui partage chacun de ses Blocks d'angle avec un autre
|
* dont un central qui partage chacun de ses Blocks d'angle avec un autre
|
||||||
* Sudoku.
|
* Sudoku.
|
||||||
*
|
|
||||||
* @param width int, largeur des Blocks unitraires des Sudokus à crééer.
|
|
||||||
* @param height int, hauteur des Blocks unitraires des Sudokus à crééer.
|
|
||||||
* @return MultiDoku, MultiDoku de forme X.
|
|
||||||
*/
|
|
||||||
public static MultiDoku createBasicXShapedMultidoku(int width, int height, List<Constraint> constraints) {
|
|
||||||
assert (width > 1 && height > 1);
|
|
||||||
|
|
||||||
/*
|
|
||||||
* 2 3
|
* 2 3
|
||||||
* 1
|
* 1
|
||||||
* 4 5
|
* 4 5
|
||||||
|
*
|
||||||
|
* @param width int, largeur des Blocks unitaires des Sudokus à crééer.
|
||||||
|
* @param height int, hauteur des Blocks unitaires des Sudokus à crééer.
|
||||||
|
* @return MultiDoku, MultiDoku de forme X.
|
||||||
*/
|
*/
|
||||||
|
public static MultiDoku createBasicXShapedMultidoku(int width, int height, List<IConstraint> constraints) {
|
||||||
|
assert (width > 1 && height > 1);
|
||||||
|
|
||||||
Sudoku sudoku1 = createRectangleSudoku(width, height, constraints);
|
Sudoku sudoku1 = createRectangleSudoku(width, height, constraints);
|
||||||
Sudoku sudoku2 = createRectangleSudoku(width, height, constraints);
|
Sudoku sudoku2 = createRectangleSudoku(width, height, constraints);
|
||||||
@@ -263,41 +205,73 @@ public class SudokuFactory {
|
|||||||
Sudoku sudoku4 = createRectangleSudoku(width, height, constraints);
|
Sudoku sudoku4 = createRectangleSudoku(width, height, constraints);
|
||||||
Sudoku sudoku5 = createRectangleSudoku(width, height, constraints);
|
Sudoku sudoku5 = createRectangleSudoku(width, height, constraints);
|
||||||
|
|
||||||
linkSquareSudokus(sudoku1, sudoku2, new Coordinate(1 - width, 1 - height));
|
linkRectangleSudokus(sudoku1, sudoku2, new Coordinate(1 - height, 1 - width));
|
||||||
linkSquareSudokus(sudoku1, sudoku3, new Coordinate(width - 1, 1 - height));
|
linkRectangleSudokus(sudoku1, sudoku3, new Coordinate(height - 1, 1 - width));
|
||||||
linkSquareSudokus(sudoku1, sudoku4, new Coordinate(1 - width, height - 1));
|
linkRectangleSudokus(sudoku1, sudoku4, new Coordinate(1 - height, width - 1));
|
||||||
linkSquareSudokus(sudoku1, sudoku5, new Coordinate(width - 1, height - 1));
|
linkRectangleSudokus(sudoku1, sudoku5, new Coordinate(height - 1, width - 1));
|
||||||
|
|
||||||
return new MultiDoku(Arrays.asList(sudoku1, sudoku2, sudoku3, sudoku4, sudoku5));
|
return new MultiDoku(Arrays.asList(sudoku1, sudoku2, sudoku3, sudoku4, sudoku5));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static void fillDoku(MultiDoku doku, Difficulty difficulty) throws Exception {
|
/**
|
||||||
Solver solver = new RandomSolver();
|
* Créée un MultiDoku de Blocks carrés de forme +, de taille size composé
|
||||||
solver.solve(doku);
|
* de cinq Sudokus,
|
||||||
int nbCellsToEmpty = (int) (difficulty.getFactor() * doku.getNbCells());
|
* dont un central qui partage chacun de ses Blocks de bord avec un autre
|
||||||
boolean successfull = newDokuFromFilledOne(doku, nbCellsToEmpty, solver);
|
* Sudoku.
|
||||||
if (!successfull) {
|
* 3
|
||||||
throw new Exception("Canno't create this doku with this difficulty");
|
* 2 1 4
|
||||||
}
|
* 5
|
||||||
doku.setFilledCellsImmutable();
|
*
|
||||||
|
* @param size int, largeur des Blocks unitaires des Sudokus à crééer.
|
||||||
|
* @return MultiDoku, MultiDoku de forme +.
|
||||||
|
*/
|
||||||
|
public static MultiDoku createBasicPlusShapedMultidoku(int size, List<IConstraint> constraints) {
|
||||||
|
assert (size > 1);
|
||||||
|
|
||||||
|
return createBasicPlusShapedMultidoku(size, size, constraints);
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MultiDoku fromfile(String filePath) {
|
/**
|
||||||
try {
|
* Créée un MultiDoku de Blocks rectangulaires de forme +, de taille width par height composé
|
||||||
String content = Files.readString(Paths.get(filePath));
|
* de cinq Sudokus,
|
||||||
MultiDoku doku = SudokuSerializer.deserializeSudoku(content);
|
* dont un central qui partage chacun de ses Blocks de bord avec un autre
|
||||||
return doku;
|
* Sudoku.
|
||||||
} catch (IOException e) {
|
* 3
|
||||||
e.printStackTrace();
|
* 2 1 4
|
||||||
return null;
|
* 5
|
||||||
}
|
*
|
||||||
|
* @param width int, largeur des Blocks unitaires des Sudokus à crééer.
|
||||||
|
* @param height int, hauteur des Blocks unitaires des Sudokus à crééer.
|
||||||
|
* @return MultiDoku, MultiDoku de forme +.
|
||||||
|
*/
|
||||||
|
public static MultiDoku createBasicPlusShapedMultidoku(int width, int height, List<IConstraint> constraints) {
|
||||||
|
assert (width > 1 && height > 1);
|
||||||
|
|
||||||
|
Sudoku sudoku1 = createRectangleSudoku(width, height, constraints);
|
||||||
|
Sudoku sudoku2 = createRectangleSudoku(width, height, constraints);
|
||||||
|
Sudoku sudoku3 = createRectangleSudoku(width, height, constraints);
|
||||||
|
Sudoku sudoku4 = createRectangleSudoku(width, height, constraints);
|
||||||
|
Sudoku sudoku5 = createRectangleSudoku(width, height, constraints);
|
||||||
|
|
||||||
|
linkRectangleSudokus(sudoku1, sudoku2, new Coordinate(1 - height, 0));
|
||||||
|
linkRectangleSudokus(sudoku1, sudoku3, new Coordinate(0, 1 - width));
|
||||||
|
linkRectangleSudokus(sudoku1, sudoku4, new Coordinate(height - 1, 0));
|
||||||
|
linkRectangleSudokus(sudoku1, sudoku5, new Coordinate(0, width - 1));
|
||||||
|
|
||||||
|
return new MultiDoku(Arrays.asList(sudoku1, sudoku2, sudoku3, sudoku4, sudoku5));
|
||||||
}
|
}
|
||||||
|
|
||||||
public static MultiDoku createBasicEmptyRandomBlockDoku(int blockSize, List<Constraint> constraints) {
|
/**
|
||||||
|
* Crée un Sudoku vide avec les Blocks aléatoires.
|
||||||
|
*
|
||||||
|
* @param blockSize int, la taille des Block.
|
||||||
|
* @param constraints List~IConstraint~, la liste des contraintes.
|
||||||
|
* @return MultiDoku, avec un seul Sudoku.
|
||||||
|
*/
|
||||||
|
public static MultiDoku createBasicEmptyRandomBlockDoku(int blockSize, List<IConstraint> constraints) {
|
||||||
int blockCellCount = blockSize * blockSize;
|
int blockCellCount = blockSize * blockSize;
|
||||||
List<Cell> cells = initCells(blockCellCount);
|
List<Cell> cells = initCells(blockCellCount);
|
||||||
List<Cell> homeLessCells = new ArrayList<>();
|
List<Cell> homeLessCells = new ArrayList<>(cells);
|
||||||
homeLessCells.addAll(cells);
|
|
||||||
List<Block> blocks = new ArrayList<>();
|
List<Block> blocks = new ArrayList<>();
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
for (int i = 0; i < blockCellCount; i++) {
|
for (int i = 0; i < blockCellCount; i++) {
|
||||||
@@ -314,6 +288,84 @@ public class SudokuFactory {
|
|||||||
for (Block block : blocks) {
|
for (Block block : blocks) {
|
||||||
block.getSudokus().add(sudoku);
|
block.getSudokus().add(sudoku);
|
||||||
}
|
}
|
||||||
return new MultiDoku(Arrays.asList(sudoku));
|
return new MultiDoku(List.of(sudoku));
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Créée un MultiDoku de difficulté difficulty à partir d'un MultiDoku fourni.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, MultiDoku dont on doit vider des Cells.
|
||||||
|
* @param nbCellsToEmpty int, nombre de cases à retirer.
|
||||||
|
* @return boolean, valant true si un MultiDoku de difficulté donnée peut être
|
||||||
|
* créée, false sinon.
|
||||||
|
* @throws Exception si la difficulté n'est pas compatible avec la taille du
|
||||||
|
* MultiDoku.
|
||||||
|
*/
|
||||||
|
public static boolean newDokuFromFilledOne(MultiDoku doku, int nbCellsToEmpty, Solver solver) throws Exception {
|
||||||
|
|
||||||
|
if (nbCellsToEmpty >= doku.getCells().size()) {
|
||||||
|
throw new Exception();
|
||||||
|
}
|
||||||
|
|
||||||
|
if (nbCellsToEmpty == 0) {
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
|
||||||
|
List<Cell> cellsThatCanBeEmptied = doku.getFilledCells();
|
||||||
|
|
||||||
|
int index = random.nextInt(cellsThatCanBeEmptied.size());
|
||||||
|
Cell cellToEmpty = cellsThatCanBeEmptied.get(index);
|
||||||
|
|
||||||
|
cellToEmpty.empty();
|
||||||
|
|
||||||
|
int nbDokuSultions = solver.countSolution(doku);
|
||||||
|
if (nbDokuSultions == 1) {
|
||||||
|
return newDokuFromFilledOne(doku, --nbCellsToEmpty, solver);
|
||||||
|
}
|
||||||
|
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Rempli un MultiDoku donné par rapport à un difficulté.
|
||||||
|
*
|
||||||
|
* @param doku MultiDoku, vide.
|
||||||
|
* @param difficulty Difficulty, qui correspond au pourcentage de cases à enlever.
|
||||||
|
*/
|
||||||
|
public static void fillDoku(MultiDoku doku, Difficulty difficulty) throws Exception {
|
||||||
|
Solver solver = new RandomSolver();
|
||||||
|
solver.solve(doku);
|
||||||
|
int nbCellsToEmpty = (int) (difficulty.getFactor() * doku.getNbCells());
|
||||||
|
newDokuFromFilledOne(doku, nbCellsToEmpty, solver);
|
||||||
|
doku.setFilledCellsImmutable();
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Génère un MultiDoku à partir d'un fichier de sauvegarde.
|
||||||
|
*
|
||||||
|
* @param filePath String, chemin du fichier.
|
||||||
|
* @return MultiDoku.
|
||||||
|
*/
|
||||||
|
public static MultiDoku fromfile(String filePath) {
|
||||||
|
try {
|
||||||
|
String content = Files.readString(Paths.get(filePath));
|
||||||
|
return SudokuSerializer.deserializeSudoku(content);
|
||||||
|
} catch (IOException e) {
|
||||||
|
e.printStackTrace();
|
||||||
|
return null;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Transforme des Constraints en IConstraints correspondants.
|
||||||
|
* @param constraints List~Constraints~
|
||||||
|
* @return List~IConstraints~
|
||||||
|
*/
|
||||||
|
public static List<IConstraint> fromConstraints(List<Constraint> constraints) {
|
||||||
|
List<IConstraint> iconstraints = new ArrayList<>();
|
||||||
|
for (Constraint cons : constraints) {
|
||||||
|
iconstraints.add(cons.getConstraint());
|
||||||
|
}
|
||||||
|
return iconstraints;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
|
Before Width: | Height: | Size: 399 KiB After Width: | Height: | Size: 399 KiB |
@@ -1,7 +1,6 @@
|
|||||||
package sudoku;
|
package sudoku;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
import static org.junit.jupiter.api.Assertions.assertTrue;
|
|
||||||
|
|
||||||
import java.io.File;
|
import java.io.File;
|
||||||
import java.util.Random;
|
import java.util.Random;
|
||||||
@@ -22,7 +21,7 @@ public class SudokuSerializerTest {
|
|||||||
new RandomSolver().solve(sudoku);
|
new RandomSolver().solve(sudoku);
|
||||||
JSONObject data = SudokuSerializer.serializeSudoku(sudoku);
|
JSONObject data = SudokuSerializer.serializeSudoku(sudoku);
|
||||||
MultiDoku multiDoku = SudokuSerializer.deserializeSudoku(data);
|
MultiDoku multiDoku = SudokuSerializer.deserializeSudoku(data);
|
||||||
assertTrue(data.toString().equals(SudokuSerializer.serializeSudoku(multiDoku).toString()));
|
assertEquals(data.toString(), SudokuSerializer.serializeSudoku(multiDoku).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
void testSaveWithSize(int blockWidth, int blockHeight) {
|
void testSaveWithSize(int blockWidth, int blockHeight) {
|
||||||
@@ -41,7 +40,7 @@ public class SudokuSerializerTest {
|
|||||||
File fileToDelete = new File(savePath);
|
File fileToDelete = new File(savePath);
|
||||||
fileToDelete.delete();
|
fileToDelete.delete();
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
e.printStackTrace();
|
System.out.println(e.getMessage());
|
||||||
assert false;
|
assert false;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -52,25 +51,27 @@ public class SudokuSerializerTest {
|
|||||||
JSONObject data = SudokuSerializer.serializeSudoku(sudoku);
|
JSONObject data = SudokuSerializer.serializeSudoku(sudoku);
|
||||||
MultiDoku multiDoku = SudokuSerializer.deserializeSudoku(data);
|
MultiDoku multiDoku = SudokuSerializer.deserializeSudoku(data);
|
||||||
|
|
||||||
assertTrue(data.toString().equals(SudokuSerializer.serializeSudoku(multiDoku).toString()));
|
assertEquals(data.toString(), SudokuSerializer.serializeSudoku(multiDoku).toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
@Test
|
@Test
|
||||||
void testSerialize() {
|
void testSerialize() {
|
||||||
Random r = new Random();
|
Random r = new Random();
|
||||||
int testCount = 20;
|
int testCount = 20;
|
||||||
|
int minSize = 2;
|
||||||
|
int maxSize = 3;
|
||||||
for (int i = 0; i < testCount; i++) {
|
for (int i = 0; i < testCount; i++) {
|
||||||
int blockWidth = r.nextInt(4) + 1;
|
int blockWidth = r.nextInt(maxSize - minSize + 1) + minSize;
|
||||||
int blockHeight = r.nextInt(4) + 1;
|
int blockHeight = r.nextInt(maxSize - minSize + 1) + minSize;
|
||||||
testSerializeWithSize(blockWidth, blockHeight);
|
testSerializeWithSize(blockWidth, blockHeight);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < testCount; i++) {
|
for (int i = 0; i < testCount; i++) {
|
||||||
int blockWidth = r.nextInt(4) + 1;
|
int blockWidth = r.nextInt(maxSize - minSize + 1) + minSize;
|
||||||
int blockHeight = r.nextInt(4) + 1;
|
int blockHeight = r.nextInt(maxSize - minSize + 1) + minSize;
|
||||||
testSaveWithSize(blockWidth, blockHeight);
|
testSaveWithSize(blockWidth, blockHeight);
|
||||||
}
|
}
|
||||||
for (int i = 0; i < testCount; i++) {
|
for (int i = 0; i < testCount; i++) {
|
||||||
int size = r.nextInt(2) + 2;
|
int size = r.nextInt(maxSize - minSize + 1) + minSize;
|
||||||
testSerializeX(size);
|
testSerializeX(size);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -1,32 +1,68 @@
|
|||||||
package sudoku.solver;
|
package sudoku.solver;
|
||||||
|
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertFalse;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertNotEquals;
|
||||||
|
import static org.junit.jupiter.api.Assertions.assertTrue;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.junit.jupiter.api.BeforeAll;
|
||||||
import org.junit.jupiter.api.Test;
|
import org.junit.jupiter.api.Test;
|
||||||
import sudoku.io.SudokuPrinter;
|
|
||||||
import sudoku.io.SudokuSerializer;
|
import sudoku.io.SudokuSerializer;
|
||||||
import sudoku.structure.Cell;
|
import sudoku.structure.Cell;
|
||||||
|
import sudoku.structure.Difficulty;
|
||||||
import sudoku.structure.MultiDoku;
|
import sudoku.structure.MultiDoku;
|
||||||
import sudoku.structure.Sudoku;
|
import sudoku.structure.Sudoku;
|
||||||
import sudoku.structure.SudokuFactory;
|
import sudoku.structure.SudokuFactory;
|
||||||
|
|
||||||
import static org.junit.jupiter.api.Assertions.assertEquals;
|
|
||||||
|
|
||||||
import java.util.List;
|
|
||||||
import java.util.Random;
|
|
||||||
|
|
||||||
class SolverTest {
|
class SolverTest {
|
||||||
|
private final int ns = Cell.NOSYMBOL;
|
||||||
|
protected static HumanSolver h;
|
||||||
|
private static RandomSolver r;
|
||||||
|
private static MixedSolver m;
|
||||||
|
|
||||||
@Test
|
@BeforeAll
|
||||||
void solveTest() {
|
public static void initializeSolvers() {
|
||||||
Random rand = new Random();
|
h = new HumanSolver();
|
||||||
|
r = new RandomSolver();
|
||||||
|
m = new MixedSolver();
|
||||||
|
}
|
||||||
|
|
||||||
MultiDoku dokuToTest = SudokuFactory.createBasicEmptySquareDoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
private void testSize2(Solver solver) {
|
||||||
MultiDoku dokuResult = SudokuFactory.createBasicEmptySquareDoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
MultiDoku mdTest = SudokuFactory.createBasicEmptySquareDoku(2, SudokuFactory.DEFAULT_CONSTRAINTS);
|
||||||
|
MultiDoku mdResult = SudokuFactory.createBasicEmptySquareDoku(2, SudokuFactory.DEFAULT_CONSTRAINTS);
|
||||||
|
Sudoku test = mdTest.getSubGrid(0);
|
||||||
|
Sudoku result = mdResult.getSubGrid(0);
|
||||||
|
List<Integer> immutableCells = List.of(
|
||||||
|
ns, 2, 3, ns,
|
||||||
|
0, ns, ns, ns,
|
||||||
|
ns, ns, ns, 3,
|
||||||
|
ns, 0, 1, ns);
|
||||||
|
assertTrue(test.setImmutableCellsSymbol(immutableCells));
|
||||||
|
List<Integer> correctCells = List.of(
|
||||||
|
1, 2, 3, 0,
|
||||||
|
0, 3, 2, 1,
|
||||||
|
2, 1, 0, 3,
|
||||||
|
3, 0, 1, 2);
|
||||||
|
assertTrue(result.setCellsSymbol(correctCells));
|
||||||
|
assertTrue(result.isSolved());
|
||||||
|
|
||||||
Sudoku sudokuToTest = dokuToTest.getSubGrid(0);
|
assertNotEquals(mdResult, mdTest);
|
||||||
Sudoku sudokuResult = dokuResult.getSubGrid(0);
|
solver.solve(mdTest);
|
||||||
|
assertTrue(mdTest.isSolved());
|
||||||
|
|
||||||
int ns = Cell.NOSYMBOL;
|
assertEquals(mdTest, mdResult);
|
||||||
List<Integer> immutableCells = List.of(ns, ns, 0, ns, ns, 2, 8, ns, 1,
|
}
|
||||||
|
|
||||||
|
private void testSize3(Solver solver) {
|
||||||
|
MultiDoku mdTest = SudokuFactory.createBasicEmptySquareDoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
||||||
|
MultiDoku mdResult = SudokuFactory.createBasicEmptySquareDoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
||||||
|
Sudoku test = mdTest.getSubGrid(0);
|
||||||
|
Sudoku result = mdResult.getSubGrid(0);
|
||||||
|
List<Integer> immutableCells = List.of(
|
||||||
|
ns, ns, 0, ns, ns, 2, 8, ns, 1,
|
||||||
ns, 3, ns, ns, 5, 6, 7, ns, ns,
|
ns, 3, ns, ns, 5, 6, 7, ns, ns,
|
||||||
ns, ns, ns, 8, ns, 7, ns, ns, 6,
|
ns, ns, ns, 8, ns, 7, ns, ns, 6,
|
||||||
0, ns, 1, ns, ns, ns, ns, ns, ns,
|
0, ns, 1, ns, ns, ns, ns, ns, ns,
|
||||||
@@ -35,12 +71,9 @@ class SolverTest {
|
|||||||
ns, ns, 6, ns, ns, 8, ns, 7, 5,
|
ns, ns, 6, ns, ns, 8, ns, 7, 5,
|
||||||
8, 0, ns, 7, ns, 5, 2, ns, 3,
|
8, 0, ns, 7, ns, 5, 2, ns, 3,
|
||||||
5, ns, ns, ns, 3, 1, 0, ns, ns);
|
5, ns, ns, ns, 3, 1, 0, ns, ns);
|
||||||
|
assert (test.setImmutableCellsSymbol(immutableCells));
|
||||||
assert (sudokuToTest.setImmutableCellsSymbol(immutableCells));
|
List<Integer> correctCells = List.of(
|
||||||
|
7, 6, 0, 3, 4, 2, 8, 5, 1,
|
||||||
SudokuPrinter.printRectangleSudoku(dokuToTest.getSubGrid(0), 3, 3);
|
|
||||||
|
|
||||||
List<Integer> correctCells = List.of(7, 6, 0, 3, 4, 2, 8, 5, 1,
|
|
||||||
2, 3, 8, 1, 5, 6, 7, 0, 4,
|
2, 3, 8, 1, 5, 6, 7, 0, 4,
|
||||||
1, 4, 5, 8, 0, 7, 3, 2, 6,
|
1, 4, 5, 8, 0, 7, 3, 2, 6,
|
||||||
0, 2, 1, 6, 8, 3, 5, 4, 7,
|
0, 2, 1, 6, 8, 3, 5, 4, 7,
|
||||||
@@ -49,54 +82,43 @@ class SolverTest {
|
|||||||
3, 1, 6, 0, 2, 8, 4, 7, 5,
|
3, 1, 6, 0, 2, 8, 4, 7, 5,
|
||||||
8, 0, 4, 7, 6, 5, 2, 1, 3,
|
8, 0, 4, 7, 6, 5, 2, 1, 3,
|
||||||
5, 7, 2, 4, 3, 1, 0, 6, 8);
|
5, 7, 2, 4, 3, 1, 0, 6, 8);
|
||||||
|
assert (result.setCellsSymbol(correctCells));
|
||||||
|
assert (result.isSolved());
|
||||||
|
|
||||||
sudokuResult.setCellsSymbol(correctCells);
|
assertNotEquals(mdResult, mdTest);
|
||||||
|
solver.solve(mdTest);
|
||||||
System.out.println("\n****************************Doku Control\n");
|
assert (mdTest.isSolved());
|
||||||
SudokuPrinter.printRectangleSudoku(sudokuResult, 3, 3);
|
assertEquals(mdTest, mdResult);
|
||||||
|
|
||||||
assert (dokuResult.isSolved());
|
|
||||||
|
|
||||||
new RandomSolver().solve(dokuToTest);
|
|
||||||
|
|
||||||
System.out.println("\n****************************\nDoku solved");
|
|
||||||
SudokuPrinter.printRectangleSudoku(dokuToTest.getSubGrid(0), 3, 3);
|
|
||||||
|
|
||||||
assert (dokuToTest.isSolved());
|
|
||||||
|
|
||||||
for (Cell cell : sudokuToTest.getCells()) {
|
|
||||||
cell.setImmutable();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
for (Cell cell : sudokuResult.getCells()) {
|
private void testMDSize3(Solver solver) {
|
||||||
cell.setImmutable();
|
MultiDoku mdTest = SudokuFactory.createBasicXShapedMultidoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
||||||
|
try {
|
||||||
|
SudokuFactory.fillDoku(mdTest, Difficulty.Easy);
|
||||||
|
} catch (Exception e) {
|
||||||
|
assert (false);
|
||||||
|
}
|
||||||
|
MultiDoku mdResult = SudokuSerializer.deserializeSudoku(SudokuSerializer.serializeSudoku(mdTest));
|
||||||
|
assertFalse(mdTest.isSolved());
|
||||||
|
assertFalse(mdResult.isSolved());
|
||||||
|
assertTrue(solver.solve(mdTest));
|
||||||
|
assertTrue(mdTest.isSolved());
|
||||||
|
assertFalse(mdResult.isSolved());
|
||||||
|
assertNotEquals(mdTest, mdResult);
|
||||||
|
solver.solve(mdResult);
|
||||||
|
assertEquals(mdTest, mdResult);
|
||||||
}
|
}
|
||||||
|
|
||||||
assertEquals(SudokuSerializer.serializeSudoku(dokuResult).toString(),
|
@Test
|
||||||
SudokuSerializer.serializeSudoku(dokuToTest).toString());
|
void solveTest() {
|
||||||
|
initializeSolvers();
|
||||||
MultiDoku dokuToTest2 = SudokuFactory.createBasicEmptySquareDoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
testSize2(h);
|
||||||
Sudoku sudokuToTest2 = dokuToTest2.getSubGrid(0);
|
testSize3(h);
|
||||||
|
testSize2(m);
|
||||||
List<Integer> immutableCells2 = List.of(ns, ns, 0, ns, ns, 2, 8, ns, 1,
|
testSize3(m);
|
||||||
1, 3, ns, ns, 5, 6, 7, ns, ns,
|
testMDSize3(m);
|
||||||
ns, ns, ns, 8, ns, 7, ns, ns, 6,
|
testSize2(r);
|
||||||
0, ns, 1, ns, ns, ns, ns, ns, ns,
|
testSize3(r);
|
||||||
4, 8, 7, 5, 1, ns, 6, ns, ns,
|
testMDSize3(r);
|
||||||
6, ns, 3, 2, ns, ns, ns, 8, 0,
|
|
||||||
ns, ns, 6, ns, ns, 8, ns, 7, 5,
|
|
||||||
8, 0, ns, 7, ns, 5, 2, ns, 3,
|
|
||||||
5, ns, ns, ns, 3, 1, 0, ns, ns);
|
|
||||||
sudokuToTest2.setImmutableCellsSymbol(immutableCells2);
|
|
||||||
|
|
||||||
boolean isSolved = new RandomSolver().solve(dokuToTest2);
|
|
||||||
|
|
||||||
assert (!isSolved);
|
|
||||||
|
|
||||||
MultiDoku dokuToTest3 = SudokuFactory.createBasicEmptySquareDoku(3, SudokuFactory.DEFAULT_CONSTRAINTS);
|
|
||||||
|
|
||||||
new RandomSolver().solve(dokuToTest3);
|
|
||||||
|
|
||||||
SudokuPrinter.printRectangleSudoku(dokuToTest3.getSubGrid(0), 3, 3);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
271
javadoc/allclasses-index.html
Normal file
271
javadoc/allclasses-index.html
Normal file
@@ -0,0 +1,271 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>All Classes and Interfaces</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="class index">
|
||||||
|
<meta name="generator" content="javadoc/AllClassesIndexWriter">
|
||||||
|
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="script.js"></script>
|
||||||
|
<script type="text/javascript" src="script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="all-classes-index-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "./";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="index.html">Overview</a></li>
|
||||||
|
<li>Package</li>
|
||||||
|
<li>Class</li>
|
||||||
|
<li><a href="overview-tree.html">Tree</a></li>
|
||||||
|
<li><a href="index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="help-doc.html#all-classes">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list"></div>
|
||||||
|
<div class="nav-list-search"><a href="search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<div class="header">
|
||||||
|
<h1 title="All Classes and Interfaces" class="title">All Classes and Interfaces</h1>
|
||||||
|
</div>
|
||||||
|
<div id="all-classes-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="all-classes-table-tab0" role="tab" aria-selected="true" aria-controls="all-classes-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table', 2)" class="active-table-tab">All Classes and Interfaces</button><button id="all-classes-table-tab1" role="tab" aria-selected="false" aria-controls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table-tab1', 2)" class="table-tab">Interfaces</button><button id="all-classes-table-tab2" role="tab" aria-selected="false" aria-controls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table-tab2', 2)" class="table-tab">Classes</button><button id="all-classes-table-tab3" role="tab" aria-selected="false" aria-controls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table-tab3', 2)" class="table-tab">Enum Classes</button><button id="all-classes-table-tab4" role="tab" aria-selected="false" aria-controls="all-classes-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('all-classes-table', 'all-classes-table-tab4', 2)" class="table-tab">Record Classes</button></div>
|
||||||
|
<div id="all-classes-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table two-column-summary" aria-labelledby="all-classes-table-tab0">
|
||||||
|
<div class="table-header col-first">Class</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/widget/AnimatedBackground.html" title="class in gui.widget">AnimatedBackground</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/AssetManager.html" title="class in gui">AssetManager</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/solver/BacktrackingSolver.html" title="class in sudoku.solver">BacktrackingSolver</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/BaseView.html" title="class in gui.menu">BaseView</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/structure/Block.html" title="class in sudoku.structure">Block</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Class qui représente les Block de chaque Sudoku,
|
||||||
|
Un Block étant un ensemble de cellule avec une contrainte de block qui lui
|
||||||
|
ait associé.</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/constraint/BlockConstraint.html" title="class in sudoku.constraint">BlockConstraint</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Contrainte de bloc</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/structure/Cell.html" title="class in sudoku.structure">Cell</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Représente une case d'un, ou plusieurs, sudoku qui à comme valeur un index de symbole.</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/ChangeCellPacket.html" title="class in network.protocol.packets">ChangeCellPacket</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/client/Client.html" title="class in network.client">Client</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/client/ClientConnexion.html" title="class in network.client">ClientConnexion</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/ColorGenerator.html" title="class in gui">ColorGenerator</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/ColorGenerator.Color.html" title="class in gui">ColorGenerator.Color</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/constraint/ColumnConstraint.html" title="class in sudoku.constraint">ColumnConstraint</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Contrainte de colonne</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/Connexion.html" title="class in network">Connexion</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/ConnexionInfoPacket.html" title="class in network.protocol.packets">ConnexionInfoPacket</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/ConnexionStatusView.html" title="class in gui.menu">ConnexionStatusView</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/ConnexionThread.html" title="class in network">ConnexionThread</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/io/ConsoleInterface.html" title="class in sudoku.io">ConsoleInterface</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab3"><a href="sudoku/constraint/Constraint.html" title="enum class in sudoku.constraint">Constraint</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab3">
|
||||||
|
<div class="block">Enumération utilisée afin de simplifier l'affichage en graphique.</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="common/ConsumerSignal.html" title="class in common">ConsumerSignal<T></a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/structure/Coordinate.html" title="class in sudoku.structure">Coordinate</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Représente les coordonnées d'une Cell.</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/constraint/DiagonalConstraint.html" title="class in sudoku.constraint">DiagonalConstraint</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Contrainte de diagonale</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab3"><a href="sudoku/structure/Difficulty.html" title="enum class in sudoku.structure">Difficulty</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab3">
|
||||||
|
<div class="block">Les difficultés d'un Sudoku,
|
||||||
|
représente le nombre de cases à enlever, en proportion, à un Sudoku.</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/DisconnectPacket.html" title="class in network.protocol.packets">DisconnectPacket</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/EndGamePacket.html" title="class in network.protocol.packets">EndGamePacket</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/EndGameView.html" title="class in gui.menu">EndGameView</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/constants/Fonts.html" title="class in gui.constants">Fonts</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="game/Game.html" title="class in game">Game</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab3"><a href="game/Game.GameState.html" title="enum class in game">Game.GameState</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab3"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/solver/HintHelper.html" title="class in sudoku.solver">HintHelper</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab4"><a href="sudoku/solver/HintHelper.Hint.html" title="class in sudoku.solver">HintHelper.Hint</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/solver/HumanSolver.html" title="class in sudoku.solver">HumanSolver</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab1"><a href="sudoku/constraint/IConstraint.html" title="interface in sudoku.constraint">IConstraint</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab1">
|
||||||
|
<div class="block">Interface de base pour la déclaration d'une contrainte
|
||||||
|
Elle est en théorie assez générique pour implémenter n'importe quelle
|
||||||
|
contrainte</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/constants/Images.html" title="class in gui.constants">Images</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/server/KeepAliveHandler.html" title="class in network.server">KeepAliveHandler</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/KeepAlivePacket.html" title="class in network.protocol.packets">KeepAlivePacket</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/widget/LeaderboardRenderer.html" title="class in gui.widget">LeaderboardRenderer</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/constraint/LineConstraint.html" title="class in sudoku.constraint">LineConstraint</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Contrainte de ligne</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/LoginPacket.html" title="class in network.protocol.packets">LoginPacket</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/Main.html" title="class in gui">Main</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/Main.html" title="class in sudoku">Main</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/MainMenu.html" title="class in gui.menu">MainMenu</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/solver/MixedSolver.html" title="class in sudoku.solver">MixedSolver</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Class : MultiDoku
|
||||||
|
Brief : Représente une grille de Multidoku.</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/MultiMenu.html" title="class in gui.menu">MultiMenu</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/widget/MultiPlayerCompleteProgress.html" title="class in gui.widget">MultiPlayerCompleteProgress</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/MultiPlayerDokuView.html" title="class in gui.menu">MultiPlayerDokuView</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/MultiPlayerView.html" title="class in gui.menu">MultiPlayerView</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/constants/Options.html" title="class in gui.constants">Options</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/OptionsMenu.html" title="class in gui.menu">OptionsMenu</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/Packet.html" title="class in network.protocol">Packet</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab3"><a href="network/protocol/Packets.html" title="enum class in network.protocol">Packets</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab3"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab1"><a href="network/protocol/PacketVisitor.html" title="interface in network.protocol">PacketVisitor</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab1"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="game/Player.html" title="class in game">Player</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/PlayerJoinPacket.html" title="class in network.protocol.packets">PlayerJoinPacket</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/PlayerLeavePacket.html" title="class in network.protocol.packets">PlayerLeavePacket</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/solver/RandomSolver.html" title="class in sudoku.solver">RandomSolver</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/RenderableMultidoku.html" title="class in gui">RenderableMultidoku</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/server/Server.html" title="class in network.server">Server</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/server/ServerAcceptThread.html" title="class in network.server">ServerAcceptThread</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/server/ServerConnexion.html" title="class in network.server">ServerConnexion</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/server/ServerLogicThread.html" title="class in network.server">ServerLogicThread</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="common/Signal.html" title="class in common">Signal</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/widget/SmoothProgressBar.html" title="class in gui.widget">SmoothProgressBar</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/SoloMenu.html" title="class in gui.menu">SoloMenu</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab1"><a href="sudoku/solver/Solver.html" title="interface in sudoku.solver">Solver</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab1"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/solver/SolverStep.html" title="class in sudoku.solver">SolverStep</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/StartGamePacket.html" title="class in network.protocol.packets">StartGamePacket</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/StateMachine.html" title="class in gui.menu">StateMachine</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/structure/StateManager.html" title="class in sudoku.structure">StateManager</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Une pile, qui réprésente les états d'un MultiDoku,
|
||||||
|
utile pour les Solvers.</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/solver/StupidSolver.html" title="class in sudoku.solver">StupidSolver</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Class de test non utilisé</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/structure/Sudoku.html" title="class in sudoku.structure">Sudoku</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Class : Sudoku
|
||||||
|
Brief : Représent un Sudoku</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/structure/SudokuFactory.html" title="class in sudoku.structure">SudokuFactory</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/io/SudokuPrinter.html" title="class in sudoku.io">SudokuPrinter</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="gui/widget/SudokuRenderer.html" title="class in gui.widget">SudokuRenderer</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/widget/SudokuSelector.html" title="class in gui.widget">SudokuSelector</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/io/SudokuSerializer.html" title="class in sudoku.io">SudokuSerializer</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2">
|
||||||
|
<div class="block">Classe permettant d'effectuer des opérations sur les sudokus afin de les
|
||||||
|
charger/sauvegarder</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="sudoku/SudokuSerializerTest.html" title="class in sudoku">SudokuSerializerTest</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab3"><a href="gui/constants/SudokuType.html" title="enum class in gui.constants">SudokuType</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab3"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/menu/SudokuView.html" title="class in gui.menu">SudokuView</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab3"><a href="gui/constants/Symbols.html" title="enum class in gui.constants">Symbols</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab3"> </div>
|
||||||
|
<div class="col-first odd-row-color all-classes-table all-classes-table-tab2"><a href="gui/widget/TimerRenderer.html" title="class in gui.widget">TimerRenderer</a></div>
|
||||||
|
<div class="col-last odd-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
<div class="col-first even-row-color all-classes-table all-classes-table-tab2"><a href="network/protocol/packets/UpdatePlayerScorePacket.html" title="class in network.protocol.packets">UpdatePlayerScorePacket</a></div>
|
||||||
|
<div class="col-last even-row-color all-classes-table all-classes-table-tab2"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
94
javadoc/allpackages-index.html
Normal file
94
javadoc/allpackages-index.html
Normal file
@@ -0,0 +1,94 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>All Packages</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="package index">
|
||||||
|
<meta name="generator" content="javadoc/AllPackagesIndexWriter">
|
||||||
|
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="script.js"></script>
|
||||||
|
<script type="text/javascript" src="script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="all-packages-index-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "./";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="index.html">Overview</a></li>
|
||||||
|
<li>Package</li>
|
||||||
|
<li>Class</li>
|
||||||
|
<li><a href="overview-tree.html">Tree</a></li>
|
||||||
|
<li><a href="index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="help-doc.html#all-packages">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list"></div>
|
||||||
|
<div class="nav-list-search"><a href="search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<div class="header">
|
||||||
|
<h1 title="All&nbsp;Packages" class="title">All Packages</h1>
|
||||||
|
</div>
|
||||||
|
<div class="caption"><span>Package Summary</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Package</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color"><a href="common/package-summary.html">common</a></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><a href="game/package-summary.html">game</a></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
<div class="col-first even-row-color"><a href="gui/package-summary.html">gui</a></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><a href="gui/constants/package-summary.html">gui.constants</a></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
<div class="col-first even-row-color"><a href="gui/menu/package-summary.html">gui.menu</a></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><a href="gui/widget/package-summary.html">gui.widget</a></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
<div class="col-first even-row-color"><a href="network/package-summary.html">network</a></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><a href="network/client/package-summary.html">network.client</a></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
<div class="col-first even-row-color"><a href="network/protocol/package-summary.html">network.protocol</a></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><a href="network/protocol/packets/package-summary.html">network.protocol.packets</a></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
<div class="col-first even-row-color"><a href="network/server/package-summary.html">network.server</a></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><a href="sudoku/package-summary.html">sudoku</a></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
<div class="col-first even-row-color"><a href="sudoku/constraint/package-summary.html">sudoku.constraint</a></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><a href="sudoku/io/package-summary.html">sudoku.io</a></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
<div class="col-first even-row-color"><a href="sudoku/solver/package-summary.html">sudoku.solver</a></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><a href="sudoku/structure/package-summary.html">sudoku.structure</a></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
190
javadoc/common/ConsumerSignal.html
Normal file
190
javadoc/common/ConsumerSignal.html
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>ConsumerSignal</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: common, class: ConsumerSignal">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Nested</li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a></li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a></li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li>Nested | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">common</a></div>
|
||||||
|
<h1 title="Class ConsumerSignal" class="title">Class ConsumerSignal<T></h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">common.ConsumerSignal<T></div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">ConsumerSignal<T></span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-summary" id="constructor-summary">
|
||||||
|
<h2>Constructor Summary</h2>
|
||||||
|
<div class="caption"><span>Constructors</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Constructor</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">ConsumerSignal</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clear()" class="member-name-link">clear</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#connect(java.util.function.Consumer)" class="member-name-link">connect</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="ConsumerSignal.html" title="type parameter in ConsumerSignal">T</a>> listener)</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#emit(T)" class="member-name-link">emit</a><wbr>(<a href="ConsumerSignal.html" title="type parameter in ConsumerSignal">T</a> arg)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-details" id="constructor-detail">
|
||||||
|
<h2>Constructor Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="<init>()">
|
||||||
|
<h3>ConsumerSignal</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">ConsumerSignal</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="connect(java.util.function.Consumer)">
|
||||||
|
<h3>connect</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">connect</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/function/Consumer.html" title="class or interface in java.util.function" class="external-link">Consumer</a><<a href="ConsumerSignal.html" title="type parameter in ConsumerSignal">T</a>> listener)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="clear()">
|
||||||
|
<h3>clear</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">clear</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="emit(T)">
|
||||||
|
<h3 id="emit(java.lang.Object)">emit</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">emit</span><wbr><span class="parameters">(<a href="ConsumerSignal.html" title="type parameter in ConsumerSignal">T</a> arg)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
190
javadoc/common/Signal.html
Normal file
190
javadoc/common/Signal.html
Normal file
@@ -0,0 +1,190 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>Signal</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: common, class: Signal">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Nested</li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a></li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a></li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li>Nested | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">common</a></div>
|
||||||
|
<h1 title="Class Signal" class="title">Class Signal</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">common.Signal</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">Signal</span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-summary" id="constructor-summary">
|
||||||
|
<h2>Constructor Summary</h2>
|
||||||
|
<div class="caption"><span>Constructors</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Constructor</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Signal</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#clear()" class="member-name-link">clear</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#connect(java.lang.Runnable)" class="member-name-link">connect</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> listener)</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#emit()" class="member-name-link">emit</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-details" id="constructor-detail">
|
||||||
|
<h2>Constructor Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="<init>()">
|
||||||
|
<h3>Signal</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">Signal</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="connect(java.lang.Runnable)">
|
||||||
|
<h3>connect</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">connect</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Runnable.html" title="class or interface in java.lang" class="external-link">Runnable</a> listener)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="clear()">
|
||||||
|
<h3>clear</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">clear</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="emit()">
|
||||||
|
<h3>emit</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">emit</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
93
javadoc/common/package-summary.html
Normal file
93
javadoc/common/package-summary.html
Normal file
@@ -0,0 +1,93 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>common</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: common">
|
||||||
|
<meta name="generator" content="javadoc/PackageWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="package-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Package</li>
|
||||||
|
<li>Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#package">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Package:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Description</li>
|
||||||
|
<li>Related Packages</li>
|
||||||
|
<li><a href="#class-summary">Classes and Interfaces</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Package: </li>
|
||||||
|
<li>Description | </li>
|
||||||
|
<li>Related Packages | </li>
|
||||||
|
<li><a href="#class-summary">Classes and Interfaces</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<div class="header">
|
||||||
|
<h1 title="Package common" class="title">Package common</h1>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="package-signature">package <span class="element-name">common</span></div>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<li>
|
||||||
|
<div id="class-summary">
|
||||||
|
<div class="caption"><span>Classes</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Class</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="ConsumerSignal.html" title="class in common">ConsumerSignal</a><T></div>
|
||||||
|
<div class="col-last even-row-color class-summary class-summary-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color class-summary class-summary-tab2"><a href="Signal.html" title="class in common">Signal</a></div>
|
||||||
|
<div class="col-last odd-row-color class-summary class-summary-tab2"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
72
javadoc/common/package-tree.html
Normal file
72
javadoc/common/package-tree.html
Normal file
@@ -0,0 +1,72 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>common Class Hierarchy</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="tree: package: common">
|
||||||
|
<meta name="generator" content="javadoc/PackageTreeWriter">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="package-tree-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li>Class</li>
|
||||||
|
<li class="nav-bar-cell1-rev">Tree</li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#tree">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list"></div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<div class="header">
|
||||||
|
<h1 class="title">Hierarchy For Package common</h1>
|
||||||
|
</div>
|
||||||
|
<span class="package-hierarchy-label">Package Hierarchies:</span>
|
||||||
|
<ul class="horizontal contents-list">
|
||||||
|
<li><a href="../overview-tree.html">All Packages</a></li>
|
||||||
|
</ul>
|
||||||
|
<section class="hierarchy">
|
||||||
|
<h2 title="Class Hierarchy">Class Hierarchy</h2>
|
||||||
|
<ul>
|
||||||
|
<li class="circle">java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" class="type-name-link external-link" title="class or interface in java.lang">Object</a>
|
||||||
|
<ul>
|
||||||
|
<li class="circle">common.<a href="ConsumerSignal.html" class="type-name-link" title="class in common">ConsumerSignal</a><T></li>
|
||||||
|
<li class="circle">common.<a href="Signal.html" class="type-name-link" title="class in common">Signal</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
97
javadoc/constant-values.html
Normal file
97
javadoc/constant-values.html
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>Constant Field Values</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="summary of constants">
|
||||||
|
<meta name="generator" content="javadoc/ConstantsSummaryWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="script.js"></script>
|
||||||
|
<script type="text/javascript" src="script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="constants-summary-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "./";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="index.html">Overview</a></li>
|
||||||
|
<li>Package</li>
|
||||||
|
<li>Class</li>
|
||||||
|
<li><a href="overview-tree.html">Tree</a></li>
|
||||||
|
<li><a href="index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="help-doc.html#constant-values">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list"></div>
|
||||||
|
<div class="nav-list-search"><a href="search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<div class="header">
|
||||||
|
<h1 title="Constant Field Values" class="title">Constant Field Values</h1>
|
||||||
|
</div>
|
||||||
|
<section class="packages">
|
||||||
|
<h2 title="Contents">Contents</h2>
|
||||||
|
<ul class="contents-list">
|
||||||
|
<li><a href="#sudoku.io">sudoku.io.*</a></li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="constants-summary" id="sudoku.io">
|
||||||
|
<h2 title="sudoku.io.*">sudoku.io.*</h2>
|
||||||
|
<ul class="block-list">
|
||||||
|
<li>
|
||||||
|
<div class="caption"><span>sudoku.io.<a href="sudoku/io/SudokuPrinter.html" title="class in sudoku.io">SudokuPrinter</a></span></div>
|
||||||
|
<div class="summary-table three-column-summary">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Constant Field</div>
|
||||||
|
<div class="table-header col-last">Value</div>
|
||||||
|
<div class="col-first even-row-color"><code id="sudoku.io.SudokuPrinter.ANSI_BLUE">public static final <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
||||||
|
<div class="col-second even-row-color"><code><a href="sudoku/io/SudokuPrinter.html#ANSI_BLUE">ANSI_BLUE</a></code></div>
|
||||||
|
<div class="col-last even-row-color"><code>"\u001b[34m"</code></div>
|
||||||
|
<div class="col-first odd-row-color"><code id="sudoku.io.SudokuPrinter.ANSI_CYAN">public static final <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
||||||
|
<div class="col-second odd-row-color"><code><a href="sudoku/io/SudokuPrinter.html#ANSI_CYAN">ANSI_CYAN</a></code></div>
|
||||||
|
<div class="col-last odd-row-color"><code>"\u001b[36m"</code></div>
|
||||||
|
<div class="col-first even-row-color"><code id="sudoku.io.SudokuPrinter.ANSI_GREEN">public static final <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
||||||
|
<div class="col-second even-row-color"><code><a href="sudoku/io/SudokuPrinter.html#ANSI_GREEN">ANSI_GREEN</a></code></div>
|
||||||
|
<div class="col-last even-row-color"><code>"\u001b[32m"</code></div>
|
||||||
|
<div class="col-first odd-row-color"><code id="sudoku.io.SudokuPrinter.ANSI_PURPLE">public static final <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
||||||
|
<div class="col-second odd-row-color"><code><a href="sudoku/io/SudokuPrinter.html#ANSI_PURPLE">ANSI_PURPLE</a></code></div>
|
||||||
|
<div class="col-last odd-row-color"><code>"\u001b[35m"</code></div>
|
||||||
|
<div class="col-first even-row-color"><code id="sudoku.io.SudokuPrinter.ANSI_RED">public static final <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
||||||
|
<div class="col-second even-row-color"><code><a href="sudoku/io/SudokuPrinter.html#ANSI_RED">ANSI_RED</a></code></div>
|
||||||
|
<div class="col-last even-row-color"><code>"\u001b[31m"</code></div>
|
||||||
|
<div class="col-first odd-row-color"><code id="sudoku.io.SudokuPrinter.ANSI_RESET">public static final <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
||||||
|
<div class="col-second odd-row-color"><code><a href="sudoku/io/SudokuPrinter.html#ANSI_RESET">ANSI_RESET</a></code></div>
|
||||||
|
<div class="col-last odd-row-color"><code>"\u001b[0m"</code></div>
|
||||||
|
<div class="col-first even-row-color"><code id="sudoku.io.SudokuPrinter.ANSI_YELLOW">public static final <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
||||||
|
<div class="col-second even-row-color"><code><a href="sudoku/io/SudokuPrinter.html#ANSI_YELLOW">ANSI_YELLOW</a></code></div>
|
||||||
|
<div class="col-last even-row-color"><code>"\u001b[33m"</code></div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
33
javadoc/copy.svg
Normal file
33
javadoc/copy.svg
Normal file
@@ -0,0 +1,33 @@
|
|||||||
|
<?xml version="1.0" encoding="UTF-8"?>
|
||||||
|
|
||||||
|
<!--
|
||||||
|
Copyright (c) 2021, Oracle and/or its affiliates. All rights reserved.
|
||||||
|
ORACLE PROPRIETARY/CONFIDENTIAL. Use is subject to license terms.
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
-->
|
||||||
|
|
||||||
|
<svg version="1.1" xmlns="http://www.w3.org/2000/svg" viewBox="0 0 380 460" fill="#505050">
|
||||||
|
<path
|
||||||
|
d="M 346,8 H 108 C 90,8 75,23 75,41 v 316 c 0,18 15,33 33,33 h 238 c 18,0 33,-15 33,-33 V 41 C 379,23 364,8 346,8 Z m -8,344 H 116 c -2,0 -3,-1 -3,-3 V 49 c 0,-2 1,-3 3,-3 h 222 c 2,0 3,1 3,3 v 300 h 10e-4 c 0,2 -1,3 -3,3 z"/>
|
||||||
|
<path
|
||||||
|
d="m 290,389 v 26 h 10e-4 c 0,2 -1,3 -3,3 H 49 c -2,0 -3,-1 -3,-3 V 99 c 0,-2 1,-3 3,-3 h 27 v 0 l -5e-4,-38 H 41 C 23,58 8,73 8,91 v 332 c 10e-4,18 15,33 33,33 h 254 c 18,0 33,-15 33,-33 v -34"/>
|
||||||
|
</svg>
|
||||||
|
After Width: | Height: | Size: 758 B |
16
javadoc/element-list
Normal file
16
javadoc/element-list
Normal file
@@ -0,0 +1,16 @@
|
|||||||
|
common
|
||||||
|
game
|
||||||
|
gui
|
||||||
|
gui.constants
|
||||||
|
gui.menu
|
||||||
|
gui.widget
|
||||||
|
network
|
||||||
|
network.client
|
||||||
|
network.protocol
|
||||||
|
network.protocol.packets
|
||||||
|
network.server
|
||||||
|
sudoku
|
||||||
|
sudoku.constraint
|
||||||
|
sudoku.io
|
||||||
|
sudoku.solver
|
||||||
|
sudoku.structure
|
||||||
235
javadoc/game/Game.GameState.html
Normal file
235
javadoc/game/Game.GameState.html
Normal file
@@ -0,0 +1,235 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>Game.GameState</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: game, class: Game, enum: GameState">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#nested-class-summary">Nested</a></li>
|
||||||
|
<li><a href="#enum-constant-summary">Enum Constants</a></li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#enum-constant-detail">Enum Constants</a></li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li><a href="#nested-class-summary">Nested</a> | </li>
|
||||||
|
<li><a href="#enum-constant-summary">Enum Constants</a> | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li><a href="#enum-constant-detail">Enum Constants</a> | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">game</a></div>
|
||||||
|
<h1 title="Enum Class Game.GameState" class="title">Enum Class Game.GameState</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">java.lang.Enum</a><<a href="Game.GameState.html" title="enum class in game">Game.GameState</a>>
|
||||||
|
<div class="inheritance">game.Game.GameState</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>All Implemented Interfaces:</dt>
|
||||||
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code>, <code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a><<a href="Game.GameState.html" title="enum class in game">Game.GameState</a>></code>, <code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/constant/Constable.html" title="class or interface in java.lang.constant" class="external-link">Constable</a></code></dd>
|
||||||
|
</dl>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Enclosing class:</dt>
|
||||||
|
<dd><code><a href="Game.html" title="class in game">Game</a></code></dd>
|
||||||
|
</dl>
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public static enum </span><span class="element-name type-name-label">Game.GameState</span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a><<a href="Game.GameState.html" title="enum class in game">Game.GameState</a>></span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="nested-class-summary" id="nested-class-summary">
|
||||||
|
<h2>Nested Class Summary</h2>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h2 id="nested-classes-inherited-from-class-java.lang.Enum">Nested classes/interfaces inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a></h2>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.EnumDesc.html" title="class or interface in java.lang" class="external-link">Enum.EnumDesc</a><<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.EnumDesc.html" title="class or interface in java.lang" class="external-link">E</a> extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a><<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.EnumDesc.html" title="class or interface in java.lang" class="external-link">E</a>>></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- =========== ENUM CONSTANT SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="constants-summary" id="enum-constant-summary">
|
||||||
|
<h2>Enum Constant Summary</h2>
|
||||||
|
<div class="caption"><span>Enum Constants</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Enum Constant</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color"><code><a href="#GameGoing" class="member-name-link">GameGoing</a></code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><code><a href="#GameNotStarted" class="member-name-link">GameNotStarted</a></code></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="Game.GameState.html" title="enum class in game">Game.GameState</a></code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#valueOf(java.lang.String)" class="member-name-link">valueOf</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
|
||||||
|
<div class="block">Returns the enum constant of this class with the specified name.</div>
|
||||||
|
</div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="Game.GameState.html" title="enum class in game">Game.GameState</a>[]</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#values()" class="member-name-link">values</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
|
||||||
|
<div class="block">Returns an array containing the constants of this enum class, in
|
||||||
|
the order they are declared.</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Enum">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html" title="class or interface in java.lang" class="external-link">Enum</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#compareTo(E)" title="class or interface in java.lang" class="external-link">compareTo</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#describeConstable()" title="class or interface in java.lang" class="external-link">describeConstable</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#getDeclaringClass()" title="class or interface in java.lang" class="external-link">getDeclaringClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#name()" title="class or interface in java.lang" class="external-link">name</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#ordinal()" title="class or interface in java.lang" class="external-link">ordinal</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html#valueOf(java.lang.Class,java.lang.String)" title="class or interface in java.lang" class="external-link">valueOf</a></code></div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ============ ENUM CONSTANT DETAIL =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="constant-details" id="enum-constant-detail">
|
||||||
|
<h2>Enum Constant Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="GameNotStarted">
|
||||||
|
<h3>GameNotStarted</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type"><a href="Game.GameState.html" title="enum class in game">Game.GameState</a></span> <span class="element-name">GameNotStarted</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="GameGoing">
|
||||||
|
<h3>GameGoing</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static final</span> <span class="return-type"><a href="Game.GameState.html" title="enum class in game">Game.GameState</a></span> <span class="element-name">GameGoing</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="values()">
|
||||||
|
<h3>values</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="Game.GameState.html" title="enum class in game">Game.GameState</a>[]</span> <span class="element-name">values</span>()</div>
|
||||||
|
<div class="block">Returns an array containing the constants of this enum class, in
|
||||||
|
the order they are declared.</div>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Returns:</dt>
|
||||||
|
<dd>an array containing the constants of this enum class, in the order they are declared</dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="valueOf(java.lang.String)">
|
||||||
|
<h3>valueOf</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="Game.GameState.html" title="enum class in game">Game.GameState</a></span> <span class="element-name">valueOf</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</span></div>
|
||||||
|
<div class="block">Returns the enum constant of this class with the specified name.
|
||||||
|
The string must match <i>exactly</i> an identifier used to declare an
|
||||||
|
enum constant in this class. (Extraneous whitespace characters are
|
||||||
|
not permitted.)</div>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Parameters:</dt>
|
||||||
|
<dd><code>name</code> - the name of the enum constant to be returned.</dd>
|
||||||
|
<dt>Returns:</dt>
|
||||||
|
<dd>the enum constant with the specified name</dd>
|
||||||
|
<dt>Throws:</dt>
|
||||||
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/IllegalArgumentException.html" title="class or interface in java.lang" class="external-link">IllegalArgumentException</a></code> - if this enum class has no constant with the specified name</dd>
|
||||||
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/NullPointerException.html" title="class or interface in java.lang" class="external-link">NullPointerException</a></code> - if the argument is null</dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
292
javadoc/game/Game.html
Normal file
292
javadoc/game/Game.html
Normal file
@@ -0,0 +1,292 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>Game</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: game, class: Game">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#nested-class-summary">Nested</a></li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a></li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a></li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li><a href="#nested-class-summary">Nested</a> | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">game</a></div>
|
||||||
|
<h1 title="Class Game" class="title">Class Game</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">game.Game</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">Game</span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="nested-class-summary" id="nested-class-summary">
|
||||||
|
<h2>Nested Class Summary</h2>
|
||||||
|
<div class="caption"><span>Nested Classes</span></div>
|
||||||
|
<div class="summary-table three-column-summary">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Class</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color"><code>static enum </code></div>
|
||||||
|
<div class="col-second even-row-color"><code><a href="Game.GameState.html" class="type-name-link" title="enum class in game">Game.GameState</a></code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-summary" id="constructor-summary">
|
||||||
|
<h2>Constructor Summary</h2>
|
||||||
|
<div class="caption"><span>Constructors</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Constructor</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Game</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#addPlayer(game.Player)" class="member-name-link">addPlayer</a><wbr>(<a href="Player.html" title="class in game">Player</a> player)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a></code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDoku()" class="member-name-link">getDoku</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>long</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getGameDuration()" class="member-name-link">getGameDuration</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Game.GameState.html" title="enum class in game">Game.GameState</a></code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getGameState()" class="member-name-link">getGameState</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><wbr><<a href="Player.html" title="class in game">Player</a>></code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getLeaderboard()" class="member-name-link">getLeaderboard</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="Player.html" title="class in game">Player</a></code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPlayerById(int)" class="member-name-link">getPlayerById</a><wbr>(int id)</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><wbr><<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>,<wbr><a href="Player.html" title="class in game">Player</a>></code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPlayers()" class="member-name-link">getPlayers</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a></code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getStartTime()" class="member-name-link">getStartTime</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#removePlayer(int)" class="member-name-link">removePlayer</a><wbr>(int id)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#setPlayerRemainingCells(game.Player,int)" class="member-name-link">setPlayerRemainingCells</a><wbr>(<a href="Player.html" title="class in game">Player</a> player,
|
||||||
|
int newScore)</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#startGame(sudoku.structure.MultiDoku,java.time.Instant,long)" class="member-name-link">startGame</a><wbr>(<a href="../sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a> doku,
|
||||||
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a> startTime,
|
||||||
|
long gameDuration)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#stopGame()" class="member-name-link">stopGame</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-details" id="constructor-detail">
|
||||||
|
<h2>Constructor Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="<init>()">
|
||||||
|
<h3>Game</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">Game</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getPlayerById(int)">
|
||||||
|
<h3>getPlayerById</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="Player.html" title="class in game">Player</a></span> <span class="element-name">getPlayerById</span><wbr><span class="parameters">(int id)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="addPlayer(game.Player)">
|
||||||
|
<h3>addPlayer</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">addPlayer</span><wbr><span class="parameters">(<a href="Player.html" title="class in game">Player</a> player)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="setPlayerRemainingCells(game.Player,int)">
|
||||||
|
<h3>setPlayerRemainingCells</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">setPlayerRemainingCells</span><wbr><span class="parameters">(<a href="Player.html" title="class in game">Player</a> player,
|
||||||
|
int newScore)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="removePlayer(int)">
|
||||||
|
<h3>removePlayer</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">removePlayer</span><wbr><span class="parameters">(int id)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getPlayers()">
|
||||||
|
<h3>getPlayers</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/Map.html" title="class or interface in java.util" class="external-link">Map</a><<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Integer.html" title="class or interface in java.lang" class="external-link">Integer</a>,<wbr><a href="Player.html" title="class in game">Player</a>></span> <span class="element-name">getPlayers</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="startGame(sudoku.structure.MultiDoku,java.time.Instant,long)">
|
||||||
|
<h3>startGame</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">startGame</span><wbr><span class="parameters">(<a href="../sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a> doku,
|
||||||
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a> startTime,
|
||||||
|
long gameDuration)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="stopGame()">
|
||||||
|
<h3>stopGame</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">stopGame</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getGameState()">
|
||||||
|
<h3>getGameState</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="Game.GameState.html" title="enum class in game">Game.GameState</a></span> <span class="element-name">getGameState</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getDoku()">
|
||||||
|
<h3>getDoku</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a></span> <span class="element-name">getDoku</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getLeaderboard()">
|
||||||
|
<h3>getLeaderboard</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="Player.html" title="class in game">Player</a>></span> <span class="element-name">getLeaderboard</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getStartTime()">
|
||||||
|
<h3>getStartTime</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/time/Instant.html" title="class or interface in java.time" class="external-link">Instant</a></span> <span class="element-name">getStartTime</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getGameDuration()">
|
||||||
|
<h3>getGameDuration</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">long</span> <span class="element-name">getGameDuration</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
205
javadoc/game/Player.html
Normal file
205
javadoc/game/Player.html
Normal file
@@ -0,0 +1,205 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>Player</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: game, class: Player">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Nested</li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a></li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a></li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li>Nested | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">game</a></div>
|
||||||
|
<h1 title="Class Player" class="title">Class Player</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">game.Player</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>All Implemented Interfaces:</dt>
|
||||||
|
<dd><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></code></dd>
|
||||||
|
</dl>
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">Player</span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a>
|
||||||
|
implements <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a></span></div>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>See Also:</dt>
|
||||||
|
<dd>
|
||||||
|
<ul class="tag-list">
|
||||||
|
<li><a href="../serialized-form.html#game.Player">Serialized Form</a></li>
|
||||||
|
</ul>
|
||||||
|
</dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-summary" id="constructor-summary">
|
||||||
|
<h2>Constructor Summary</h2>
|
||||||
|
<div class="caption"><span>Constructors</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Constructor</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(int,java.lang.String)" class="member-name-link">Player</a><wbr>(int id,
|
||||||
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> pseudo)</code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getId()" class="member-name-link">getId</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getPseudo()" class="member-name-link">getPseudo</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getRemainingCells()" class="member-name-link">getRemainingCells</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-details" id="constructor-detail">
|
||||||
|
<h2>Constructor Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="<init>(int,java.lang.String)">
|
||||||
|
<h3>Player</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">Player</span><wbr><span class="parameters">(int id,
|
||||||
|
<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> pseudo)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getRemainingCells()">
|
||||||
|
<h3>getRemainingCells</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getRemainingCells</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getPseudo()">
|
||||||
|
<h3>getPseudo</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a></span> <span class="element-name">getPseudo</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getId()">
|
||||||
|
<h3>getId</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getId</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
97
javadoc/game/package-summary.html
Normal file
97
javadoc/game/package-summary.html
Normal file
@@ -0,0 +1,97 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>game</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: game">
|
||||||
|
<meta name="generator" content="javadoc/PackageWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="package-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Package</li>
|
||||||
|
<li>Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#package">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Package:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Description</li>
|
||||||
|
<li>Related Packages</li>
|
||||||
|
<li><a href="#class-summary">Classes and Interfaces</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Package: </li>
|
||||||
|
<li>Description | </li>
|
||||||
|
<li>Related Packages | </li>
|
||||||
|
<li><a href="#class-summary">Classes and Interfaces</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<div class="header">
|
||||||
|
<h1 title="Package game" class="title">Package game</h1>
|
||||||
|
</div>
|
||||||
|
<hr>
|
||||||
|
<div class="package-signature">package <span class="element-name">game</span></div>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<li>
|
||||||
|
<div id="class-summary">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="class-summary-tab0" role="tab" aria-selected="true" aria-controls="class-summary.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('class-summary', 'class-summary', 2)" class="active-table-tab">All Classes and Interfaces</button><button id="class-summary-tab2" role="tab" aria-selected="false" aria-controls="class-summary.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('class-summary', 'class-summary-tab2', 2)" class="table-tab">Classes</button><button id="class-summary-tab3" role="tab" aria-selected="false" aria-controls="class-summary.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('class-summary', 'class-summary-tab3', 2)" class="table-tab">Enum Classes</button></div>
|
||||||
|
<div id="class-summary.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table two-column-summary" aria-labelledby="class-summary-tab0">
|
||||||
|
<div class="table-header col-first">Class</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="Game.html" title="class in game">Game</a></div>
|
||||||
|
<div class="col-last even-row-color class-summary class-summary-tab2"> </div>
|
||||||
|
<div class="col-first odd-row-color class-summary class-summary-tab3"><a href="Game.GameState.html" title="enum class in game">Game.GameState</a></div>
|
||||||
|
<div class="col-last odd-row-color class-summary class-summary-tab3"> </div>
|
||||||
|
<div class="col-first even-row-color class-summary class-summary-tab2"><a href="Player.html" title="class in game">Player</a></div>
|
||||||
|
<div class="col-last even-row-color class-summary class-summary-tab2"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
86
javadoc/game/package-tree.html
Normal file
86
javadoc/game/package-tree.html
Normal file
@@ -0,0 +1,86 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>game Class Hierarchy</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="tree: package: game">
|
||||||
|
<meta name="generator" content="javadoc/PackageTreeWriter">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="package-tree-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li>Class</li>
|
||||||
|
<li class="nav-bar-cell1-rev">Tree</li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#tree">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list"></div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<div class="header">
|
||||||
|
<h1 class="title">Hierarchy For Package game</h1>
|
||||||
|
</div>
|
||||||
|
<span class="package-hierarchy-label">Package Hierarchies:</span>
|
||||||
|
<ul class="horizontal contents-list">
|
||||||
|
<li><a href="../overview-tree.html">All Packages</a></li>
|
||||||
|
</ul>
|
||||||
|
<section class="hierarchy">
|
||||||
|
<h2 title="Class Hierarchy">Class Hierarchy</h2>
|
||||||
|
<ul>
|
||||||
|
<li class="circle">java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" class="type-name-link external-link" title="class or interface in java.lang">Object</a>
|
||||||
|
<ul>
|
||||||
|
<li class="circle">game.<a href="Game.html" class="type-name-link" title="class in game">Game</a></li>
|
||||||
|
<li class="circle">game.<a href="Player.html" class="type-name-link" title="class in game">Player</a> (implements java.io.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a>)</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="hierarchy">
|
||||||
|
<h2 title="Enum Class Hierarchy">Enum Class Hierarchy</h2>
|
||||||
|
<ul>
|
||||||
|
<li class="circle">java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" class="type-name-link external-link" title="class or interface in java.lang">Object</a>
|
||||||
|
<ul>
|
||||||
|
<li class="circle">java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Enum.html" class="type-name-link external-link" title="class or interface in java.lang">Enum</a><E> (implements java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Comparable.html" title="class or interface in java.lang" class="external-link">Comparable</a><T>, java.lang.constant.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/constant/Constable.html" title="class or interface in java.lang.constant" class="external-link">Constable</a>, java.io.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/io/Serializable.html" title="class or interface in java.io" class="external-link">Serializable</a>)
|
||||||
|
<ul>
|
||||||
|
<li class="circle">game.<a href="Game.GameState.html" class="type-name-link" title="enum class in game">Game.GameState</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
172
javadoc/gui/AssetManager.html
Normal file
172
javadoc/gui/AssetManager.html
Normal file
@@ -0,0 +1,172 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>AssetManager</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: gui, class: AssetManager">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Nested</li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a></li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a></li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li>Nested | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">gui</a></div>
|
||||||
|
<h1 title="Class AssetManager" class="title">Class AssetManager</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">gui.AssetManager</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">AssetManager</span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-summary" id="constructor-summary">
|
||||||
|
<h2>Constructor Summary</h2>
|
||||||
|
<div class="caption"><span>Constructors</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Constructor</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">AssetManager</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static byte[]</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#getResource(java.lang.String)" class="member-name-link">getResource</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-details" id="constructor-detail">
|
||||||
|
<h2>Constructor Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="<init>()">
|
||||||
|
<h3>AssetManager</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">AssetManager</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getResource(java.lang.String)">
|
||||||
|
<h3>getResource</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type">byte[]</span> <span class="element-name">getResource</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a> name)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
200
javadoc/gui/ColorGenerator.Color.html
Normal file
200
javadoc/gui/ColorGenerator.Color.html
Normal file
@@ -0,0 +1,200 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>ColorGenerator.Color</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: gui, class: ColorGenerator, class: Color">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Nested</li>
|
||||||
|
<li><a href="#field-summary">Field</a></li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a></li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#field-detail">Field</a></li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a></li>
|
||||||
|
<li>Method</li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li>Nested | </li>
|
||||||
|
<li><a href="#field-summary">Field</a> | </li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li><a href="#field-detail">Field</a> | </li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
||||||
|
<li>Method</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">gui</a></div>
|
||||||
|
<h1 title="Class ColorGenerator.Color" class="title">Class ColorGenerator.Color</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">gui.ColorGenerator.Color</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Enclosing class:</dt>
|
||||||
|
<dd><code><a href="ColorGenerator.html" title="class in gui">ColorGenerator</a></code></dd>
|
||||||
|
</dl>
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public static class </span><span class="element-name type-name-label">ColorGenerator.Color</span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- =========== FIELD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="field-summary" id="field-summary">
|
||||||
|
<h2>Field Summary</h2>
|
||||||
|
<div class="caption"><span>Fields</span></div>
|
||||||
|
<div class="summary-table three-column-summary">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Field</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color"><code>float</code></div>
|
||||||
|
<div class="col-second even-row-color"><code><a href="#b" class="member-name-link">b</a></code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
<div class="col-first odd-row-color"><code>float</code></div>
|
||||||
|
<div class="col-second odd-row-color"><code><a href="#g" class="member-name-link">g</a></code></div>
|
||||||
|
<div class="col-last odd-row-color"> </div>
|
||||||
|
<div class="col-first even-row-color"><code>float</code></div>
|
||||||
|
<div class="col-second even-row-color"><code><a href="#r" class="member-name-link">r</a></code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-summary" id="constructor-summary">
|
||||||
|
<h2>Constructor Summary</h2>
|
||||||
|
<div class="caption"><span>Constructors</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Constructor</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E(float,float,float)" class="member-name-link">Color</a><wbr>(float r,
|
||||||
|
float g,
|
||||||
|
float b)</code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ============ FIELD DETAIL =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="field-details" id="field-detail">
|
||||||
|
<h2>Field Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="r">
|
||||||
|
<h3>r</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">float</span> <span class="element-name">r</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="g">
|
||||||
|
<h3>g</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">float</span> <span class="element-name">g</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="b">
|
||||||
|
<h3>b</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">float</span> <span class="element-name">b</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-details" id="constructor-detail">
|
||||||
|
<h2>Constructor Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="<init>(float,float,float)">
|
||||||
|
<h3>Color</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">Color</span><wbr><span class="parameters">(float r,
|
||||||
|
float g,
|
||||||
|
float b)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
225
javadoc/gui/ColorGenerator.html
Normal file
225
javadoc/gui/ColorGenerator.html
Normal file
@@ -0,0 +1,225 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>ColorGenerator</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: gui, class: ColorGenerator">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li><a href="#nested-class-summary">Nested</a></li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a></li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a></li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li><a href="#nested-class-summary">Nested</a> | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">gui</a></div>
|
||||||
|
<h1 title="Class ColorGenerator" class="title">Class ColorGenerator</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">gui.ColorGenerator</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">ColorGenerator</span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- ======== NESTED CLASS SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="nested-class-summary" id="nested-class-summary">
|
||||||
|
<h2>Nested Class Summary</h2>
|
||||||
|
<div class="caption"><span>Nested Classes</span></div>
|
||||||
|
<div class="summary-table three-column-summary">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Class</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color"><code>static class </code></div>
|
||||||
|
<div class="col-second even-row-color"><code><a href="ColorGenerator.Color.html" class="type-name-link" title="class in gui">ColorGenerator.Color</a></code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-summary" id="constructor-summary">
|
||||||
|
<h2>Constructor Summary</h2>
|
||||||
|
<div class="caption"><span>Constructors</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Constructor</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">ColorGenerator</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><wbr><<a href="ColorGenerator.Color.html" title="class in gui">ColorGenerator.Color</a>></code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#greatPalette(int)" class="member-name-link">greatPalette</a><wbr>(int colorCount)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><wbr><<a href="ColorGenerator.Color.html" title="class in gui">ColorGenerator.Color</a>></code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#greatScheme(int)" class="member-name-link">greatScheme</a><wbr>(int colorCount)</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="ColorGenerator.Color.html" title="class in gui">ColorGenerator.Color</a></code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#hslToRgb(float,float,float)" class="member-name-link">hslToRgb</a><wbr>(float h,
|
||||||
|
float s,
|
||||||
|
float l)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static float</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#hueToRgb(float,float,float)" class="member-name-link">hueToRgb</a><wbr>(float p,
|
||||||
|
float q,
|
||||||
|
float t)</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4">
|
||||||
|
<div class="block">Helper method that converts hue to rgb</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-details" id="constructor-detail">
|
||||||
|
<h2>Constructor Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="<init>()">
|
||||||
|
<h3>ColorGenerator</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">ColorGenerator</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="greatPalette(int)">
|
||||||
|
<h3>greatPalette</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="ColorGenerator.Color.html" title="class in gui">ColorGenerator.Color</a>></span> <span class="element-name">greatPalette</span><wbr><span class="parameters">(int colorCount)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="greatScheme(int)">
|
||||||
|
<h3>greatScheme</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="ColorGenerator.Color.html" title="class in gui">ColorGenerator.Color</a>></span> <span class="element-name">greatScheme</span><wbr><span class="parameters">(int colorCount)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="hslToRgb(float,float,float)">
|
||||||
|
<h3>hslToRgb</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="ColorGenerator.Color.html" title="class in gui">ColorGenerator.Color</a></span> <span class="element-name">hslToRgb</span><wbr><span class="parameters">(float h,
|
||||||
|
float s,
|
||||||
|
float l)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="hueToRgb(float,float,float)">
|
||||||
|
<h3>hueToRgb</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type">float</span> <span class="element-name">hueToRgb</span><wbr><span class="parameters">(float p,
|
||||||
|
float q,
|
||||||
|
float t)</span></div>
|
||||||
|
<div class="block">Helper method that converts hue to rgb</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
256
javadoc/gui/Main.html
Normal file
256
javadoc/gui/Main.html
Normal file
@@ -0,0 +1,256 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>Main</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: gui, class: Main">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Nested</li>
|
||||||
|
<li><a href="#field-summary">Field</a></li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a></li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Field</li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a></li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li>Nested | </li>
|
||||||
|
<li><a href="#field-summary">Field</a> | </li>
|
||||||
|
<li><a href="#constructor-summary">Constr</a> | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li><a href="#constructor-detail">Constr</a> | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">gui</a></div>
|
||||||
|
<h1 title="Class Main" class="title">Class Main</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">imgui.app.Window
|
||||||
|
<div class="inheritance">imgui.app.Application
|
||||||
|
<div class="inheritance">gui.Main</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">Main</span>
|
||||||
|
<span class="extends-implements">extends imgui.app.Application</span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- =========== FIELD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="field-summary" id="field-summary">
|
||||||
|
<h2>Field Summary</h2>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="fields-inherited-from-class-imgui.app.Window">Fields inherited from class imgui.app.Window</h3>
|
||||||
|
<code>colorBg, handle, imGuiGl3, imGuiGlfw</code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ======== CONSTRUCTOR SUMMARY ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-summary" id="constructor-summary">
|
||||||
|
<h2>Constructor Summary</h2>
|
||||||
|
<div class="caption"><span>Constructors</span></div>
|
||||||
|
<div class="summary-table two-column-summary">
|
||||||
|
<div class="table-header col-first">Constructor</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-constructor-name even-row-color"><code><a href="#%3Cinit%3E()" class="member-name-link">Main</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color"> </div>
|
||||||
|
</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#configure(imgui.app.Configuration)" class="member-name-link">configure</a><wbr>(imgui.app.Configuration config)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#disposeWindow()" class="member-name-link">disposeWindow</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#initImGui(imgui.app.Configuration)" class="member-name-link">initImGui</a><wbr>(imgui.app.Configuration config)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static void</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#main(java.lang.String%5B%5D)" class="member-name-link">main</a><wbr>(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] args)</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>protected void</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#preRun()" class="member-name-link">preRun</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>void</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#process()" class="member-name-link">process</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-imgui.app.Application">Methods inherited from class imgui.app.Application</h3>
|
||||||
|
<code>launch, postRun</code></div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-imgui.app.Window">Methods inherited from class imgui.app.Window</h3>
|
||||||
|
<code>dispose, disposeImGui, endFrame, getColorBg, getHandle, init, initWindow, postProcess, preProcess, run, runFrame, startFrame</code></div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ========= CONSTRUCTOR DETAIL ======== -->
|
||||||
|
<li>
|
||||||
|
<section class="constructor-details" id="constructor-detail">
|
||||||
|
<h2>Constructor Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="<init>()">
|
||||||
|
<h3>Main</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="element-name">Main</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="configure(imgui.app.Configuration)">
|
||||||
|
<h3>configure</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">configure</span><wbr><span class="parameters">(imgui.app.Configuration config)</span></div>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Overrides:</dt>
|
||||||
|
<dd><code>configure</code> in class <code>imgui.app.Application</code></dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="disposeWindow()">
|
||||||
|
<h3>disposeWindow</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">disposeWindow</span>()</div>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Overrides:</dt>
|
||||||
|
<dd><code>disposeWindow</code> in class <code>imgui.app.Window</code></dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="initImGui(imgui.app.Configuration)">
|
||||||
|
<h3>initImGui</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">initImGui</span><wbr><span class="parameters">(imgui.app.Configuration config)</span></div>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Overrides:</dt>
|
||||||
|
<dd><code>initImGui</code> in class <code>imgui.app.Window</code></dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="preRun()">
|
||||||
|
<h3>preRun</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">protected</span> <span class="return-type">void</span> <span class="element-name">preRun</span>()</div>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Overrides:</dt>
|
||||||
|
<dd><code>preRun</code> in class <code>imgui.app.Application</code></dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="process()">
|
||||||
|
<h3>process</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">void</span> <span class="element-name">process</span>()</div>
|
||||||
|
<dl class="notes">
|
||||||
|
<dt>Specified by:</dt>
|
||||||
|
<dd><code>process</code> in class <code>imgui.app.Window</code></dd>
|
||||||
|
</dl>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="main(java.lang.String[])">
|
||||||
|
<h3>main</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type">void</span> <span class="element-name">main</span><wbr><span class="parameters">(<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/String.html" title="class or interface in java.lang" class="external-link">String</a>[] args)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
201
javadoc/gui/RenderableMultidoku.html
Normal file
201
javadoc/gui/RenderableMultidoku.html
Normal file
@@ -0,0 +1,201 @@
|
|||||||
|
<!DOCTYPE HTML>
|
||||||
|
<html lang="fr">
|
||||||
|
<head>
|
||||||
|
<!-- Generated by javadoc (21) on Sun Feb 02 23:54:14 CET 2025 -->
|
||||||
|
<title>RenderableMultidoku</title>
|
||||||
|
<meta name="viewport" content="width=device-width, initial-scale=1">
|
||||||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||||||
|
<meta name="dc.created" content="2025-02-02">
|
||||||
|
<meta name="description" content="declaration: package: gui, class: RenderableMultidoku">
|
||||||
|
<meta name="generator" content="javadoc/ClassWriterImpl">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../stylesheet.css" title="Style">
|
||||||
|
<link rel="stylesheet" type="text/css" href="../script-dir/jquery-ui.min.css" title="Style">
|
||||||
|
<script type="text/javascript" src="../script.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-3.6.1.min.js"></script>
|
||||||
|
<script type="text/javascript" src="../script-dir/jquery-ui.min.js"></script>
|
||||||
|
</head>
|
||||||
|
<body class="class-declaration-page">
|
||||||
|
<script type="text/javascript">var pathtoroot = "../";
|
||||||
|
loadScripts(document, 'script');</script>
|
||||||
|
<noscript>
|
||||||
|
<div>JavaScript is disabled on your browser.</div>
|
||||||
|
</noscript>
|
||||||
|
<div class="flex-box">
|
||||||
|
<header role="banner" class="flex-header">
|
||||||
|
<nav role="navigation">
|
||||||
|
<!-- ========= START OF TOP NAVBAR ======= -->
|
||||||
|
<div class="top-nav" id="navbar-top"><button id="navbar-toggle-button" aria-controls="navbar-top" aria-expanded="false" aria-label="Toggle navigation links"><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span><span class="nav-bar-toggle-icon"> </span></button>
|
||||||
|
<div class="skip-nav"><a href="#skip-navbar-top" title="Skip navigation links">Skip navigation links</a></div>
|
||||||
|
<ul id="navbar-top-firstrow" class="nav-list" title="Navigation">
|
||||||
|
<li><a href="../index.html">Overview</a></li>
|
||||||
|
<li><a href="package-summary.html">Package</a></li>
|
||||||
|
<li class="nav-bar-cell1-rev">Class</li>
|
||||||
|
<li><a href="package-tree.html">Tree</a></li>
|
||||||
|
<li><a href="../index-files/index-1.html">Index</a></li>
|
||||||
|
<li><a href="../help-doc.html#class">Help</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list-small">
|
||||||
|
<li>
|
||||||
|
<p>Summary:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Nested</li>
|
||||||
|
<li>Field</li>
|
||||||
|
<li>Constr</li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<p>Detail:</p>
|
||||||
|
<ul>
|
||||||
|
<li>Field</li>
|
||||||
|
<li>Constr</li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="sub-nav">
|
||||||
|
<div id="navbar-sub-list">
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Summary: </li>
|
||||||
|
<li>Nested | </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li>Constr | </li>
|
||||||
|
<li><a href="#method-summary">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
<ul class="sub-nav-list">
|
||||||
|
<li>Detail: </li>
|
||||||
|
<li>Field | </li>
|
||||||
|
<li>Constr | </li>
|
||||||
|
<li><a href="#method-detail">Method</a></li>
|
||||||
|
</ul>
|
||||||
|
</div>
|
||||||
|
<div class="nav-list-search"><a href="../search.html">SEARCH</a>
|
||||||
|
<input type="text" id="search-input" disabled placeholder="Search">
|
||||||
|
<input type="reset" id="reset-button" disabled value="reset">
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<!-- ========= END OF TOP NAVBAR ========= -->
|
||||||
|
<span class="skip-nav" id="skip-navbar-top"></span></nav>
|
||||||
|
</header>
|
||||||
|
<div class="flex-content">
|
||||||
|
<main role="main">
|
||||||
|
<!-- ======== START OF CLASS DATA ======== -->
|
||||||
|
<div class="header">
|
||||||
|
<div class="sub-title"><span class="package-label-in-type">Package</span> <a href="package-summary.html">gui</a></div>
|
||||||
|
<h1 title="Class RenderableMultidoku" class="title">Class RenderableMultidoku</h1>
|
||||||
|
</div>
|
||||||
|
<div class="inheritance" title="Inheritance Tree"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">java.lang.Object</a>
|
||||||
|
<div class="inheritance">gui.RenderableMultidoku</div>
|
||||||
|
</div>
|
||||||
|
<section class="class-description" id="class-description">
|
||||||
|
<hr>
|
||||||
|
<div class="type-signature"><span class="modifiers">public class </span><span class="element-name type-name-label">RenderableMultidoku</span>
|
||||||
|
<span class="extends-implements">extends <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></span></div>
|
||||||
|
</section>
|
||||||
|
<section class="summary">
|
||||||
|
<ul class="summary-list">
|
||||||
|
<!-- ========== METHOD SUMMARY =========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-summary" id="method-summary">
|
||||||
|
<h2>Method Summary</h2>
|
||||||
|
<div id="method-summary-table">
|
||||||
|
<div class="table-tabs" role="tablist" aria-orientation="horizontal"><button id="method-summary-table-tab0" role="tab" aria-selected="true" aria-controls="method-summary-table.tabpanel" tabindex="0" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table', 3)" class="active-table-tab">All Methods</button><button id="method-summary-table-tab1" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab1', 3)" class="table-tab">Static Methods</button><button id="method-summary-table-tab2" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab2', 3)" class="table-tab">Instance Methods</button><button id="method-summary-table-tab4" role="tab" aria-selected="false" aria-controls="method-summary-table.tabpanel" tabindex="-1" onkeydown="switchTab(event)" onclick="show('method-summary-table', 'method-summary-table-tab4', 3)" class="table-tab">Concrete Methods</button></div>
|
||||||
|
<div id="method-summary-table.tabpanel" role="tabpanel">
|
||||||
|
<div class="summary-table three-column-summary" aria-labelledby="method-summary-table-tab0">
|
||||||
|
<div class="table-header col-first">Modifier and Type</div>
|
||||||
|
<div class="table-header col-second">Method</div>
|
||||||
|
<div class="table-header col-last">Description</div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code>static <a href="RenderableMultidoku.html" title="class in gui">RenderableMultidoku</a></code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"><code><a href="#fromMultidoku(sudoku.structure.MultiDoku)" class="member-name-link">fromMultidoku</a><wbr>(<a href="../sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a> doku)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab1 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><wbr><<a href="../sudoku/structure/Block.html" title="class in sudoku.structure">Block</a>></code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getBlocks()" class="member-name-link">getBlocks</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../sudoku/structure/Cell.html" title="class in sudoku.structure">Cell</a></code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCell(int)" class="member-name-link">getCell</a><wbr>(int index)</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../sudoku/structure/Cell.html" title="class in sudoku.structure">Cell</a></code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getCell(int,int)" class="member-name-link">getCell</a><wbr>(int x,
|
||||||
|
int y)</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="../sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a></code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getDoku()" class="member-name-link">getDoku</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
||||||
|
<div class="col-second odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getHeight()" class="member-name-link">getHeight</a>()</code></div>
|
||||||
|
<div class="col-last odd-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
<div class="col-first even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code>int</code></div>
|
||||||
|
<div class="col-second even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"><code><a href="#getWidth()" class="member-name-link">getWidth</a>()</code></div>
|
||||||
|
<div class="col-last even-row-color method-summary-table method-summary-table-tab2 method-summary-table-tab4"> </div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
<div class="inherited-list">
|
||||||
|
<h3 id="methods-inherited-from-class-java.lang.Object">Methods inherited from class java.lang.<a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html" title="class or interface in java.lang" class="external-link">Object</a></h3>
|
||||||
|
<code><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#clone()" title="class or interface in java.lang" class="external-link">clone</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#equals(java.lang.Object)" title="class or interface in java.lang" class="external-link">equals</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#finalize()" title="class or interface in java.lang" class="external-link">finalize</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#getClass()" title="class or interface in java.lang" class="external-link">getClass</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#hashCode()" title="class or interface in java.lang" class="external-link">hashCode</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notify()" title="class or interface in java.lang" class="external-link">notify</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#notifyAll()" title="class or interface in java.lang" class="external-link">notifyAll</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#toString()" title="class or interface in java.lang" class="external-link">toString</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait()" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long)" title="class or interface in java.lang" class="external-link">wait</a>, <a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/lang/Object.html#wait(long,int)" title="class or interface in java.lang" class="external-link">wait</a></code></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<section class="details">
|
||||||
|
<ul class="details-list">
|
||||||
|
<!-- ============ METHOD DETAIL ========== -->
|
||||||
|
<li>
|
||||||
|
<section class="method-details" id="method-detail">
|
||||||
|
<h2>Method Details</h2>
|
||||||
|
<ul class="member-list">
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getWidth()">
|
||||||
|
<h3>getWidth</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getWidth</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getHeight()">
|
||||||
|
<h3>getHeight</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type">int</span> <span class="element-name">getHeight</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getBlocks()">
|
||||||
|
<h3>getBlocks</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="https://docs.oracle.com/en/java/javase/21/docs/api/java.base/java/util/List.html" title="class or interface in java.util" class="external-link">List</a><<a href="../sudoku/structure/Block.html" title="class in sudoku.structure">Block</a>></span> <span class="element-name">getBlocks</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getCell(int,int)">
|
||||||
|
<h3>getCell</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../sudoku/structure/Cell.html" title="class in sudoku.structure">Cell</a></span> <span class="element-name">getCell</span><wbr><span class="parameters">(int x,
|
||||||
|
int y)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getCell(int)">
|
||||||
|
<h3>getCell</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../sudoku/structure/Cell.html" title="class in sudoku.structure">Cell</a></span> <span class="element-name">getCell</span><wbr><span class="parameters">(int index)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="fromMultidoku(sudoku.structure.MultiDoku)">
|
||||||
|
<h3>fromMultidoku</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public static</span> <span class="return-type"><a href="RenderableMultidoku.html" title="class in gui">RenderableMultidoku</a></span> <span class="element-name">fromMultidoku</span><wbr><span class="parameters">(<a href="../sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a> doku)</span></div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
<li>
|
||||||
|
<section class="detail" id="getDoku()">
|
||||||
|
<h3>getDoku</h3>
|
||||||
|
<div class="member-signature"><span class="modifiers">public</span> <span class="return-type"><a href="../sudoku/structure/MultiDoku.html" title="class in sudoku.structure">MultiDoku</a></span> <span class="element-name">getDoku</span>()</div>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
</li>
|
||||||
|
</ul>
|
||||||
|
</section>
|
||||||
|
<!-- ========= END OF CLASS DATA ========= -->
|
||||||
|
</main>
|
||||||
|
</div>
|
||||||
|
</div>
|
||||||
|
</body>
|
||||||
|
</html>
|
||||||
Some files were not shown because too many files have changed in this diff Show More
Reference in New Issue
Block a user