Skip to content

speedyjeff/checkersui

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

23 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Winforms and Maui shell for a simple Checkers UI

main

Visuals

Update the images under Media

CheckersUiMaui

Maui application.

CheckersUiWf

Winows Form Contol Library.

External interface in Boundary.cs Sub class CallBack to override events and support functions.

Playable squares are numbered 1 to 32. Previous moves table accessed by move number and color (MoveId).

Board

Initialization

Board = new Board(800 /* height */, 800 /* width */);

Call back on mouse click on a playable sqaure

public virtual void MouseClick(int square)
{
    Trace("MouseClick Square " + square.ToString());
}

Set the various states of the board

public enum CellState { Inative, Empty, White, Black, WhiteKing, BlackKing};
public enum HighLight { Selected, Target, None };
int selected = 15;
int take = 18;
int target = 22;
SetSquareHighLight(selected, HighLight.Selected);
SetSquareHighLight(target, HighLight.Target);
SetSquare(take, CellState.White, HighLight.None);

Add a swoop indicator on a move over a piece

int fromSquare = 15;
int toSquare = 22;
var index = AddSwoop(new Swoop(fromSquare, toSquare));

Previous Moves

Initialization

Moves = new Moves(800 /* height */, 200 /* width */);

Call back for a selecting a move, by mouse or arrow keys

public virtual void MoveSelect(MoveId moveId)
{
    Trace(String.Format("MoveSelect move={0} column={1}",
          moveId.move, moveId.color ));
}

Add a row

Moves.AddMoveRow("11-15", "22-18");

Get the number of moves (row count)

int count = GetMoveCount();

Update a move

SetMoveText(new MoveId(2, BlackColumn, "(15x22)");

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages