Tekkotsu Homepage
Demos
Overview
Downloads
Dev. Resources
Reference
Credits

KoduActionPlay.h

Go to the documentation of this file.
00001 #ifndef KODU_ACTION_PLAY_H_
00002 #define KODU_ACTION_PLAY_H_
00003 
00004 // C++ Library
00005 #include <iostream>
00006 #include <string>
00007 
00008 // Kodu Library
00009 #include "Kodu/Primitives/KoduAction.h"
00010 #include "Kodu/General/GeneralMacros.h"
00011 #include "Kodu/Generators/KoduGenerators.h"
00012 
00013 // TODO
00014 // (25/01/13) find other modifiers for play action
00015 
00016 namespace Kodu {
00017 
00018     //! Kodu Action Play class (derived from Kodu Action)
00019     class KoduActionPlay : public KoduAction {
00020     public:
00021         //! Constructor
00022         KoduActionPlay(const LiteralGenerator& kSoundFile, bool useOnce)
00023           : KoduAction ("KoduActionPlay", KoduAction::AT_PLAY, true, useOnce),
00024             soundFile(kSoundFile)//,
00025             // onceModifierEnabled(useOnce)
00026         { }
00027         
00028         //! Copy constructor
00029         KoduActionPlay(const KoduActionPlay& kAction)
00030           : KoduAction(kAction),
00031             soundFile(kAction.soundFile)//,
00032             // onceModifierEnabled(kAction.onceModifierEnabled)
00033         { }
00034 
00035         //! Destructor
00036         ~KoduActionPlay() {
00037             // no explicit implementation
00038         }
00039         
00040         //! Assignment operator
00041         KoduActionPlay& operator=(const KoduActionPlay& kAction) {
00042             if (this != &kAction) {
00043                 KoduAction::operator=(kAction);
00044                 soundFile = kAction.soundFile;
00045                 // onceModifierEnabled = kAction.onceModifierEnabled;
00046             }
00047             return *this;
00048         }
00049 
00050         //! Returns the name of the sound file
00051         const std::string& getSoundFile();
00052         
00053         //! Tests if the primitive argument is the same as the calling class
00054         static bool isSameTypeAs(const KoduPrimitive*);
00055 
00056         //! Used to reinitialize certain variables (e.g. when switching to another page)
00057         virtual void reinitialize();
00058 
00059         //! Prints the attributes of a particular instance
00060         virtual void printAttrs() const;
00061 
00062     private:
00063         LiteralGenerator soundFile;     //!< Returns the name of the sound file the agent needs to play
00064         // bool onceModifierEnabled;       //!< States if to play a sound file once
00065     };
00066 }
00067 
00068 #endif // KODU_ACTION_PLAY_H_

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