GCC Code Coverage Report
Directory: src/ Exec Total Coverage
File: src/mumblemanager.h Lines: 0 3 0.0 %
Date: 2017-11-29 Branches: 0 20 0.0 %

Line Branch Exec Source
1
/*
2
 *  Code taken from: http://mumble.sourceforge.net/Link
3
 *
4
 *  All code listed below is in the public domain and can be used, shared or
5
 *  modified freely
6
 *
7
 *  Copyright (C) 2011-2017  The ManaPlus Developers
8
 */
9
10
#ifndef MUMBLEMANAGER_H
11
#define MUMBLEMANAGER_H
12
13
#ifdef USE_MUMBLE
14
15
#include <string>
16
#if defined (__FreeBSD__) || (defined __DragonFly__)
17
#include <sys/stat.h>
18
#endif  // defined (__FreeBSD__) || (defined __DragonFly__)
19
20
#include "localconsts.h"
21
22
struct LinkedMem final
23
{
24
    LinkedMem() :
25
        uiVersion(0U),
26
        uiTick(0U),
27
        fAvatarPosition(),
28
        fAvatarFront(),
29
        fAvatarTop(),
30
        name(),
31
        fCameraPosition(),
32
        fCameraFront(),
33
        fCameraTop(),
34
        identity(),
35
        context_len(0U),
36
        context(),
37
        description()
38
    { }
39
40
    A_DELETE_COPY(LinkedMem)
41
42
    uint32_t uiVersion;
43
    uint32_t uiTick;
44
    float fAvatarPosition[3];
45
    float fAvatarFront[3];
46
    float fAvatarTop[3];
47
    wchar_t name[256];
48
    float fCameraPosition[3];
49
    float fCameraFront[3];
50
    float fCameraTop[3];
51
    wchar_t identity[256];
52
    uint32_t context_len;
53
    char context[256];
54
    wchar_t description[2048];
55
};
56
57
class MumbleManager final
58
{
59
    public:
60
        MumbleManager();
61
62
        A_DELETE_COPY(MumbleManager)
63
64
        ~MumbleManager();
65
66
        void init();
67
68
        void setPlayer(const std::string &userName);
69
70
        void setAction(const int action);
71
72
        void setPos(const int tileX, const int tileY, const int direction);
73
74
        void setMap(const std::string &mapName);
75
76
        void setServer(const std::string &serverName);
77
78
    private:
79
        static uint16_t getMapId(std::string mapName) A_WARN_UNUSED;
80
81
        void setMapBase(uint16_t mapid);
82
83
        LinkedMem *mLinkedMem;
84
        LinkedMem mLinkedMemCache;
85
        float mMapBase[3];
86
};
87
88
extern MumbleManager *mumbleManager;
89
90
#endif  // USE_MUMBLE
91
#endif  // MUMBLEMANAGER_H