Fixed dangerous jewel-type collection outside of statement for checking whether jewel actually exists
Made large function-call-within-if-statement a little more readable by writing over two lines
Refactored vertical group finding logic to be more like horizontal flag-based logic
Solved bug with vertical groups false-negative issue by fixing equality operator in column entry loop
Tweaked horizontal group finding logic formatting to be tidier
Added safeguard against setting NULL as a socket's current jewel if the above socket had no jewel to steal
Gave setJewel a return type to indicate whether jewel* passed was rejected due to being NULL
After scoring valid color groups, vector is cleared to ensure color groups do not accidentally persist and get re-counted
Re-organised event handling so that events set flags to inform behaviour, rather than enacting behaviour within the event loop. This means that a 'simultaneous' sequence of a event polls will all be handled together to choose next course of behaviour. This was done to abstract event handling from behaviours. Whether this is a poor choice, and one behaviour should only ever be performed per-event remains to be seen. However completely separate behaviours seem like they shouldn't be forced to exist in separate draw calls (a slow down) for the sake of atomic event reactions.
Moved handling of upClicks on grid (and subsequent jewel switching calls etc) into separate function to improve readability of main()
Draw grid now receives gameGrid by const reference
Pause message improved, informing user how to un-pause
Renamed socket's jewel destination setting function to better reflect the transient nature of jewels
Jewels given progress (0 to 1) describing how far from their bound (starting location) and dest (goal location) they are.
Jewels have a speed: amount they can increase progress by per one unit of deltaTime elapsed, facilitating partial progress i.e. animation
Moving jewel to destination now increases progress rather than setting jewelBound directly
Drawing of jewels now performed by interpolating between bound and destination for distance of progress
Duty to moveJewelToDestination taken away from socketsAreFull and now only occurs in jewelsAreStatic when jewels are found not to be inTransit
Main game loop now calculates delta time on each iteration, to which can be passed to functions that update jewel locations
performSocketSelection function returns false if a move turned out to be illegal, used to indicate that switching back is necessary. Switching back no longer happens immediately in order to allow switching animation to first be played.
Clearing of selected sockets after now happens after a successful move, or after the switchback following an unsuccessful move, as switchbacks require that information to stick around
Status: Horizontal switching works and animates.
Bug 1: Vertical switching works, but jewels are never in transit.
Bug 2: Collapsing of grid doesn't seem to work, perhaps due to faulty destination setting
Fixed formatting
Uncommented scramble routine for re-attempting erroneous grids before rejection
Laid out attemptJewelExchange in a less efficient but more readable manner that is easier to debug
Simplified some return value logic in attemptJewelExchange