using System;
using System.Collections.Generic;

namespace PlantDemo
{
    public class Zombie : LivingEntity
    {
        bool bFrozen;
        int frozenStep;
        public bool IsFrozen
        {
            get { return bFrozen; }
            set
            {
                VX *= 0.75;
                bFrozen = true;
                frozenStep = Steps;
                if (OnFrozen != null)
                    OnFrozen(this, null);
            }
        }

        public event EventHandler OnFrozen;
        public event EventHandler OnUnfrozen;

        public Zombie()
        {
            Width = Height = 64;
            VX = -10;
            heathPoint = 100;
        }

        public override void Move()
        {
            base.Move();
            if (bFrozen && Steps >= frozenStep + 10)
            {
                bFrozen = false;
                VX = (VX * 4 / 3);
                if (OnUnfrozen != null)
                    OnUnfrozen(this, null);
            }
        }

        public virtual ZombieShower CreateShower()
        {
            return new ZombieShower(this);
        }
    }

    public class BucketZombie : Zombie
    {

    }

    public class WireZombie : Zombie
    {
        public override ZombieShower CreateShower()
        {
            return new WireZombieShower(this);
        }

    }
}
