RType
Spawnable.cpp
Go to the documentation of this file.
1 /*
2 ** EPITECH PROJECT, 2023
3 ** RType
4 ** File description:
5 ** Spawnable.cpp
6 */
7 
8 #include "Animatable.hpp"
9 
10 #include <utility>
11 #include <cstring>
12 
14 {
15  _attribute = new char[64];
16  std::memset(_attribute, 0, 64);
17 }
18 
19 char *Animatable::getAttribute() const
20 {
21  return _attribute;
22 }
23 
24 void Animatable::setAttribute(std::string attribute)
25 {
26  std::memset(_attribute, 0, 64);
27  std::memcpy(_attribute, attribute.c_str(), attribute.size());
28  std::cout << "attribute: " << _attribute << std::endl;
29 }
30 
31 void Animatable::setTarget(std::shared_ptr<Drawable> target) {
32  sprite = target;
33 }
34 
35 std::shared_ptr<Drawable> Animatable::getTarget() {
36  return sprite;
37 }
38 
39 void Animatable::setTime(timeval frametime) {
40  _frametime = frametime;
41 }
42 
43 timeval Animatable::getTime() {
44  return _frametime;
45 }