Effect.cpp 807 B

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859
  1. #include "Effect.h"
  2. Effect::Effect( Spieler *zSpieler, float maxTime )
  3. {
  4. this->zSpieler = zSpieler;
  5. timeLeft = maxTime;
  6. ref = 1;
  7. }
  8. Effect::~Effect()
  9. {}
  10. bool Effect::tick( double time, Spiel *zSpiel )
  11. {
  12. timeLeft -= (float)time;
  13. return timeLeft <= 0;
  14. }
  15. bool Effect::istSpielerBeweglich( Richtung r ) const
  16. {
  17. return 1;
  18. }
  19. bool Effect::istSpielerVerwundbar( Richtung r ) const
  20. {
  21. return 1;
  22. }
  23. bool Effect::istSpielerSichtbar( Team *zTeam ) const
  24. {
  25. return 1;
  26. }
  27. bool Effect::istIntersectable() const
  28. {
  29. return 1;
  30. }
  31. void Effect::move( double time )
  32. {}
  33. bool Effect::istGegenstandErlaubt( GegenstandTyp typ ) const
  34. {
  35. return 1;
  36. }
  37. Effect *Effect::getThis()
  38. {
  39. ref++;
  40. return this;
  41. }
  42. Effect *Effect::release()
  43. {
  44. if( !--ref )
  45. delete this;
  46. return 0;
  47. }