Variablen.h 1.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. #pragma once
  2. #include <Text.h>
  3. using namespace Framework;
  4. enum VariableTyp
  5. {
  6. NICHTS,
  7. INTEGER,
  8. BOOLEAN,
  9. STRING,
  10. RICHTUNG,
  11. FLOAT,
  12. TASTE,
  13. SPIELER,
  14. TIMER,
  15. TEAM,
  16. BARIERE,
  17. SCHALTER,
  18. BASE,
  19. DROP,
  20. GEGENSTAND,
  21. GEGENSTAND_TYP,
  22. GESCHOSS,
  23. GESCHOSS_TYP,
  24. SCHIENE,
  25. TUNNEL,
  26. UMLENKUNG,
  27. TRIGGER,
  28. FEUERBALL_TREFFER,
  29. AKTION
  30. };
  31. class Variable
  32. {
  33. private:
  34. VariableTyp typ;
  35. int ref;
  36. public:
  37. Variable( VariableTyp typ );
  38. virtual ~Variable();
  39. VariableTyp getVariableTyp() const;
  40. Variable *getThis();
  41. Variable *release();
  42. };
  43. bool isTrue( Variable *v );
  44. class Integer : public Variable
  45. {
  46. private:
  47. int value;
  48. public:
  49. Integer( int value, bool taste = 0 );
  50. void setValue( int value );
  51. int getValue() const;
  52. };
  53. class Boolean : public Variable
  54. {
  55. private:
  56. bool value;
  57. public:
  58. Boolean( bool value );
  59. void setValue( bool value );
  60. bool getValue() const;
  61. };
  62. class String : public Variable
  63. {
  64. private:
  65. Text value;
  66. public:
  67. String( const char *value, bool richtung = 0, bool geschossTyp = 0 );
  68. void setValue( Text value );
  69. const Text &getValue() const;
  70. };
  71. class Float : public Variable
  72. {
  73. private:
  74. float value;
  75. public:
  76. Float( float value );
  77. void setValue( float value );
  78. float getValue() const;
  79. };