Effect.cpp 910 B

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  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. void Effect::renderSpieler( Bild &rObj )
  38. {}
  39. Resource *Effect::getCurrentResource()
  40. {
  41. return 0;
  42. }
  43. Effect *Effect::getThis()
  44. {
  45. ref++;
  46. return this;
  47. }
  48. Effect *Effect::release()
  49. {
  50. if( !--ref )
  51. delete this;
  52. return 0;
  53. }