     @board = Snap(@id)
     @board.mouseup @mouseUpHandler
 
-    @nbHorizontalCases = 19
-    @nbVerticalCases = 13
+    @nbHorizontalTiles = 19
+    @nbVerticalTiles = 13
     @cases = []
 
 



  createBoard: () ->
    nbCases = @nbHorizontalCases * @nbVerticalCases
    for i in [0...nbCases]
      y = Math.floor(i / @nbHorizontalCases)
      x = i - y * @nbHorizontalCases
      tmp = new Case @board, x, y
      @cases[i] = tmp

    @flagsLbl = @board.text 0, 0, 'Flags'
    @flagsLbl.transform 'translate(0, 580)'


class Flag extends Case
  constructor: () ->
    super
    @g.append Flag.render @ctx, @size

      game.board.cases[casePosition].g.remove()
      if game.board.cases[casePosition].constructor is Flag
        game.board.flagsLbl.attr text: --game.flags
        game.board.cases[casePosition] = new Tile @ctx, @x, @y
      else
        game.board.flagsLbl.attr text: ++game.flags
        game.board.cases[casePosition] = new Flag @ctx, @x, @y
    else
      @showTile()


  showTile: () ->
    casePosition = game.positionFromCoord @x, @y

    if game.board.cases[casePosition].constructor isnt Tile
      return

    if game.data[casePosition] is game.entities.Mine
