Start documenting some classes

This commit is contained in:
NaiJi ✨ 2022-05-08 06:43:12 +03:00
parent 41541e0757
commit f1d24460a6
9 changed files with 58 additions and 10 deletions

View File

@ -8,6 +8,15 @@
namespace kku
{
/// Area
///
/// Consists of 2 arithmetic
/// points that represent
/// a rectangle position
/// and 2 arithmetic
/// lengths by x and y
/// that represent
/// rectangle coverage area
template <typename T, typename = std::enable_if_t<std::is_arithmetic_v<T>>>
struct Area
{

View File

@ -5,14 +5,33 @@
namespace kku
{
/// BPMSection
///
/// Data to setup and distinguish
/// a section on beatmap timeline
struct BPMSection
{
/// Amount of beats
/// per minute in the section
unsigned int bpm = 120; // Hi, osu
/// Denominator in fraction of major
/// beats. Like, 1/2, 1/3. etc...
unsigned int fraction = 2;
/// Timestamp respresenting when
/// the section becomes active
microsec offset_start = 0;
/// Interval between beats
microsec interval = 0;
};
/// BPMSectionComparator
///
/// Predicate to define
/// BPMSection sorting rule:
/// by timestamp of start
struct BPMSectionComparator
{
bool operator()(const BPMSection& lhs, const BPMSection& rhs) const noexcept
@ -21,4 +40,4 @@ struct BPMSectionComparator
}
};
}
}

View File

@ -3,6 +3,9 @@
namespace kku
{
/// Color
///
/// Object of color data in RGBa
struct Color
{
unsigned char red = 0;
@ -11,4 +14,4 @@ struct Color
unsigned char alpha = 0;
};
}
}

View File

@ -13,6 +13,10 @@
namespace kku
{
/// CoreFactory
///
/// Provides basic
/// multimedia elements and data
class CoreFactory
{
public:

View File

@ -10,6 +10,10 @@
namespace kku
{
/// Editor
///
/// Functional aggregation of
/// logic for Editor game mode
class Editor
{
public:
@ -85,4 +89,4 @@ protected:
std::set<BPMSection, BPMSectionComparator> _bpm_sections;
};
}
}

View File

@ -6,6 +6,10 @@
namespace kku
{
/// Game
///
/// Functional aggregation of
/// logic for actual game mode
class Game
{
public:
@ -17,4 +21,4 @@ public:
virtual void display() const = 0;
};
}
}

View File

@ -6,6 +6,9 @@
namespace kku
{
/// Line
///
/// Graphical 2D line
class Line
{
public:
@ -15,4 +18,4 @@ public:
virtual void display() = 0;
};
}
}

View File

@ -7,6 +7,9 @@
namespace kku
{
/// Music
///
/// Object for streaming music file
class Music
{
public:

View File

@ -5,11 +5,10 @@
namespace kku
{
/* Meaning an element of a vector space in math.
* Don't mistake for std::vector<T>
* For now we don't need it as a special class,
* so let it be a wrapper. */
/// Vector2
///
/// Meaning an element of a vector space in math.
/// Don't mistake for std::vector<T>
template <typename T>
using Vector2 = std::pair<T, T>;