 
 
   mouseUpHandler: (evt) =>
-    return if game.state.is StateManager.GameOver
+    return if game.state is States.GameOver
     if @countFlags() is @countMines()
       for [x, y] in game.neighborCoord @x, @y
         game.board.cases[game.positionFromCoord(x, y)].showTile()



  initGame: (x, y) ->
    @state.set StateManager.Playing
    @generateBoard x, y




class @Game
  constructor: (id) ->
    @state = States.Empty
    @entities = Empty: 0, Mine: 1, Flag: 2
    @nbMines = 50
    @flags = 0
