SDL2lazy
SlRenderItem.h
Go to the documentation of this file.
1 // part of SDL2lazy
2 // author: Ulrike Hager
3 
8 #ifndef SLRENDERITEM_H
9 #define SLRENDERITEM_H
10 
11 #include <memory>
12 #include <string>
13 
14 #include "SlSprite.h"
15 
22 {
23  public:
26  SlRenderItem();
29  SlRenderItem(std::shared_ptr<SlSprite> pSprite, unsigned int dest);
30 
31  ~SlRenderItem();
34  SlRenderItem(const SlRenderItem& toCopy);
37  SlRenderItem& operator=(const SlRenderItem& rhs);
40  bool operator==( const SlRenderItem& rhs)
41  {
42  return ( (sprite_->name() == rhs.sprite_->name() ) &&
43  (destination_ == rhs.destination_ ) );
44  }
47  bool operator!=( const SlRenderItem& rhs)
48  {
49  return !(*this == rhs);
50  }
51 
54  void initialize(const std::shared_ptr<SlSprite> pSprite, unsigned int dest);
57  bool is_inside(const int& x, const int& y);
60  std::string name() {return sprite_->name();}
61 
64  std::shared_ptr<SlSprite> sprite_;
67  unsigned int destination_ ;
70  bool isActive = false;
73  bool renderMe_;
74 };
75 
76 
77 
78 
79 #endif // SLRENDERITEM_H
bool is_inside(const int &x, const int &y)
Definition: SlRenderItem.cc:69
SlSprite class, RenderOptions enum, SlRenderSettings struct.
Definition: SlRenderItem.h:21
bool operator==(const SlRenderItem &rhs)
Definition: SlRenderItem.h:40
std::string name()
Definition: SlRenderItem.h:60
void initialize(const std::shared_ptr< SlSprite > pSprite, unsigned int dest)
Definition: SlRenderItem.cc:59
bool renderMe_
Definition: SlRenderItem.h:73
SlRenderItem & operator=(const SlRenderItem &rhs)
Definition: SlRenderItem.cc:48
bool operator!=(const SlRenderItem &rhs)
Definition: SlRenderItem.h:47
bool isActive
Definition: SlRenderItem.h:70
SlRenderItem()
Definition: SlRenderItem.cc:16
std::shared_ptr< SlSprite > sprite_
Definition: SlRenderItem.h:64
unsigned int destination_
Definition: SlRenderItem.h:67