﻿using GeneticCreatures.Classes.UtilityClasses;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using Tester.classes;

namespace GeneticCreatures.Classes.Objects.InanimateObjects
{
    class Wall : Selectable
    {
        public Wall(Position pos)
            : base(pos, defaultColour)
        {
            allWalls.Add(this);
        }
        public Wall(Position pos, Colour col)
            : base(pos, col)
        {
            allWalls.Add(this);
        }

        public static List<Wall> allWalls = new List<Wall>();
        private static Colour defaultColour = new Colour(100, 100, 100);


        private static Colour selectedColour = Colour.White;
        public override void Draw()
        {
            if (GameState.GetState() != GameStates.CreatingNet)
            {
                Colour chosenCol = colour;
                if (this.isSelected)
                    chosenCol = selectedColour;
                ShapeDrawer.DrawCircle(position.Location, DrawRadius, chosenCol);
            }
        }

        protected override void DestroyWorldObject()
        {
            allWalls.Remove(this);
            base.DestroyWorldObject();
        }
    }
}
