Added constructors for Actor.
authorTegmine <emilyteng55@gmail.com>
Sat, 3 Mar 2012 21:51:23 +0000 (15:51 -0600)
committerTegmine <emilyteng55@gmail.com>
Sat, 3 Mar 2012 21:51:23 +0000 (15:51 -0600)
.gitignore
Actor.cpp
Actor.h

index f03e459..59029c4 100644 (file)
@@ -31,6 +31,7 @@ SDL.dll
 *.sbr
 *.sdf
 *.opensdf
+*.filters
 ipch/
 obj/
 [Bb]in
index 54c636e..ad68834 100644 (file)
--- a/Actor.cpp
+++ b/Actor.cpp
@@ -7,3 +7,17 @@ Actor::Actor(Animation *anim):
        mAnimations.push_back(anim);
 }
 
+Actor::Actor(std::vector<Animation*> anims):
+       mFrame(0),
+       mCurrentAnimation(0)
+{
+       mAnimations = anims;
+}
+
+Actor::Actor(std::vector<string> anims):
+       mFrame(0),
+       mCurrentAnimation(0)
+{
+       for(int i=0; i<anims.size(); i++)
+               mAnimations.Add(This.Game.CurrentLevel.GetAnimation(anim));
+}
\ No newline at end of file
diff --git a/Actor.h b/Actor.h
index 9e55136..0391f0a 100644 (file)
--- a/Actor.h
+++ b/Actor.h
@@ -16,6 +16,8 @@ class Actor
 {
        public:
        Actor(Animation *anim);
+       Actor(std::vector<Animation*> anims);
+       Actor(std::vector<string> anims);
        int mFrame;/**< The frame # */
        int mCurrentAnimation;/**< Index to the current loaded animation */
        std::vector<Animation*> mAnimations;/**< Vector of pointers to all of this sprite's Animations */