using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Microsoft.Xna.Framework.Graphics;
using Microsoft.Xna.Framework.Input;
using Microsoft.Xna.Framework;

namespace Slayter
{
    public class Screen:ScreenOrigin
    {
        protected Text moves;
        protected Text gold;
        protected Text time;

        public Hero hero;
        public virtual Background BGROUND{get; set;}
        protected Player player;

        public Screen(Game1 game)
            :base(game)
        {
            LoadConstantElements(game);
        }

        private void LoadConstantElements(Game1 game)
        {
            
        }

        public virtual void AddPlayer(Player player)
        {
            this.player = player;
            hero = player.currentHero;
            drawables.Add(player);
            //drawables.Add(moves);
            //drawables.Add(gold);
            //drawables.Add(time);
            UpdateText();
        }

        public void changePlayer(Player p)
        {
            player = p;
            changeHero(p.currentHero);
        }

        public virtual void changeHero(Hero h)
        {
            hero = h;
        }

        public void UpdateText()
        {
            if(moves!=null)
                moves.label = "M: " + player.currentHero.leftForTheDay;
            if(gold!=null)
                gold.label = "G: " + player.gold;
            if(time!=null)
                time.label = "D: " + player.time.Day + " " + "W: " + player.time.Week;
        }

    }
}
