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

namespace PlantDemo
{
    public class PlantShower : EntityShower
    {
        static string[] bmpPaths = { "images/wdss.png", "images/wdss2.png", "images/wdss3.png", "images/hbss.png", "images/xmg.png", "images/pmg.png" };
        static BitmapImage[] bmps;
        public static BitmapImage[] Bitmaps
        {
            get { return bmps; }
        }

        static PlantShower()
        {
            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 Plant Plant
        {
            get { return Entity as Plant; }
        }

        public PlantShower(Plant plant, string bmpPath)
            : base(plant)
        {
            int k = Array.IndexOf(bmpPaths, bmpPath);
            if (k >= 0)
                Shower = new Image { Source = Bitmaps[k], Width = plant.Width, Height = plant.Height };
            else
                Shower = new Image() { Source = new BitmapImage(new Uri(bmpPath, UriKind.Relative)), Width = plant.Width, Height = plant.Height };
        }
    }


    public class PlWDSSShower : PlantShower
    {
        public PlWDSSShower(PlWDSS plant)
            : base(plant, "images/wdss.png")
        { }
    }

    public class PlWDSS2Shower : PlantShower
    {
        public PlWDSS2Shower(PlWDSS2 plant)
            : base(plant, "images/wdss2.png")
        { }
    }

    public class PlWDSS3Shower : PlantShower
    {
        public PlWDSS3Shower(PlWDSS3 plant)
            : base(plant, "images/wdss3.png")
        { }
    }

    public class PlHBSSShower : PlantShower
    {
        public PlHBSSShower(PlHBSS plant)
            : base(plant, "images/hbss.png")
        { }
    }

    public class PlXMGShower : PlantShower
    {
        public PlXMGShower(PlXMG plant)
            : base(plant, "images/xmg.png")
        { }
    }

    public class PlPMGShower : PlantShower
    {
        public PlPMGShower(PlPMG plant)
            : base(plant, "images/pmg.png")
        { }
    }
}
