Simulation Core
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 

83 lines
2.1 KiB

  1. module CMouseHoleEnumVariables
  2. use CVoidEventHandlerCollection
  3. implicit none
  4. integer :: MouseHole = 0
  5. integer :: MouseHole_S = 0
  6. public
  7. type(VoidEventHandlerCollection) :: OnMouseHoleChange
  8. enum, bind(c)
  9. enumerator MOUSE_HOLE_NEUTRAL
  10. enumerator MOUSE_HOLE_FILL
  11. enumerator MOUSE_HOLE_EMPTY
  12. end enum
  13. private :: MouseHole
  14. contains
  15. subroutine Set_MouseHole(v)
  16. implicit none
  17. integer , intent(in) :: v
  18. #ifdef ExcludeExtraChanges
  19. if(MouseHole == v) return
  20. #endif
  21. !call sleep(2)
  22. MouseHole = v
  23. #ifdef deb
  24. print*, 'MouseHole=', MouseHole
  25. #endif
  26. call OnMouseHoleChange%RunAll()
  27. end subroutine
  28. integer function Get_MouseHole()
  29. implicit none
  30. Get_MouseHole = MouseHole
  31. end function
  32. subroutine Update_MouseHole_From_Snapshot()
  33. implicit none
  34. call Set_MouseHole(MouseHole_S)
  35. end subroutine
  36. subroutine Set_MouseHole_WN(v)
  37. !DEC$ ATTRIBUTES DLLEXPORT :: Set_MouseHole_WN
  38. !DEC$ ATTRIBUTES ALIAS: 'Set_MouseHole_WN' :: Set_MouseHole_WN
  39. implicit none
  40. integer , intent(in) :: v
  41. !call Set_MouseHole(v)
  42. MouseHole_S = v
  43. end subroutine
  44. integer function Get_MouseHole_WN()
  45. !DEC$ ATTRIBUTES DLLEXPORT :: Get_MouseHole_WN
  46. !DEC$ ATTRIBUTES ALIAS: 'Get_MouseHole_WN' :: Get_MouseHole_WN
  47. implicit none
  48. Get_MouseHole_WN = MouseHole
  49. end function
  50. logical function Get_EmptyMouseHole()
  51. !DEC$ ATTRIBUTES DLLEXPORT :: Get_EmptyMouseHole
  52. !DEC$ ATTRIBUTES ALIAS: 'Get_EmptyMouseHole' :: Get_EmptyMouseHole
  53. implicit none
  54. Get_EmptyMouseHole = .false. ! MouseHole == EMPTY_MOUSE_HOLE
  55. end function
  56. logical function Get_FillMouseHole()
  57. !DEC$ ATTRIBUTES DLLEXPORT :: Get_FillMouseHole
  58. !DEC$ ATTRIBUTES ALIAS: 'Get_FillMouseHole' :: Get_FillMouseHole
  59. implicit none
  60. Get_FillMouseHole = .false. ! MouseHole == FILL_MOUSE_HOLE
  61. end function
  62. end module CMouseHoleEnumVariables