riichinomics / autotable

An online mahjong table
http://autotable.riichi.moe
Other
15 stars 6 forks source link

Tiles moved from pond to meld area auto-rotate #6

Closed NamaikiNaNeko closed 4 years ago

NamaikiNaNeko commented 4 years ago

Current behavior: tiles moved from pond to meld slots are placed in a vertical orientation

Proposed behavior: tiles moved from pond to meld slots are automatically rotated sideways to indicate that they were called. Players will still need to manually position them in the correct slot but the rotation would be handled for them

thoughts on how to implement [couldn't be assed to build and run the server for testing, sorry]: in movement.ts, in apply() under a similar check for moving tiles (lines 91-93) from outside a hand to inside a hand and flipping them up. Proposed new lines shown under the existing check: ` if (slot.group === 'hand' && slot.group !== thing.slot.group) { rotationIndex = 0; }

  if (slot.group === 'meld' && thing.slot.group === 'discard') {
    rotationIndex = [whatever the right rotationIndex is];
  }`

I'm not sure how this would work with the recent changes to force orientation if a tile rotation was changed while holding it. I also wasn't able to figure out what the correct rotationIndex is supposed to be for that to work