Controler.cpp 899 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647
  1. #include "Controler.h"
  2. Controler::Controler()
  3. :m_mvt(0.0f, 0.0f), m_visee(0.0f, 0.0f), m_craft(false), m_tir(), m_search(), m_prevSearch()
  4. {
  5. m_tir[ L_HAND ] = m_tir[ R_HAND ] = false;
  6. m_search[ L_HAND ] = m_search[ R_HAND ] = false;
  7. m_prevSearch[ L_HAND ] = m_prevSearch[ R_HAND ] = false;
  8. }
  9. Controler::~Controler()
  10. {
  11. //dtor
  12. }
  13. Vec Controler::getMvt() const
  14. {
  15. return m_mvt;
  16. }
  17. Vec Controler::getVisee() const
  18. {
  19. return m_visee;
  20. }
  21. bool Controler::getCraft()
  22. {
  23. if ( m_craft != m_prevCraft ) {
  24. m_prevCraft = m_craft;
  25. return m_craft;
  26. }
  27. else return false;
  28. }
  29. bool Controler::getTir( unsigned short main ) const
  30. {
  31. return m_tir[ main ];
  32. }
  33. bool Controler::getSearch( unsigned short main )
  34. {
  35. if ( m_search[main] != m_prevSearch[main] ) {
  36. m_prevSearch[main] = m_search[main];
  37. return m_search[main];
  38. }
  39. else return false;
  40. }