aboutsummaryrefslogtreecommitdiff
path: root/include/MessagePart.hpp
blob: e50852a98eaf0803a89cf8eacca044bc3f198b13 (plain)
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
35
36
37
38
#pragma once

#include <SFML/Graphics/Text.hpp>
#include <SFML/System/Vector2.hpp>
#include <string>

namespace dchat
{
    class MessagePart
    {
    public:
        enum class Type
        {
            TEXT
        };
        
        MessagePart(Type _type) : type(_type) {}
        virtual ~MessagePart(){}
        
        static float getSizeScaled();
        virtual sf::Vector2f getPosition() const = 0;
        virtual sf::Vector2f getSize() const = 0;
        
        const Type type;
    };
    
    class MessagePartText : public MessagePart
    {
    public:
        MessagePartText(const std::string &text);
        
        static float getFontSizeScaled();
        virtual sf::Vector2f getPosition() const override;
        virtual sf::Vector2f getSize() const override;
        
        sf::Text text;
    };
}