EHM DAL 0.2.5
Data abstraction layer for Eastside Hockey Manager
Loading...
Searching...
No Matches
season_offset_date.h
1#pragma once
2
3// Application headers
4#include "include/data_types/data_type.h"
5#include "include/data_types/date/day_of_year.h"
6#include "include/data_types/private/abstract_data_type.h"
7
8// Qt headers
9class QDataStream;
10class QDate;
11
12namespace ehm_dal::data_types {
17{
18public:
19 // Constructor
21
22 // File I/O
23 void readDayOfYear(QDataStream &in);
24 void readYearOffset(QDataStream &in);
25 void writeDayOfYear(QDataStream &out);
26 void writeYearOffset(QDataStream &out);
27
28 // Get data
29 QDate date() const;
30 inline DayOfYear dayOfYear() const { return day_; }
31 inline qint8 yearOffset() const { return season_year_offset_.value(); }
32
33private:
34 DayOfYear day_{0};
35 DataType<qint8> season_year_offset_{0};
36
37 QVariant value(const qint32 role = Qt::DisplayRole) const override;
38 void setValue(const QVariant &value) override;
39};
40} // namespace ehm_dal::data_types
The AbstractDataType class provides common virtual functions for all integral game data types.
Definition: abstract_data_type.h:11
The DataType class is a template class for all C++ integral and floating point data types.
Definition: data_type.h:21
T value() const
Returns the raw value which can otherwise be accessed via QVariant data(const qint32 role).
Definition: data_type.h:45
The DayOfYear class represents the day of a year (0 = 1 Jan, 1 = 2 Jan, etc).
Definition: day_of_year.h:11
The SeasonOffsetDate class represents a season offset value with a DayOfYear value.
Definition: season_offset_date.h:17
namespace ehm_dal::data_types
Definition: attribute.h:6