Variablen.h 1.2 KB

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