I'm writing a program which allows to design the map of a labirith. this will be saved in a file and another program will allow to play this labirith.
I thought to divide the labirith into squares, each of them can assume 4 status: 0 = empty, 1 = entry, 2 = exit, 3 = wall. In this way I can gain all informations about it (where is the entry, the exit, where are the walls, etc...).
The user chooses the tool to use (set an entry, set an exit, set a wall, remove something) by using a toolbar with, of course, four buttons.
To gain the map of the labirith from the user I show a button matrix and every button is a square of the logical map, so every button can be "set" to a status. The status cannot be stored in the buttons (obvious).
So the problem is that on the click() event of the i-j button the program should:
1) change the background image of the button so that the user can see where (e.g.) the wall is; (I've done it because all I needed was ID string)
2) store the status of the matrix in a matrix of integers in which every item can assume 4 status depending on the tool choosen in the toolbar (THIS is the problem)
Now in che SLOT I need the ID string to identify the button on which I should operate, and at least the tool choosen by the user (an integer variable)! but the SLOT doesn't allow me to introduce the tool parameter...moreover it should be better to distinguish the button matrix from the status matrix (the integer matrix which stores the labirinth status), so I need another argument in the SLOT to set this matrix...
Bookmarks