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

namespace SpaceInvaders
{
    public class DropMisil
    {
        int intHMonsterMisil;
        int intVMonsterMisil;

        string strMonsterMisil = "v";
        
        public int PblintHMonsterMisil { get => intHMonsterMisil; set => intHMonsterMisil = value; }
        public int PblintVMonsterMisil { get => intVMonsterMisil; set => intVMonsterMisil = value; }
        /// <summary>
        /// Position du misile
        /// </summary>
        /// <param name="inthPosition"></param>
        /// <param name="intvPosition"></param>
        public DropMisil(int inthPosition, int intvPosition)
        {
            PblintHMonsterMisil = inthPosition;
            PblintVMonsterMisil = intvPosition;
        }
        /// <summary>
        /// Attack du misile
        /// </summary>
        /// <returns></returns>
        public bool MonsterAttack()
        {
            
            SuperConsole.WriteAtPosition(PblintHMonsterMisil, PblintVMonsterMisil," ");       
            PblintVMonsterMisil++;

            if (PblintVMonsterMisil < Console.WindowHeight)
            {     
                SuperConsole.WriteAtPosition(PblintHMonsterMisil, PblintVMonsterMisil, strMonsterMisil);          
                return false; 
            }
            else
            {              
                return true; 
            }
        }
    }
}
