LEGUP icon indicating copy to clipboard operation
LEGUP copied to clipboard

[ENHANCEMENT] Region Logic

Open Chase-Grajeda opened this issue 1 year ago • 0 comments

LEGUP currently lacks a generalized way to track regions and display them on game boards. This feature aims to start tracking cells as indiviudal regions of cells, which will allow us to implement region-based logic in puzzles such as Ripple Effect, Minesweeper, and Star Battle

GridRegion.java spec: (Members)

  • List / Array of pointers to GridCells
    • The list of GridCells allows us to quickly dereference the current board state and observe the current values of a region. Using pointers allows a memory efficient solution in the case of overlapping cells between regions. Assert this region is updated with each board transition
  • String Name
    • Name of region

XML Serialization Example:

<board>
    <region name='name'>
        <cells>
            <cell value='value1' x='0' y='0'/>
            <cell value='value2' x='1' y='0'/>
        </cells>
    </region>
</board>

Describe the improvement you'd like

  • Create red colored tiles with low opacity for testing
  • Create an abstract region class called GridRegion.java in model/gameboard/
  • Write small child class of GridRegion called RippleEffectRegion in puzzle/rippleeffect/ to implement members
  • Write simple child class of GridCell called RippleEffectCell in puzzle/rippleeffect/
  • Write custom XML serialization of Ripple Effect similar to other puzzles
  • Successfully load demo XML file
  • Successfully save demo XML file
  • Successfully edit demo XML file

Describe alternatives you've considered

No response

Additional Context

No response

Chase-Grajeda avatar Jan 30 '24 22:01 Chase-Grajeda