summaryrefslogtreecommitdiff
path: root/src/resources/spritedef.h
diff options
context:
space:
mode:
Diffstat (limited to 'src/resources/spritedef.h')
-rw-r--r--src/resources/spritedef.h41
1 files changed, 31 insertions, 10 deletions
diff --git a/src/resources/spritedef.h b/src/resources/spritedef.h
index bc9ae45f..16b8c0c8 100644
--- a/src/resources/spritedef.h
+++ b/src/resources/spritedef.h
@@ -54,7 +54,7 @@ struct SpriteDisplay
};
typedef std::list<SpriteReference*>::const_iterator SpriteRefs;
-
+#if 0
enum SpriteAction
{
ACTION_DEFAULT = 0,
@@ -84,7 +84,33 @@ enum SpriteAction
ACTION_DEAD,
ACTION_INVALID
};
-
+#endif
+#if 1 // Aim to be reached
+/*
+ * Remember those are the main action.
+ * Action subtypes, e.g.: "attack_bow" are to be passed by items.xml after
+ * an ACTION_ATTACK call.
+ * Which special to be use to to be passed with the USE_SPECIAL call.
+ * Running, walking, ... is a sub-type of moving.
+ * ...
+ * Please don't add hard-coded subtypes here!
+ */
+namespace SpriteAction
+{
+ static const std::string DEFAULT = "stand";
+ static const std::string STAND = "stand";
+ static const std::string SIT = "sit";
+ static const std::string SLEEP = "sleep";
+ static const std::string DEAD = "dead";
+ static const std::string MOVE = "walk";
+ static const std::string ATTACK = "attack";
+ static const std::string HURT = "hurt";
+ static const std::string USE_SPECIAL = "special";
+ static const std::string CAST_MAGIC = "magic";
+ static const std::string USE_ITEM = "item";
+ static const std::string INVALID = "";
+};
+#endif
enum SpriteDirection
{
DIRECTION_DEFAULT = 0,
@@ -109,12 +135,7 @@ class SpriteDef : public Resource
/**
* Returns the specified action.
*/
- Action *getAction(SpriteAction action) const;
-
- /**
- * Converts a string into a SpriteAction enum.
- */
- static SpriteAction makeSpriteAction(const std::string &action);
+ Action *getAction(std::string action) const;
/**
* Converts a string into a SpriteDirection enum.
@@ -170,12 +191,12 @@ class SpriteDef : public Resource
* When there are no animations defined for the action "complete", its
* animations become a copy of those of the action "with".
*/
- void substituteAction(SpriteAction complete, SpriteAction with);
+ void substituteAction(std::string complete, std::string with);
typedef std::map<std::string, ImageSet*> ImageSets;
typedef ImageSets::iterator ImageSetIterator;
- typedef std::map<SpriteAction, Action*> Actions;
+ typedef std::map<std::string, Action*> Actions;
ImageSets mImageSets;
Actions mActions;