using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;

using SFML.System;
using SFML.Window;
using SFML.Graphics;

namespace TreasureHunt
{
    class Treasure : Entity
    {
        RectangleShape Rect;
        public Vector2i Position;

        public Treasure()
        {
            Rect = new RectangleShape();

            Rect.FillColor = new Color(192, 192, 64);
            Rect.OutlineColor = new Color(0, 0, 0, 16);
            Rect.OutlineThickness = -0.5f;

            Rect.Size = new Vector2f(
                Constants.TileSize,
                Constants.TileSize);

            Position = new Vector2i(
                (int)((Globals.Random.NextDouble() * Constants.WindowWidth) / Constants.TileSize),
                (int)((Globals.Random.NextDouble() * Constants.WindowHeight) / Constants.TileSize));

            Console.WriteLine("Treasure {0}", Position);
        }

        public override void Update()
        {
        }

        public override void Draw()
        {
            Rect.Position = new Vector2f(
                Position.X * Constants.TileSize,
                Position.Y * Constants.TileSize);

            World.RenderTarget.Draw(Rect);
        }
    }
}
