-
Notifications
You must be signed in to change notification settings - Fork 1
/
AnimationBuilder.h
34 lines (30 loc) · 988 Bytes
/
AnimationBuilder.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
#ifndef SUPERMARIOBROS_ANIMATIONBUILDER_H
#define SUPERMARIOBROS_ANIMATIONBUILDER_H
#include "Animation.h"
class AnimationBuilder
{
public:
AnimationBuilder();
Animation build(sf::Sprite& sprite);
AnimationBuilder withOffset(size_t xOffset, size_t yOffset);
AnimationBuilder withRectSize(size_t width, size_t height);
AnimationBuilder withNumRect(size_t numRect);
AnimationBuilder withFrameBorder(size_t borderSize);
AnimationBuilder andRepeat();
AnimationBuilder withTicsPerFrame(size_t ticsPerFrame);
AnimationBuilder withNonContiguousRect(
const std::vector<sf::IntRect>& rectangles);
AnimationBuilder withName(const std::string& name);
private:
size_t mXOffset;
size_t mYOffset;
size_t mWidth;
size_t mHeight;
size_t mNumRect;
size_t mBorderSize;
bool mRepeat;
size_t mTicsPerFrame;
std::vector<sf::IntRect> mRectangles;
std::string mName;
};
#endif // SUPERMARIOBROS_ANIMATIONBUILDER_H