m5stack-avatar
Loading...
Searching...
No Matches
Face.h
1// Copyright (c) Shinya Ishikawa. All rights reserved.
2// Licensed under the MIT license. See LICENSE file in the project root for full
3// license information.
4
5#ifndef FACE_H_
6#define FACE_H_
7
8#include "Balloon.h"
9#include "BoundingRect.h"
10#include "Eye.h"
11#include "Eyeblow.h"
12#include "Mouth.h"
13#include "Effect.h"
14#include "BatteryIcon.h"
15
16namespace m5avatar {
17
18class Face {
19 private:
20 Drawable *mouth;
21 Drawable *eyeR;
22 Drawable *eyeL;
23 Drawable *eyeblowR;
24 Drawable *eyeblowL;
25 BoundingRect *mouthPos;
26 BoundingRect *eyeRPos;
27 BoundingRect *eyeLPos;
28 BoundingRect *eyeblowRPos;
29 BoundingRect *eyeblowLPos;
30 BoundingRect *boundingRect;
31 M5Canvas *sprite;
32 M5Canvas *tmpSprite;
33 Balloon *b;
34 Effect *h;
35 BatteryIcon *battery;
36
37 public:
38 // constructor
39 Face();
40 Face(Drawable *mouth, Drawable *eyeR, Drawable *eyeL, Drawable *eyeblowR,
41 Drawable *eyeblowL);
42 // TODO(meganetaaan): apply builder pattern
43 Face(Drawable *mouth, BoundingRect *mouthPos, Drawable *eyeR,
44 BoundingRect *eyeRPos, Drawable *eyeL, BoundingRect *eyeLPos,
45 Drawable *eyeblowR, BoundingRect *eyeblowRPos, Drawable *eyeblowL,
46 BoundingRect *eyeblowLPos);
47 Face(Drawable *mouth, BoundingRect *mouthPos, Drawable *eyeR,
48 BoundingRect *eyeRPos, Drawable *eyeL, BoundingRect *eyeLPos,
49 Drawable *eyeblowR, BoundingRect *eyeblowRPos, Drawable *eyeblowL,
50 BoundingRect *eyeblowLPos,
51 BoundingRect *boundingRect, M5Canvas *spr, M5Canvas *tmpSpr);
52 ~Face();
53 Face(const Face &other) = default;
54 Face &operator=(const Face &other) = default;
55
56 Drawable *getLeftEye();
57 Drawable *getRightEye();
58
59 // void setParts(PartsType p, Drawable parts);
60 // Drawable *getParts(PartsType p);
61
62 Drawable *getMouth();
63 BoundingRect *getBoundingRect();
64
65 void setLeftEye(Drawable *eye);
66 void setRightEye(Drawable *eye);
67 void setMouth(Drawable *mouth);
68 void setLeftEyeblow();
69 void setRightEyeblow();
70
71 void draw(DrawContext *ctx);
72};
73} // namespace m5avatar
74
75#endif // FACE_H_
Definition: Balloon.h:24
Definition: BatteryIcon.h:14
Definition: BoundingRect.h:10
Definition: DrawContext.h:22
Definition: Drawable.h:13
Definition: Effect.h:15
Definition: Face.h:18