-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathexplodingSprite.h
More file actions
24 lines (23 loc) · 838 Bytes
/
explodingSprite.h
File metadata and controls
24 lines (23 loc) · 838 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
#ifndef __EXPLODINGSPRITE_H__
#define __EXPLODINGSPRITE_H__
#include <vector>
#include <list>
#include "chunk.h"
class ExplodingSprite : public Sprite {
public:
ExplodingSprite(const Sprite& s);
~ExplodingSprite();
virtual void draw() const;
virtual void update(Uint32 ticks);
void makeChunks(unsigned int);
void reset(const Vector2f&);
unsigned int chunkCount() const { return chunks.size(); }
unsigned int freeCount() const { return freeList.size(); }
private:
std::list<Chunk> chunks; // An ExplodingSprite is a list of sprite chunks
std::list<Chunk> freeList; // When a chunk gets out of range it goes here
std::vector<Frame*> frames; // Each chunk has a Frame
ExplodingSprite(const ExplodingSprite&); // Explicit disallow (Item 6)
ExplodingSprite& operator=(const ExplodingSprite&); // (Item 6)
};
#endif