Lazarus. Combine multiple components (TCheckBox) as one object

63 Views Asked by At

Good day. I am creating a turn-based strategy. It is necessary to implement a similar system of blocks / attacks on cells as in the game "Battleship", only I have 5 cells. I don’t understand how to make these 5 cells as one object, so that it would be convenient to match the Checked properties (hit / didn’t hit)

My mind was enough to create a bunch of separate objects that call the procedure for checking the limit of hits and blocks. Everything would be fine, but this is a scene on which a battle of two heroes with a set of characteristics and abilities is initiated, and this is already 5 cells of blocks and attacks from each hero, in total 20, plus, under certain conditions, attack cells can double. So the code becomes unreadable. Even as a beginner I understand this, but I do not have enough knowledge. I ask you to suggest in which direction to think and what to read in order to better navigate the topic.

0

There are 0 best solutions below