-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathAnimation.cpp
More file actions
86 lines (68 loc) · 1.84 KB
/
Copy pathAnimation.cpp
File metadata and controls
86 lines (68 loc) · 1.84 KB
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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
//Animation.cpp
#include "Animation.h"
#include <iostream>
#include <sstream>
#include <math.h>
namespace sdlObjects {
void Animation::AddTile(int Tile, float Weight) {
Tiles.push_back(Tile);
Weights.push_back(Weight);
}
Animation::Animation() {
Next = Previous = NULL;
Peak = 0.0f;
Duration = Modifier = State = 0;
}
std::string Animation::GetAnimationset() {
return Animationset;
}
int Animation::GetDuration() {
return Duration;
}
std::string Animation::GetID() {
std::ostringstream Stream;
Stream << Animationset << ":" << State;
return Stream.str();
}
int Animation::GetModifier() {
return Modifier;
}
float Animation::GetPeak() {
return Peak;
}
int Animation::GetState() {
return State;
}
int Animation::GetTile(unsigned int Index) {
if (Index < Tiles.size()) return Tiles[Index]; else return 0;
}
int Animation::GetTiles() {
return Tiles.size();
}
float Animation::GetWeight(unsigned int Index) {
if (Index < Weights.size()) return Weights[Index]; else return 0.f;
}
void Animation::SetAnimationset(std::string Animationset) {
this->Animationset = Animationset;
}
void Animation::SetDuration(int Duration) {
this->Duration = Duration;
}
void Animation::SetModifier(int Modifier) {
this->Modifier = Modifier;
}
void Animation::SetPeak(float Peak) {
this->Peak = Peak;
}
void Animation::SetState(int State) {
this->State = State;
}
void Animation::Who() {
std::cout << Animationset << ":"<< State << std::endl;
}
Animation::~Animation() {
Next = Previous = NULL;
Peak = 0.0f;
Duration = Modifier = State = 0;
}
}