UGDK
|
00001 00002 #ifndef UGDK_UTIL_ANIMATIONPROTOCOL_H_ 00003 #define UGDK_UTIL_ANIMATIONPROTOCOL_H_ 00004 00005 #include <map> 00006 #include <utility> 00007 #include <ugdk/action/animationset.h> 00008 #include <ugdk/util/gdd/descriptionprotocol.h> 00009 #include <ugdk/graphic/modifier.h> 00010 00011 namespace ugdk { 00012 00013 class AnimationProtocol : public gdd::DescriptionProtocol<action::AnimationSet> { 00014 public: 00015 enum ParsingScope { 00016 ANIMATION_DATA, 00017 FRAME_RING, 00018 EFFECT_RING 00019 }; 00020 00021 AnimationProtocol(); 00022 virtual ~AnimationProtocol() { if(current_effect_) delete current_effect_; } 00023 00024 bool NewDescription(); 00025 bool NewData(const gdd::GDDString& data_name); 00026 bool NewProperty(const gdd::GDDString& property_name, const gdd::GDDArgs& property_args); 00027 bool NewRing(const gdd::GDDString& ring_typename); 00028 bool NewEntry(const gdd::GDDString& entry_name, const gdd::GDDArgs& entry_args); 00029 bool NewSimpleChain(const gdd::GDDString& ring_typename, const gdd::GDDArgs& ring_args); 00030 00031 private: 00032 action::Animation *current_animation_; 00033 graphic::Modifier* current_effect_; 00034 ParsingScope current_scope_; 00035 bool composing_; 00036 00037 typedef bool (AnimationProtocol::*EntryFunction) (const gdd::GDDArgs&); 00038 00039 00040 std::map< std::pair<ParsingScope, gdd::GDDString>, EntryFunction > entry_functions_; 00041 00042 bool NewEntry_EffectNumber( const gdd::GDDArgs& ); //TODO: implement this function. 00043 bool NewEntry_EffectAlpha( const gdd::GDDArgs& ); 00044 bool NewEntry_EffectColor( const gdd::GDDArgs& ); 00045 bool NewEntry_EffectPosition( const gdd::GDDArgs& ); 00046 bool NewEntry_EffectMirror( const gdd::GDDArgs& ); 00047 bool NewEntry_EffectSize( const gdd::GDDArgs& ); 00048 bool NewEntry_EffectRotation( const gdd::GDDArgs& ); 00049 00050 bool NewEntry_FrameNumber( const gdd::GDDArgs& ); 00051 bool NewEntry_FrameAlpha( const gdd::GDDArgs& ); 00052 bool NewEntry_FrameColor( const gdd::GDDArgs& ); 00053 bool NewEntry_FramePosition( const gdd::GDDArgs& ); 00054 bool NewEntry_FrameMirror( const gdd::GDDArgs& ); 00055 bool NewEntry_FrameSize( const gdd::GDDArgs& ); 00056 bool NewEntry_FrameRotation( const gdd::GDDArgs& ); 00057 00058 00059 const bool arg_is_not_doubleing(const gdd::GDDString&) { 00060 //TODO: Implement this. 00061 return false; 00062 } 00063 const bool arg_is_not_integer(const gdd::GDDString&) { 00064 //TODO: Implement this. 00065 return false; 00066 } 00067 const bool arg_is_not_hexadecimal(const gdd::GDDString&) { 00068 //TODO: Implement this. 00069 return false; 00070 } 00071 const bool arg_is_not_flip_axis(const gdd::GDDString&) { 00072 //TODO: Implement this. 00073 return false; 00074 } 00075 00076 }; 00077 00078 } /* namespace ugdk */ 00079 #endif /* UGDK_UTIL_ANIMATIONPROTOCOL_H_ */