public BuildingUI(MapEditorController controller, Building building)
        {
            InitializeComponent();

            this.controller = controller;
            this.building   = building;

            // Initialize Image
            if (building != null)
            {
                // TODO: Register for move events.

                // Get Image
                BitmapManager manager = BitmapManager.Instance;
                this.Image = manager.getBitmap(building.Type);
            }
        }
        public UnitUI(MapEditorController controller, UnitComponent unit)
        {
            InitializeComponent();

            this.controller = controller;
            this.unit       = unit;

            // Initialize Image
            if (unit != null)
            {
                // TODO: Register for move events.

                // Get Image
                BitmapManager manager = BitmapManager.Instance;
                this.Image = manager.getBitmap(unit.Type);
            }
        }
        public BuildingPalette()
        {
            InitializeComponent();
            BuildingFactory uf = BuildingFactory.Instance;

            this.flowLayoutPanel1.SuspendLayout();
            foreach (string type in uf.getBuildingTypes())
            {
                PictureBox buildingBox = new PictureBox();
                buildingBox.Name = type;
                buildingBox.Size = new Size(50, 50);
                BitmapManager manager = BitmapManager.Instance;
                buildingBox.Image    = manager.getBitmap(type);
                buildingBox.SizeMode = PictureBoxSizeMode.StretchImage;
                buildingBox.Margin   = new Padding(1, 1, 1, 1);
                buildingBox.Click   += uiBuildingIcon_Click;
                this.flowLayoutPanel1.Controls.Add(buildingBox);
            }
            this.flowLayoutPanel1.ResumeLayout();
        }
        internal void setPreviewImage(string type)
        {
            BitmapManager manager = BitmapManager.Instance;

            previewBox.Image = manager.getBitmap(type);
        }