philsupertramp / chess

stale project
0 stars 0 forks source link

Restructure allowed moves #2

Closed philsupertramp closed 3 years ago

philsupertramp commented 3 years ago

Current approach is by far not suitable and impossible to maintain. We need to change the strucute how we handle allowed moves to enable a few things. We want to be able to enable

Ideas

Lets implement for now a simple debugging tool to display the "move" on selection

  1. If figure is selected, watch mouse cursor and display distance between origin field and current field underneath cursor.
  2. Validate cursor position and highlight text red if move is not allowed
  3. On selection display available moves by highlighting available fields
  4. Profit?

Hope it's not too small slow tho :shrug:

philsupertramp commented 3 years ago

So once again I hit a road block. It becomes more and more complex to define extraordinary moves like Pawn's en passant, or King's castling.

It sounds overambitious but I'm super positive that this abstraction will improve the readability and maintainability of the code base.

philsupertramp commented 3 years ago

Looks good to me, tbh. Closing. Can be reopened if needed!