AppEasy Core SDK
1.5.0
Cross platform mobile and desktop app and game development SDK - The easy way to make apps
|
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_ACTIONS_SHARED_H_) 00015 #define _CZ_ACTIONS_SHARED_H_ 00016 00017 #include "CzActions.h" 00018 #include "CzXoml.h" 00019 00020 /** 00021 @addtogroup Actions 00022 @{ 00023 */ 00024 00025 /** 00026 @class CzXomlActions_Shared 00027 00028 @brief Implements actions that are shared between actors and scenes 00029 00030 The CzXomlActions_Shared class holds Actions (IzXomlAction) that deal with common functionality that is shared between scenes and actors 00031 00032 The following actions are supported: 00033 - SetProperty 00034 - AddProperty 00035 - SetUserProp 00036 - AddUserProp 00037 - UserPropToVar 00038 - AddModifier 00039 - ChangeModifier 00040 00041 00042 The above actions have the following XOML prototypes: 00043 - SetProperty(property-name, property-value, actor-name, scene-name) 00044 - property-name - Name of property 00045 - property-value - Value to assign to property 00046 - actor-name - Name of actor to set property of, if omitted then actor that the action is called from will be used (optional) 00047 - scene-name - Scene where the specific actor specified actor-name lives, if actor-name not specified then property of this scene will be set (optional) 00048 - AddProperty(property-name, property-value, actor-name, scene-name) 00049 - property-name - Name of property 00050 - property-value - Value to add to property 00051 - actor-name - Name of actor to set property of, if omitted then actor that the action is called from will be used (optional) 00052 - scene-name - Scene where the specific actor specified actor-name lives, if actor-name not specified then property of this scene will be set (optional) 00053 - SetUserProp(property-name, property-value, actor-name, scene-name) 00054 - property-name - Name of user property 00055 - property-value - Value to assign to user property 00056 - actor-name - Name of actor to set user property of, if omitted then actor that the action is called from will be used (optional) 00057 - scene-name - Scene where the specific actor specified actor-name lives, if actor-name not specified then user property of this scene will be set (optional) 00058 - AddUserProp(property-name, property-value, actor-name, scene-name) 00059 - property-name - Name of user property 00060 - property-value - Value to add to user property 00061 - actor-name - Name of actor to set user property of, if omitted then actor that the action is called from will be used (optional) 00062 - scene-name - Scene where the specific actor specified actor-name lives, if actor-name not specified then user property of this scene will be set (optional) 00063 - UserPropToVar(property-name, variable-name, actor-name, scene-name) 00064 - property-name - Name of user property 00065 - property-value - Name of value to receive the user property 00066 - actor-name - Name of actor to use, if omitted then actor that the action is called from will be used (optional) 00067 - scene-name - Scene where the specific actor specified actor-name lives, if actor-name not specified then this scene will be used (optional) 00068 - AddModifier(modifier-name, modifier-parameter, actor-name, scene-name) 00069 - modifier-name - Name of modifier 00070 - command - Specifies how the modifier is to be changed (activate, deactivate, toggle or remove) 00071 - actor-name - Name of actor to add the modifier to (optional) 00072 - scene-name - Scene where the specific actor specified actor-name lives, if actor-name not specified then modifier will be added to this scene(optional) 00073 - ChangeModifier(modifier-name, command, actor-name, scene-name) 00074 00075 For more information on actors and scenes see CzActor and CzScene. For more information on Modifiers see IzModifier and CzModifierManager 00076 00077 */ 00078 00079 class CzXomlActions_Shared : public IzXomlAction 00080 { 00081 public: 00082 enum eActionType 00083 { 00084 Action_SetProperty = 0, 00085 Action_AddProperty = 1, 00086 Action_SetUserProp = 2, 00087 Action_AddUserProp = 3, 00088 Action_UserPropToVar = 4, 00089 Action_AddModifier = 5, 00090 Action_ChangeModifier = 6, 00091 Action_Max = 7, 00092 }; 00093 protected: 00094 eActionType Type; 00095 CzXomlActions_Shared() {} 00096 public: 00097 CzXomlActions_Shared(eActionType type) 00098 { 00099 Type = type; 00100 switch (Type) 00101 { 00102 case Action_SetProperty: 00103 setActionName("setproperty"); 00104 break; 00105 case Action_AddProperty: 00106 setActionName("addproperty"); 00107 break; 00108 case Action_SetUserProp: 00109 setActionName("setuserprop"); 00110 break; 00111 case Action_UserPropToVar: 00112 setActionName("userproptovar"); 00113 break; 00114 case Action_AddUserProp: 00115 setActionName("adduserprop"); 00116 break; 00117 case Action_AddModifier: 00118 setActionName("addmodifier"); 00119 break; 00120 case Action_ChangeModifier: 00121 setActionName("changemodifier"); 00122 break; 00123 } 00124 } 00125 void Execute(IzXomlResource* source, CzAction* action); 00126 }; 00127 00128 /// @} 00129 00130 #endif // _CZ_ACTIONS_SHARED_H_