Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KoduActionSay.h

Go to the documentation of this file.
00001 #ifndef KODU_ACTION_SAY_H_
00002 #define KODU_ACTION_SAY_H_
00003 
00004 // C++ Library
00005 #include <iostream>
00006 #include <string>
00007 
00008 // Kodu Library
00009 #include "Kodu/Primitives/KoduAction.h"
00010 #include "Kodu/Generators/KoduGenerators.h"
00011 #include "Kodu/General/GeneralMacros.h"
00012 
00013 /**
00014  * NAME:            KODU ACTION SAY
00015  * TYPE:            ACTION
00016  * KODU EQUIVALENT: SAY
00017  * DESCRIPTION:
00018  *      This class is used to submit a string to speak each time this action fires.
00019  * 
00020  * DATA DESCRIPTION:
00021  *      - Speech strings: a vector of strings to speak.
00022  *      - Say request: holds the string that will be spoken when this action fires.
00023  *      - Order:
00024 **/
00025 
00026 namespace Kodu {
00027 
00028     //! Kodu Action Say class (derived from Kodu Speech Action)
00029     class KoduActionSay : public KoduAction {
00030     public:
00031         //! Constructor
00032         KoduActionSay(const std::string& kDesignator, const LiteralGenerator& kStringLiteral, bool useOnce)
00033           : KoduAction("KoduActionSay", KoduAction::AT_SAY, true, useOnce),
00034             designator(kDesignator),
00035             literalGen(kStringLiteral)//,
00036             // onceEnabled(useOnce)
00037         { }
00038 
00039         //! Copy constructor
00040         KoduActionSay(const KoduActionSay& kAction)
00041           : KoduAction(kAction),
00042             designator(kAction.designator),
00043             literalGen(kAction.literalGen)//,
00044             // onceEnabled(kAction.onceEnabled)
00045         { }
00046         
00047         //! Destructor
00048         ~KoduActionSay() {
00049             // no explicit implementation
00050         }
00051         
00052         //! Assignment operator
00053         KoduActionSay& operator=(const KoduActionSay& kAction) {
00054             if (this != &kAction) {
00055                 KoduAction::operator=(kAction);
00056                 designator = kAction.designator;
00057                 literalGen = kAction.literalGen;
00058                 // onceEnabled = kAction.onceEnabled;
00059             }
00060             return *this;
00061         }
00062         
00063         //! Returns a literal string to speak
00064         const std::string& getStringToSpeak();
00065         
00066         //! Tests if the primitive argument is the same as the calling class
00067         static bool isSameTypeAs(const KoduPrimitive*);
00068 
00069         //! Used to reinitialize certain variables (e.g. when switching to another page)
00070         virtual void reinitialize();
00071         
00072         //! Prints the attributes of a particular instance
00073         virtual void printAttrs() const;
00074 
00075     private:
00076         std::string designator;
00077         LiteralGenerator literalGen;
00078         // bool onceEnabled;
00079     };
00080 }
00081 
00082 #endif // KODU_ACTION_SAY_H_

Tekkotsu v5.1CVS
Generated Mon May 9 04:58:43 2016 by Doxygen 1.6.3