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
CzActionsActor.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_ACTIONS_ACTOR_H_)
00015 #define _CZ_ACTIONS_ACTOR_H_
00016 
00017 #include "CzActions.h"
00018 #include "CzXoml.h"
00019 
00020 /**
00021  @addtogroup Actions
00022  @{
00023  */
00024  
00025 /**
00026  @class CzXomlActions_Actor
00027 
00028  @brief Implements a collection of actor actions.
00029 
00030  The CzXomlActions_Actor class holds Actions (IzXomlAction) that can be carried out on Actors (CzActor). An action is basically a command that tells the actor to do something 
00031  such as modify its appearance or behaviour. For example the KillActor tells the actor to remove itself from the scene and destroy itself.
00032  
00033  The following actions are supported:
00034  - HideActor        - Hide an actor from view (continues processing)
00035  - ShowActor        - Shows a previously hidden actor
00036  - ActivateActor    - Activates an actor (resumes processing of the actor)
00037  - DeactivateActor  - Deactivates an actor (suspends processing but still displays it)
00038  - KillActor        - Removes the actor from its scene and destroys it, fires the actors OnDestroy event handler)
00039  - SetKeyFocus      - Sets actor as key focus (actor will receive input from key / button devices)
00040  - UpdateText       - Updates a text actor with the value of a variable (deprecated, property bindings are now used instead)
00041 
00042  The above actions have the following XOML prototypes:
00043  - HideActor(actor-name)
00044    - actor-name - Name of target actor (uses actions container actor if not specified)
00045  - ShowActor(actor-name)
00046    - actor-name - Name of target actor (uses actions container actor if not specified)
00047  - ActivateActor(actor-name)
00048    - actor-name - Name of target actor (uses actions container actor if not specified)
00049  - DeactivateActor(actor-name)
00050    - actor-name - Name of target actor (uses actions container actor if not specified)
00051  - KillActor(actor-name)
00052    - actor-name - Name of target actor (uses actions container actor if not specified)
00053  - SetKeyFocus(actor-name)
00054    - actor-name - Name of target actor (uses actions container actor if not specified)
00055  - UpdateText(actor-name, variable-name, parent-scene-name (optional))
00056    - actor-name - Name of target actor (uses actions container actor if not specified)
00057    - variable-name - Name of variable to write to the actor
00058    - parent-scene-name - Scene where target actor lives
00059 
00060  For more information on the actions system see CzAction
00061  
00062  */
00063 class CzXomlActions_Actor : public IzXomlAction
00064 {
00065 public:
00066     enum eActionType
00067     {
00068         Action_HideActor        = 0,    
00069         Action_ShowActor        = 1,    
00070         Action_ActivateActor    = 2,    
00071         Action_DeactivateActor  = 3,    
00072         Action_KillActor        = 4,    
00073         Action_SetKeyFocus      = 5,    
00074         Action_UpdateText       = 6,    
00075         Action_Max              = 7,
00076     };
00077 protected:
00078     eActionType Type;
00079     CzXomlActions_Actor() {}
00080 public:
00081     CzXomlActions_Actor(eActionType type)
00082     {
00083         Type = type;
00084         switch (Type)
00085         {
00086         case Action_HideActor:
00087             setActionName("hideactor");
00088             break;
00089         case Action_ShowActor:
00090             setActionName("showactor");
00091             break;
00092         case Action_ActivateActor:
00093             setActionName("activateactor");
00094             break;
00095         case Action_DeactivateActor:
00096             setActionName("deactivateactor");
00097             break;
00098         case Action_KillActor:
00099             setActionName("killactor");
00100             break;
00101         case Action_SetKeyFocus:
00102             setActionName("setkeyfocus");
00103             break;
00104         case Action_UpdateText:
00105             setActionName("updatetext");
00106             break;
00107         }
00108     }
00109     void Execute(IzXomlResource* source, CzAction* action);
00110 };
00111 
00112 /// @}
00113 
00114 #endif // _CZ_ACTIONS_ACTOR_H_