Skip to content

Commit

Permalink
Improve documentation in some README and in the manual pages
Browse files Browse the repository at this point in the history
  • Loading branch information
nicolarevelant committed Nov 11, 2023
1 parent 1c78e68 commit 4b238bb
Show file tree
Hide file tree
Showing 5 changed files with 48 additions and 37 deletions.
10 changes: 3 additions & 7 deletions TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,9 @@

## Under development

- Porting for Microsoft Windows and Apple macOS
- Port for Microsoft Windows
- Port for Apple macOS

## Ideas

- empty

## Done

- Randomize PC's moves with same score
- Fix missing icon in about dialog (the window icon is platform dependent)
- Migrate to Gtk4 (and maybe Libadwaita)
4 changes: 0 additions & 4 deletions colors/default
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,3 @@ bg=#83582d
fg=#ffffff
light=#cc9c59
dark=#6e4b1b

focus-border=#fff
hover-border=#787878
possible-move-border=#adaf7c
42 changes: 29 additions & 13 deletions doc/italian-draughts.5.scd
Original file line number Diff line number Diff line change
Expand Up @@ -8,25 +8,41 @@ italian-draughts reads the application data from the following path:

- /usr/share/italian-draughts/

## IMAGES
# THEMES

In the images subdirectory this program reads the following images:
For each resource type this program first reads from the 'default' file
located inside the directory of the resource type.

- pcDame.png: PC dame/king
- pcPawn.png: PC pawn/man
- plDame.png: Player dame/king
- plPawn.png: Player pawn/man
Then, if the user specified a theme, from the file whose name corresponds
to the theme name. New values can be added or overwrite the default ones.

Note: all images must be the same size
Every line of a resource file must be a <key>=<value> pair without whitespaces.
Empty lines or those starting with *#* are ignored.

## THEMES
## colors

In the themes subdirectory this program first reads from the 'default' file
and then, if the user specified a theme, from the file whose name corresponds
to the theme name. New values can be added or overwrite the default ones.
Used colors are:

Every line of a resource file must be a <key>=<value> pair without whitespaces.
Empty lines or those starting with # are ignored.
- border: Chessboard border
- bg: Backgroud
- fg: Foregroud (text color)
- light: Light grid cels
- dark: Dark grid cels

## images

Images are considered a resource type but every theme is a directory instead of a regular file.
So for each theme directory there must be an index where every line is the image key
that is a image filename without extension.
Every image file is called _key.png_ and there must be the following image keys
at least in the default theme:

- pcDame: PC dame/king
- pcPawn: PC pawn/man
- plDame: Player dame/king
- plPawn: Player pawn/man

Note: all images must be the same size

# SEE ALSO
*italian-draughts*(1)
Expand Down
14 changes: 5 additions & 9 deletions src/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ for creating this program. The structure is described below.
Note:

- X : Y means X is subclass of Y
- X::Y means Y, that is declares inside X
- X::Y means Y, that is declared inside X

## Frame : wxFrame

Expand All @@ -18,14 +18,15 @@ A 8x8 grid panel that represents a chessboard.

## MatchManager

This class handle 1 or more matches using a specific ChessboardGrid
This class handle matches interacting with a ChessboardGrid

## GameUtils

This class provides a static method to find all possible moves from a specific
pieces' disposition.
pieces' disposition and a static method to calculate the best move the PC
can make (Minimax algorithm)

### gameUtils::AlgorithmThread : wxThread
### GameUtils::AlgorithmThread : wxThread

This class provides a simple way to calculate the best move for PC using a
separate thread that calls the 'calculateBestMove' static method of GameAlgorithm
Expand All @@ -38,11 +39,6 @@ It represents a move that can be done by the player or PC.

A class that represents a square in the chessboard.

## GameAlgorithm

This class allows the computer to play against a player providing a static method
to calculate the best move for PC.

## Resources

A class the provides the ability to fetch colors from a particular theme.
15 changes: 11 additions & 4 deletions src/Resources/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,13 +18,20 @@ Please refer to [wxWidgets wiki](https://docs.wxwidgets.org/3.2.1/overview_i18n.

This program can be started with a specific theme, or it will use the default one.

Assuming the chosen theme is **theme** this program reads from the following path
in a simple format as described below. If the file does not exist, it is unreadable or
colors are not available, they fall back to the default ones.
Assuming the chosen theme is **theme**, for each resource type this program reads from
the following path in a simple format as described below.

- /etc/italian-draughts/themes/**theme**
For each entry if the file does not exist, it is unreadable or the entry is not available,
it fall back to the default one.

- /etc/italian-draughts/**resource_type**/**theme**

### File format

Each line can start with a "#" to indicate a comment or be a key=value pair divided by a "=" without
whitespaces of any type.

### Resource types

- colors: UI colors
- images: Bitmaps in PNG format (keys does not include extension)

0 comments on commit 4b238bb

Please sign in to comment.