AppEasy Core SDK  1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
 All Classes Files Functions Variables Typedefs Enumerations Enumerator Defines
CzXomlActions.h
Go to the documentation of this file.
00001 // 
00002 //
00003 // AppEasy SDK - Cross Platform Multi-purpose Game and App Engine
00004 //
00005 // Developed by Matthew Hopwood of Pocketeers Limited - www.pocketeers.co.uk
00006 //
00007 // For updates, tutorials and more details check out www.appeasymobile.com
00008 //
00009 // This code is provided free of charge and without any warranty whatsoever. You must ensure that this whole notice is present in all files and derivatives, so the reader knows its origin.
00010 // If you use this SDK in your product then please ensure that you credit AppEasy's usage appropriately. Please see www.appeasymobile.com for licensing details and support
00011 //
00012 //
00013 
00014 #if !defined(_CZ_XOML_ACTIONS_H_)
00015 #define _CZ_XOML_ACTIONS_H_
00016 
00017 #include "CzString.h"
00018 #include "CzUtil.h"
00019 
00020 struct CzAction;
00021 class IzXomlResource;
00022 class CzApp;
00023 class CzActor;
00024 class CzScene;
00025 
00026 /**
00027  @addtogroup XOML
00028  @{
00029  */
00030 
00031 
00032 /**
00033  @class IzXomlAction
00034 
00035  @brief Base class that is used by classes that create actions that can be executed in XOML.
00036 
00037  All XOML actions that can be called from XOML are derived from this class. See CzAction for more information.
00038 
00039  */
00040 class IzXomlAction
00041 {
00042     // Properties
00043 protected:
00044 #if defined(_DEBUG)
00045     CzString                ActionName;             ///< Name of action
00046 #endif
00047     unsigned int            ActionNameHash;         ///< Name of action as a string hash
00048 public:
00049     void                    setActionName(const char* name)
00050     {
00051 #if defined(_DEBUG)
00052         ActionName = name;
00053 #endif
00054         ActionNameHash = CzString::CalculateHash(name);
00055     }
00056     unsigned int            getActionNameHash() const       { return ActionNameHash; }
00057 #if defined(_DEBUG)
00058     CzString&               getActionName()                 { return ActionName; }
00059 #endif
00060     // Properties end
00061 public:
00062     virtual void Execute(IzXomlResource* source, CzAction* action) = 0;
00063 
00064     static IzXomlResource* getContainer(IzXomlResource* source, CzApp*& app, CzScene*& scene, CzActor*& actor);
00065 };
00066 
00067 
00068 
00069 /// @}
00070 
00071 #endif  // _CZ_XOML_ACTIONS_H_