public void ChangeFraction(int missionId, int fractionId) { var mission = _missionRepository.GetMissionDetails(missionId); mission.FractionId = fractionId; mission.Fraction = _fractionRepository.GetFractionDetails(fractionId); _missionRepository.UpdateMission(mission); }
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; } }); }
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); } }