Variablen.h 1.2 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889
  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. SCHIENE,
  24. TUNNEL,
  25. UMLENKUNG,
  26. TRIGGER,
  27. FEUERBALL_TREFFER
  28. };
  29. class Variable
  30. {
  31. private:
  32. VariableTyp typ;
  33. int ref;
  34. public:
  35. Variable( VariableTyp typ );
  36. virtual ~Variable();
  37. VariableTyp getVariableTyp() const;
  38. Variable *getThis();
  39. Variable *release();
  40. };
  41. class Integer : public Variable
  42. {
  43. private:
  44. int value;
  45. public:
  46. Integer( int value, bool taste = 0 );
  47. void setValue( int value );
  48. int getValue() const;
  49. };
  50. class Boolean : public Variable
  51. {
  52. private:
  53. bool value;
  54. public:
  55. Boolean( bool value );
  56. void setValue( bool value );
  57. bool getValue() const;
  58. };
  59. class String : public Variable
  60. {
  61. private:
  62. Text value;
  63. public:
  64. String( const char *value, bool richtung = 0 );
  65. void setValue( Text value );
  66. const Text &getValue() const;
  67. };
  68. class Float : public Variable
  69. {
  70. private:
  71. float value;
  72. public:
  73. Float( float value );
  74. void setValue( float value );
  75. float getValue() const;
  76. };