using System;
using System.Collections.Generic;
using System.Windows.Controls;
using System.Windows.Media.Imaging;

namespace PlantDemo
{
    public abstract class BulletShower : EntityShower
    {
        static string[] bmpPaths = { "images/bWD.gif", "images/bBWD.gif", "images/bXQP.png", "images/bQP.png" };
        static BitmapImage[] bmps;
        public static BitmapImage[] Bitmaps
        {
            get { return bmps; }
        }

        static BulletShower()
        {
            bmps = new BitmapImage[bmpPaths.Length];
            for (int i = 0; i < bmpPaths.Length; i++)
                bmps[i] = new BitmapImage(new Uri(bmpPaths[i], UriKind.Relative));
        }

        public Image Image
        {
            get { return base.Shower as Image; }
        }

        public Bullet Bullet
        {
            get { return Entity as Bullet; }
        }

        public BulletShower(Bullet bullet)
            : base(bullet)
        { }
    }

    public class BulWDShower : BulletShower
    {
        public BulWDShower(Bullet bullet)
            : base(bullet)
        {
            Shower = new Image() { Source = Bitmaps[0] };
            Canvas.SetLeft(Shower, bullet.X);
            Canvas.SetTop(Shower, bullet.Y);
        }
    }

    public class BulBWDShower : BulletShower
    {
        public BulBWDShower(Bullet bullet)
            : base(bullet)
        {
            Shower = new Image() { Source = Bitmaps[1] };
            Canvas.SetLeft(Shower, bullet.X);
            Canvas.SetTop(Shower, bullet.Y);
        }
    }

    public class BulXQPShower : BulletShower
    {
        public BulXQPShower(Bullet bullet)
            : base(bullet)
        {
            Shower = new Image() { Source = Bitmaps[2] };
            Canvas.SetLeft(Shower, bullet.X);
            Canvas.SetTop(Shower, bullet.Y);
        }
    }

    public class BulQPShower : BulletShower
    {
        public BulQPShower(Bullet bullet)
            : base(bullet)
        {
            Shower = new Image() { Source = Bitmaps[3] };
            Canvas.SetLeft(Shower, bullet.X);
            Canvas.SetTop(Shower, bullet.Y);
        }
    }
}
