-
Notifications
You must be signed in to change notification settings - Fork 2
/
hall.h
48 lines (39 loc) · 1.14 KB
/
hall.h
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
39
40
41
42
43
44
45
46
47
48
#ifndef IKOOSKAR_SHARED_HALL_H
#define IKOOSKAR_SHARED_HALL_H
#include "Shared/pattern.h"
#include "desk.h"
#include <QJsonObject>
#include <QString>
#include <array>
#include <vector>
using DeskRow = std::array<ikoOSKAR::Shared::Desk, 6>;
using DeskLayout = std::vector<DeskRow>;
namespace ikoOSKAR {
namespace Shared {
class Hall {
public:
class Layout {
private:
static Layout fromJson(const QJsonObject& json);
QJsonObject toJson() const;
public:
DeskLayout deskRows;
Layout();
Layout(int capacity);
static Layout fromJsonStr(const QString& jsonStr);
QString toJsonStr() const;
void clear();
};
QString name;
int capacity;
Layout layout;
Pattern* pattern;
Hall();
Hall(const QString& name, int capacity);
Hall(const QString& name, int capacity, const Layout& layout);
int countVariant(Pattern::Variant v);
int countStudents(int grade, const QString& section);
};
} // namespace Shared
} // namespace ikoOSKAR
#endif // IKOOSKAR_SHARED_HALL_H