﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Runtime.CompilerServices;
using System.Text;
using System.Threading.Tasks;

namespace CSharp_01_DataTypes
{
    public class BasicDataTypes
    {
        /// <summary>
        /// Class representing Basic Data Types
        /// 
        /// ➡️ Variable Naming Convention: PascalCase (Other convention: snake_case, camelCase, kebab-case) 
        /// 
        /// </summary>


        // Simple Data Types Covered
        public bool TreasureChestOpen = true;
        public int PlayerHealth = 53045;
        public float PlayerCurrency = 3405.5F;
        public double PlayerDistance = 6560.5454150D;
        public decimal WorldTwoDistance = 54050.0540854512M;

        // Private variables names are usually in camelCase and with an _underscore at the beginning
        private char _studentGrade = 'B';
        private string _welcomeMessage = "Hello World \n";
        private const int _MAX_SPEED = 150;


        public BasicDataTypes()
        {
            // Simple Data Types Examples
            int PlayerHealth = 100;

            float VehicleSpeed = 0.0F;
            float VehicleSpeedMax = 150.0F;
        }

        public void StringDataType(bool PrintingStringOperations = false)
        {
            string TreasureChestContent = "gold bars";

            // ✪ Interpolated String ✪
            string InterpolatedString = $"Player has received {TreasureChestContent} from the treasure chest!";

            // ✪ Verbatim String Literal ✪
            // Ignores escape sequences, hexadecimal escape sequences and Unicode escape sequences. The "quote" isn't ignore, though
            string VerbatimString = @"Hello \n";

            if (PrintingStringOperations)
            {
                // String Concatenation
                string GameMessageOne = "Game";
                string GameMessageTwo = "Over";
                string GameConcat = GameMessageOne + " " + GameMessageTwo;
                Console.WriteLine(GameConcat);

                // String Builder (with a loop )
                StringBuilder GameString = new StringBuilder();
                for (int i = 0; i < 10; i++)
                {
                    GameString.Append("String #" + i);
                }
                string GameStringResult = GameString.ToString();

                Console.WriteLine(GameStringResult);

            }

        }

    }


    /// <summary>
    /// Data Structures
    /// 
    /// </summary>
    public class DataStructure
    {

        IDictionary<string, string> PlayableCharacters = new Dictionary<string, string>();
        

        public DataStructure ()
        {
            // 
            PlayableCharacters.Add("Jonesy", "Fighter"); 
        }

    }

}
