Skip to content

Commit

Permalink
Added IDrawable and IRecalculable in C++
Browse files Browse the repository at this point in the history
  • Loading branch information
justalemon committed Sep 8, 2021
1 parent b0a6c0f commit f5cc178
Show file tree
Hide file tree
Showing 4 changed files with 40 additions and 0 deletions.
16 changes: 16 additions & 0 deletions LemonUI.SHV/IDrawable.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

namespace LemonUI
{
/// <summary>
/// Represents an item that can be drawn.
/// </summary>
class IDrawable
{
public:
/// <summary>
/// Draws the item on the screen.
/// </summary>
virtual void Draw() = 0;
};
}
16 changes: 16 additions & 0 deletions LemonUI.SHV/IRecalculable.hpp
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
#pragma once

namespace LemonUI
{
/// <summary>
/// Interface for classes that have values that need to be recalculated on resolution changes.
/// </summary>
class IRecalculable
{
public:
/// <summary>
/// Recalculates the values.
/// </summary>
virtual void Recalculate() = 0;
};
}
2 changes: 2 additions & 0 deletions LemonUI.SHV/LemonUI.SHV.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,8 @@
</ItemGroup>
<ItemGroup>
<ClInclude Include="Alignment.hpp" />
<ClInclude Include="IDrawable.hpp" />
<ClInclude Include="IRecalculable.hpp" />
<ClInclude Include="Sound.hpp" />
</ItemGroup>
<PropertyGroup Label="Globals">
Expand Down
6 changes: 6 additions & 0 deletions LemonUI.SHV/LemonUI.SHV.vcxproj.filters
Original file line number Diff line number Diff line change
Expand Up @@ -26,5 +26,11 @@
<ClInclude Include="Alignment.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="IRecalculable.hpp">
<Filter>Header Files</Filter>
</ClInclude>
<ClInclude Include="IDrawable.hpp">
<Filter>Header Files</Filter>
</ClInclude>
</ItemGroup>
</Project>

0 comments on commit f5cc178

Please sign in to comment.