예제 #1
0
        public void ChangeFraction(int missionId, int fractionId)
        {
            var mission = _missionRepository.GetMissionDetails(missionId);

            mission.FractionId = fractionId;
            mission.Fraction   = _fractionRepository.GetFractionDetails(fractionId);
            _missionRepository.UpdateMission(mission);
        }
예제 #2
0
 public void ShowInfo(int missionId)
 {
     planetTextBox.Text   = "Planet: " + planetsListBox.SelectedItem.ToString();
     missionTextBox.Text  = "Mission: " + missionsListBox.SelectedItem.ToString();
     typeTextBox.Text     = "Type: " + missionRepo.GetMissionDetails(missionId).MissionType.Type;
     levelTextBox.Text    = "Level: " + missionRepo.GetMissionDetails(missionId).MissionLevel.ToString();
     fractionTextBox.Text = "Fraction: " + missionRepo.GetMissionDetails(missionId).Fraction.FractionName;
     resourceTextBox.Text = "Resource: " + resourcesListBox.SelectedItem.ToString();
     resourceRepo.GetAllResources().ForEach(r =>
     {
         if (r.ResourceName == resourcesListBox.SelectedItem.ToString())
         {
             dropChanceTextBox.Text = "DropChanse: " + r.DropChance;
         }
     });
 }
예제 #3
0
        public void AddMission(int planetId, int missionId)
        {
            var  planet = _planetRepository.GetPlanetDetails(planetId);
            bool canAdd = true;

            planet.Missions.ForEach(m =>
            {
                if (m.Id == missionId)
                {
                    canAdd = false;
                }
            });
            if (canAdd)
            {
                var mission = _missionRepository.GetMissionDetails(missionId);
                planet.Missions.Add(mission);
                mission.Planet = planet;
                _planetRepository.UpdatePlanet(planet);
                _missionRepository.UpdateMission(mission);
            }
        }