KoduActionScore.h
Go to the documentation of this file.00001 #ifndef KODU_ACTION_SCORE_H_
00002 #define KODU_ACTION_SCORE_H_
00003
00004
00005 #include <iostream>
00006
00007
00008 #include "Kodu/General/GeneralMacros.h"
00009 #include "Kodu/Generators/KoduGenerators.h"
00010
00011 #include "Kodu/Primitives/KoduAction.h"
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021 namespace Kodu {
00022
00023
00024 class ScoreChange;
00025
00026
00027 class KoduActionScore : public KoduAction {
00028 public:
00029 enum ScoringType_t {
00030 ST_SCORE = 0,
00031 ST_SET_SCORE,
00032 ST_SUBTRACT
00033 };
00034
00035
00036 KoduActionScore(ScoringType_t scoreOpType, const NumericGenerator& kNumericGen,
00037 const std::string& kDesignator, bool useOnce)
00038 : KoduAction("KoduActionScore", KoduAction::AT_SCORING, true, useOnce),
00039 type(scoreOpType),
00040 numericGen(kNumericGen),
00041 designator(kDesignator)
00042 { }
00043
00044
00045 KoduActionScore(const KoduActionScore& kAction)
00046 : KoduAction(kAction),
00047 type(kAction.type),
00048 numericGen(kAction.numericGen),
00049 designator(kAction.designator)
00050
00051 { }
00052
00053
00054 ~KoduActionScore() {
00055
00056 }
00057
00058
00059 KoduActionScore& operator=(const KoduActionScore& kAction) {
00060 if (this == &kAction) {
00061 KoduAction::operator=(kAction);
00062 type = kAction.type;
00063 numericGen = kAction.numericGen;
00064 designator = kAction.designator;
00065
00066 }
00067 return *this;
00068 }
00069
00070
00071 ScoreChange getScoreChange();
00072
00073
00074 static bool isSameTypeAs(const KoduPrimitive*);
00075
00076
00077 virtual void reinitialize();
00078
00079
00080 virtual void printAttrs() const;
00081
00082 private:
00083 ScoringType_t type;
00084 NumericGenerator numericGen;
00085 std::string designator;
00086 };
00087 }
00088
00089 #endif // KODU_ACTION_SCORE_H_