refactor: moved font loading to label

This commit is contained in:
2025-07-26 12:33:45 +03:00
parent 44a366f475
commit 863c3a8d7a
3 changed files with 11 additions and 14 deletions

View File

@@ -1,12 +1,8 @@
using Microsoft.Xna.Framework.Content;
using Microsoft.Xna.Framework.Graphics;
using Syntriax.Engine.Core;
using Syntriax.Engine.Integration.MonoGame;
namespace Pong.Behaviours;
public class ScoreLabel(bool IsLeft) : Label, IFirstFrameUpdate, ILoadContent
public class ScoreLabel(bool IsLeft) : Label, IFirstFrameUpdate
{
public readonly bool IsLeft = IsLeft;
@@ -22,11 +18,6 @@ public class ScoreLabel(bool IsLeft) : Label, IFirstFrameUpdate, ILoadContent
UpdateScores(pongManager);
}
public void LoadContent(ContentManager content)
{
Font = content.Load<SpriteFont>("UbuntuMono");
}
private void UpdateScores(PongManager pongManager)
{
if (IsLeft)