<commit_before>﻿using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LostSoul
{
    class LostSoulWorldHud
    {
        private LostSoulWorld world;
        private HudElement root;
        private HudElement gameHud;
        private HudElement gameOverHud;

        private HudElement gameOverTextBackground;
        private HudElementText scoreLabel;
        private HudElementText lostSoulsLabel;
        private HudElementText difficultyLabel;

        private Color textColor = Color.Red;
        private Color gameOverTextColor = Color.White;

        public LostSoulWorldHud(LostSoulWorld world)
        {
            this.world = world;
            world.GameOverChanged += OnGameOverChangedHandler;
            root = new HudElement(world.Game);
            root.BodyBehavior.Size = new Vector2(world.Game.PlayField.Width, world.Game.PlayField.Height);

            setupGameHud(world);
            setupGameOverHud(world);
        }

        private void setupGameHud(LostSoulWorld world)
        {
            gameHud = new HudElement(world.Game);
            root.AddChild(gameHud);

            scoreLabel = new HudElementText(world.Game);
            scoreLabel.Color = textColor;
            gameHud.AddChild(scoreLabel);

            lostSoulsLabel = new HudElementText(world.Game);
            lostSoulsLabel.Color = textColor;
            lostSoulsLabel.BodyBehavior.Position = new Vector2(200.0f, 0.0f);
            gameHud.AddChild(lostSoulsLabel);

            difficultyLabel = new HudElementText(world.Game);
            difficultyLabel.Text = "Difficulty: 100%";
            difficultyLabel.Color = textColor;
            difficultyLabel.BodyBehavior.Position = new Vector2(300.0f, 0.0f);
            gameHud.AddChild(difficultyLabel);

            gameHud.RenderBehavior = new PrimitiveRectangleRenderBehavior(gameHud)
            {
                Color = new Color(0.0f, 0.0f, 0.0f, 0.4f)
            };
            gameHud.BodyBehavior.Position = Vector2.Zero;
            gameHud.BodyBehavior.Size = difficultyLabel.BodyBehavior.Position + difficultyLabel.BodyBehavior.Size + new Vector2(5.0f, 2.0f);
        }

        private void setupGameOverHud(LostSoulWorld world)
        {
            gameOverHud = new HudElement(world.Game);
            gameOverHud.Visible = false;
            gameOverHud.BodyBehavior.Size = root.BodyBehavior.Size;
            root.AddChild(gameOverHud);

            setupGameOverTextBackground(world);
            setupGameOverText(world);
            setupGameOverInstructions(world);
            adjustGameOverTextBackgroundSize();
        }

        private void setupGameOverTextBackground(LostSoulWorld world)
        {
            gameOverTextBackground = new HudElement(world.Game);
            var center = gameOverHud.BodyBehavior.Size * 0.5f;
            var size = new Vector2(200.0f, 200.0f);
            gameOverTextBackground.BodyBehavior.Size = size;
            gameOverTextBackground.BodyBehavior.Position = new Vector2(
                center.X - size.X / 2.0f,<commit_msg>Added help label to HUD ("F - Fullscreen").<commit_after>﻿using Microsoft.Xna.Framework;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace LostSoul
{
    class LostSoulWorldHud
    {
        private LostSoulWorld world;
        private HudElement root;
        private HudElement gameHud;
        private HudElement gameOverHud;

        private HudElement gameOverTextBackground;
        private HudElementText scoreLabel;
        private HudElementText lostSoulsLabel;
        private HudElementText difficultyLabel;
        private HudElementText helpLabel;

        private Color textColor = Color.Red;
        private Color gameOverTextColor = Color.White;

        public LostSoulWorldHud(LostSoulWorld world)
        {
            this.world = world;
            world.GameOverChanged += OnGameOverChangedHandler;
            root = new HudElement(world.Game);
            root.BodyBehavior.Size = new Vector2(world.Game.PlayField.Width, world.Game.PlayField.Height);

            setupGameHud(world);
            setupGameOverHud(world);
        }

        private void setupGameHud(LostSoulWorld world)
        {
            gameHud = new HudElement(world.Game);
            root.AddChild(gameHud);

            scoreLabel = new HudElementText(world.Game);
            scoreLabel.Color = textColor;
            gameHud.AddChild(scoreLabel);

            lostSoulsLabel = new HudElementText(world.Game);
            lostSoulsLabel.Color = textColor;
            lostSoulsLabel.BodyBehavior.Position = new Vector2(200.0f, 0.0f);
            gameHud.AddChild(lostSoulsLabel);

            difficultyLabel = new HudElementText(world.Game);
            difficultyLabel.Text = "Difficulty: 100%";
            difficultyLabel.Color = textColor;
            difficultyLabel.BodyBehavior.Position = new Vector2(300.0f, 0.0f);
            gameHud.AddChild(difficultyLabel);

            helpLabel = new HudElementText(world.Game);
            helpLabel.Text = "F - Fullscreen";
            helpLabel.Color = textColor;
            helpLabel.BodyBehavior.Position = new Vector2(300.0f + difficultyLabel.BodyBehavior.Size.X + 15.0f, 0.0f);
            gameHud.AddChild(helpLabel);

            gameHud.RenderBehavior = new PrimitiveRectangleRenderBehavior(gameHud)
            {
                Color = new Color(0.0f, 0.0f, 0.0f, 0.4f)
            };
            gameHud.BodyBehavior.Position = Vector2.Zero;
            gameHud.BodyBehavior.Size = helpLabel.BodyBehavior.Position + helpLabel.BodyBehavior.Size + new Vector2(5.0f, 2.0f);
        }

        private void setupGameOverHud(LostSoulWorld world)
        {
            gameOverHud = new HudElement(world.Game);
            gameOverHud.Visible = false;
            gameOverHud.BodyBehavior.Size = root.BodyBehavior.Size;
            root.AddChild(gameOverHud);

            setupGameOverTextBackground(world);
            setupGameOverText(world);
            setupGameOverInstructions(world);
            adjustGameOverTextBackgroundSize();
        }

        private void setupGameOverTextBackground(LostSoulWorld world)
        {
            gameOverTextBackground = new HudElement(world.Game);
            var center = gameOverHud.BodyBehavior.Size * 0.5f;
            var size = new Vector2(200.0f, 200.0f);
            gameOverTextBackground.BodyBehavior.Size = size;
            gameOverTextBackground.BodyBehavior.Position = new Vector2(
                center.X - size.X / 2.0f,
{'fraction_non_alphanumeric': 0.08037467895452485, 'fraction_numerical': 0.015410182807070554, 'mean_word_length': 2.272367770637667, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '4011216', 'n_tokens_mistral': 1879, 'n_tokens_neox': 1832, 'n_words': 335}