TimelineScript.hpp

Go to the documentation of this file.
00001 /*
00002 SagaEngine library
00003 Copyright (c) 2002-2006 Skalden Studio AS
00004 
00005 This software is provided 'as-is', without any express or implied 
00006 warranty. In no event will the authors be held liable for any 
00007 damages arising from the use of this software.
00008 
00009 Permission is granted to distribute the library under the terms of the 
00010 Q Public License version 1.0. Be sure to read and understand the license
00011 before using the library. It should be included here, or you may read it
00012 at http://www.trolltech.com/products/qt/licenses/licensing/qpl
00013 
00014 The original version of this library can be located at:
00015 http://www.sagaengine.com/
00016 
00017 Rune Myrland
00018 rune@skalden.com
00019 */
00020 
00021 
00022 #ifndef TimelineScript_hpp
00023 #define TimelineScript_hpp
00024 
00025 #include "Script.hpp"
00026 #include "sim_script.hpp"
00027 #include "../action/sim_action.hpp"
00028 #include "../thing/sim_thing.hpp"
00029 #include "../../util/type/util_type.hpp"
00030 
00031 namespace se_core {
00032     class _SeCoreExport TimelineScript : public Script {
00033     public:
00034         TimelineScript(const char* name, int trackerPosCount = 40);
00035         virtual ~TimelineScript();
00036         virtual const Action* nextAction(const ScriptComponent& performer, int channel, ScriptData* sd, Parameter& out) const;
00037         void addAction(int trackerPos, const char* name);
00038         void addAction(int trackerPos, const Action* action);
00039         //virtual bool isAlwaysActive() { return false; }
00040         void addAction(int trackerPos, const Action* action, int parameter) {
00041             addAction(trackerPos, action);
00042             setParameter(trackerPos, parameter);
00043         }
00044         void addAction(int trackerPos, const char* name, int parameter) {
00045             addAction(trackerPos, name);
00046             setParameter(trackerPos, parameter);
00047         }
00048         void addAction(int trackerPos, const char* name, String* attribute) {
00049             addAction(trackerPos, name);
00050             setAttribute(trackerPos, attribute);
00051         }
00052         void addAction(int trackerPos, const Action* action, String* attribute) {
00053             addAction(trackerPos, action);
00054             setAttribute(trackerPos, attribute);
00055         }
00056         void addAction(int trackerPos, const Action* action, String* attribute, int parameter) {
00057             addAction(trackerPos, action);
00058             setAttribute(trackerPos, attribute);
00059             setParameter(trackerPos, parameter);
00060         }
00061         void addAction(int trackerPos, const char* name, String* attribute, int parameter) {
00062             addAction(trackerPos, name);
00063             setAttribute(trackerPos, attribute);
00064             setParameter(trackerPos, parameter);
00065         }
00066 
00067         //virtual void activate(ScriptComponent& performer) const {}
00068         void setZeroMode(bool state) { isInZeroMode_ = state; }
00069 
00070     private:
00071         void setParameter(int trackerPos, int value) { scriptSingleValueParameters_[ trackerPos ] = value; }
00072         void setAttribute(int trackerPos, String* value) { scriptAttributeParameters_[ trackerPos ] = value; }
00073 
00074         short trackerPosCount_;
00075         const Action** actions_;
00076         int* scriptSingleValueParameters_;
00077         String** scriptAttributeParameters_;
00078         bool isInZeroMode_;
00079     };
00080 
00081 }
00082 
00083 #endif

Home Page | SagaEngine trunk (updated nightly) reference generated Sun Dec 2 20:06:12 2007 by Doxygen version 1.3.9.1.

SourceForge.net Logo