Load all current GlyphCoordinate objects from the database and render.
(session, window, state)
| 458 | |
| 459 | |
| 460 | def draw(session, window, state): |
| 461 | """Load all current GlyphCoordinate objects from the |
| 462 | database and render. |
| 463 | |
| 464 | """ |
| 465 | for gcoord in session.query(GlyphCoordinate).options( |
| 466 | joinedload(GlyphCoordinate.glyph) |
| 467 | ): |
| 468 | gcoord.render(window, state) |
| 469 | window.addstr(1, WINDOW_WIDTH - 5, "Score: %.4d" % state["score"]) |
| 470 | window.move(0, 0) |
| 471 | window.refresh() |
| 472 | |
| 473 | |
| 474 | def check_win(session, state): |