private void TransportEquipmentListBox_SelectionChanged(object sender, SelectionChangedEventArgs e)
 {
     TextBlock textBlock = (TextBlock)this.transportEquipmentListBox.SelectedItem;
     if (textBlock != null)
     {
         int unitId = 0;
         if (Game.InCampaign)
         {
             unitId = Game.CampaignArmy.Count;
         }
         int equipmentId = (Int32)textBlock.Tag;
         LandTransportUnit landTransportUnit = Game.UnitFactory.CreateLandTransport(unitId, equipmentId, unitToBePurchased.Nation, unitToBePurchased.CoreIndicator, Game.BoardFactory.ActiveTile.TileId);
         transportUnitToBePurchased = landTransportUnit;
         DisplayTransportUnitInformation(landTransportUnit);
     }
 }
 private void DisplayLandTransportUnitInformation(LandTransportUnit landTransportUnit)
 {
     IMotorizedUnit motorizedUnit = (IMotorizedUnit)landTransportUnit;
     SetTransportUnitTextBlock("Fuel", motorizedUnit.Equipment.MaxFuel.ToString());
     SetTransportUnitTextBlock("Movement Range", landTransportUnit.Equipment.BaseMovement.ToString());
     SetTransportUnitTextBlock("Ground Defense", landTransportUnit.Equipment.GroundDefense.ToString());
     SetTransportUnitTextBlock("Air Defense", landTransportUnit.Equipment.AirDefense.ToString());
     SetTransportUnitTextBlock("Sea Defense", landTransportUnit.Equipment.SeaDefense.ToString());
     SetTransportUnitTextBlock("COST", landTransportUnit.Equipment.UnitCost.ToString());
 }
 private void DisplayTransportUnitInformation(LandTransportUnit landTransportUnit)
 {
     AddTransportUnitImageToInformationScreen(landTransportUnit);
     DisplayLandTransportUnitInformation(landTransportUnit);
     transportUnitScrollViewer.Visibility = System.Windows.Visibility.Visible;
     this.purchaseTransportUnitButton.Visibility = System.Windows.Visibility.Visible;
     transportEquipmentListBox.Visibility = System.Windows.Visibility.Collapsed;
 }
        public LandTransportUnit CreateLandTransport(int unitId, int equipmentId, Nation nation, bool coreInd, int startingTileId)
        {
            LandTransportUnit unit = new LandTransportUnit();
            unit.UnitId = unitId;
            unit.Equipment = EquipmentFactory.GetEquipment(equipmentId);
            unit.UnitName = String.Format("{0} {1}", unitId, unit.Equipment.EquipmentDescription);
            unit.CurrentStrength = 10;
            unit.CurrentExperience = 0;
            if (unit.Equipment.MaxFuel == 0)
            {
                unit.CurrentFuel = 99;
            }
            else
            {
                unit.CurrentFuel = unit.Equipment.MaxFuel;
            }
            unit.CoreIndicator = coreInd;
            unit.Nation = nation;
            unit.CanMove = true;
            unit.CurrentTileId = startingTileId;

            return unit;
        }