/// <summary>
        /// Update Stat panel and activate command panel for selected units
        /// </summary>
        /// <param name="holder"></param>
        /// <param name="e"></param>
        private void updateStatAndCommandPanels(SameSizeChildrenFlowLayout holder, SelectionStateChangedArgs e)
        {
            int count = e.SelectedEntities.Count;
            if (count > 0)
            {
                BuildLargePreviewPictureBoxVisitor visitor = new BuildLargePreviewPictureBoxVisitor();

                if (e.SelectedEntities[0] is UnitComponent)
                {
                    showUnitStatAndCommand(holder, e, visitor);
                } // unit
                else if (e.SelectedEntities[0] is Building)
                {
                    Building y = (Building)e.SelectedEntities[0];
                    commandBar.activateProduceUnitButtons(y.Type);
                }
            }
            else
            {
                commandBar.disableButtons();

            }
        }
        /// <summary>
        /// Show player's selected units stat and activate command for the units
        /// </summary>
        /// <param name="holder"></param>
        /// <param name="e"></param>
        private void showUnitStatAndCommand(SameSizeChildrenFlowLayout holder, SelectionStateChangedArgs e, BuildLargePreviewPictureBoxVisitor visitor)
        {
            int count = e.SelectedEntities.Count;
            // Only non-zombie stat being displayed
            if (!((UnitComponent)e.SelectedEntities[0]).IsZombie)
            {
                // Individual unit
                if (count == 1 && holder != null)
                {
                    // Use the holder to show unit stats.
                    DisplaySelectedEntityStatsVisitor visitor2 = new DisplaySelectedEntityStatsVisitor();
                    visitor2.Game = (XnaUITestGame)Game;
                    visitor2.Layout = holder;
                    e.SelectedEntities[0].Accept(visitor2);
                }

                e.SelectedEntities[0].Accept(visitor);
                PictureBox bigImage = visitor.PictureBox;

                bigImage.DrawBox = new Rectangle(25, 25, 150, 150);
                AddChild(bigImage);

                bool containsNonBuilders = true;
                for (int i = 0; i < e.SelectedEntities.Count; i++)
                {
                    if (!((UnitComponent)e.SelectedEntities[0]).CanBuild)
                    {
                        containsNonBuilders = false;
                        break;
                    }
                }
                commandBar.activateButtons(containsNonBuilders);  // show commandView if selected

            } // only non zombie
        }