| 267 | } |
| 268 | |
| 269 | int main(int argc, char** argv){ |
| 270 | window = new Lemon::GUI::Window("Minesweeper", {160, 160}, 0, Lemon::GUI::GUI); |
| 271 | window->rootContainer.background = {0, 0, 0, 0}; |
| 272 | |
| 273 | window->CreateMenuBar(); |
| 274 | window->menuBar->items.push_back(gameMenu); |
| 275 | |
| 276 | Lemon::Graphics::LoadImage("/initrd/minesweeper.png", &resources); |
| 277 | |
| 278 | UpdateWindowSize(); |
| 279 | |
| 280 | window->AddWidget(&game); |
| 281 | window->Paint(); |
| 282 | |
| 283 | while(!window->closed){ |
| 284 | Lemon::LemonEvent ev; |
| 285 | while (window->PollEvent(ev)) |
| 286 | { |
| 287 | switch(ev.event){ |
| 288 | case Lemon::EventWindowCommand: |
| 289 | switch(ev.windowCmd){ |
| 290 | case MenuEasy: |
| 291 | game.Generate(EasyDifficulty); |
| 292 | break; |
| 293 | case MenuMedium: |
| 294 | game.Generate(MediumDifficulty); |
| 295 | break; |
| 296 | case MenuHard: |
| 297 | game.Generate(HardDifficulty); |
| 298 | break; |
| 299 | } |
| 300 | UpdateWindowSize(); |
| 301 | break; |
| 302 | default: |
| 303 | window->GUIHandleEvent(ev); |
| 304 | break; |
| 305 | } |
| 306 | } |
| 307 | |
| 308 | window->Paint(); |
| 309 | |
| 310 | window->WaitEvent(); |
| 311 | } |
| 312 | |
| 313 | delete window; |
| 314 | |
| 315 | return 0; |
| 316 | } |
nothing calls this directly
no test coverage detected