-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathAnimation.h
45 lines (35 loc) · 940 Bytes
/
Animation.h
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
#ifndef __ANIMATION_H__
#define __ANIMATION_H__
#include "Sprite.h"
#include "Box.h"
namespace df {
class Animation
{
private:
Sprite* m_p_sprite;
std::string m_name;
int m_index;
int m_slowdown_count;
Box m_box; // Box for sprite boundary & collisions.
public:
Animation();
//Getters and Setters
void setSprite(Sprite* p_new_sprite);
Sprite* getSprite() const;
void setName(std::string new_name);
std::string getName() const;
void setIndex(int new_index);
int getIndex() const;
void setSlowdownCount(int new_slowdown_count);
int getSlowdownCount() const;
//Draw a single frame centered at position (x,y)
//Drawing accounts for slowdown and advance Sprite frame
//Return 0 if ok, else -1
int draw(Vector position);
// Set Object's bounding box.
void setBox(Box new_box);
// Get Object's bounding box.
Box getBox() const;
};
}
#endif