public void CureDisease(Diseases disease) { // Find specific disease incumbent InstancedBundle[] bundles = GetDiseaseBundles(); foreach (InstancedBundle bundle in bundles) { // Must have a live effect if (bundle.liveEffects == null || bundle.liveEffects.Count == 0) { continue; } // Must be a disease effect if (!(bundle.liveEffects[0] is DiseaseEffect)) { continue; } // Must be correct type of disease effect DiseaseEffect effect = bundle.liveEffects[0] as DiseaseEffect; if (effect.ClassicDiseaseType == disease) { effect.CureDisease(); Debug.LogFormat("Cured disease {0}", disease); } } }
public async Task <IActionResult> Import(IFormFile fileExcel) { if (ModelState.IsValid) { if (fileExcel != null) { using (var stream = new FileStream(fileExcel.FileName, FileMode.Create)) { await fileExcel.CopyToAsync(stream); using (XLWorkbook workBook = new XLWorkbook(stream, XLEventTracking.Disabled)) { //перегляд усіх листів (в даному випадку категорій) foreach (IXLWorksheet worksheet in workBook.Worksheets) { //worksheet.Name - назва категорії. Пробуємо знайти в БД, якщо відсутня, то створюємо нову Categories newcat; var c = (from cat in _context.Categories where cat.CategoryNaming.Contains(worksheet.Name) select cat).ToList(); if (c.Count > 0) { newcat = c[0]; } else { newcat = new Categories(); newcat.CategoryNaming = worksheet.Name; if (_context.Categories.Where(pr => pr.CategoryNaming == newcat.CategoryNaming).Count() == 0) { //додати в контекст _context.Categories.Add(newcat); } } foreach (IXLRow row in worksheet.RowsUsed().Skip(1)) { try { Diseases disease = new Diseases(); disease.DiseaseNaming = row.Cell(1).Value.ToString(); disease.Category = newcat; if (_context.Diseases.Where(pr => pr.DiseaseNaming == disease.DiseaseNaming).Count() == 0) { _context.Diseases.Add(disease); } } catch (Exception e) { } } } } } } await _context.SaveChangesAsync(); } return(RedirectToAction(nameof(Index))); }
///<summary>The values returned are sent to the webserver.</summary> public static List <Diseasem> GetMultDiseasems(List <long> diseaseNums) { List <Disease> diseaseList = Diseases.GetMultDiseases(diseaseNums); List <Diseasem> diseasemList = ConvertListToM(diseaseList); return(diseasemList); }
public ActionResult AddDisease(Diseases model, int SymptomName) { DB50Entities dbo = new DB50Entities(); Disease disease = new Disease(); disease.SymptomID = SymptomName; disease.Name = model.Name; disease.Detail = model.Detail; dbo.Diseases.Add(disease); dbo.SaveChanges(); DB50Entities db = new DB50Entities(); List <string> SympName = new List <string>(); List <int> SIds = new List <int>(); foreach (Symptom d in db.Symptoms) { if (d.SymptomID != null) { SIds.Add(d.SymptomID); SympName.Add(d.SymptomName); } } ViewBag.SName = SympName; ViewBag.SIds = SIds; return(View("AddDisease")); }
static void Main(string[] args) { GenerateNames = new NameGenerator(@"C:\Users\Jonas Waeber\Documents\Projects\dawn_of_worlds\dawn_of_worlds\dawn_of_worlds\Names\NameSets", 121328); Log = new Logger(@"C:\Users\Jonas Waeber\Documents\Projects\dawn_of_worlds\dawn_of_worlds\dawn_of_worlds\bin\Debug\Output\"); PolityDefinitions.DefinePolities(); Diseases.DefineDiseases(); DefinedRaces.defineRaces(); State = new GameState(); WorldGeneration.BasicWorldGeneration basic_world = new WorldGeneration.BasicWorldGeneration(10002212); basic_world.Initialize(5, 5); State.World = basic_world.World; Generators.DeityGenerator deity_generation = new Generators.DeityGenerator(100202); deity_generation.BasicGeneration(); State.Deities = deity_generation.GeneratedDeities; WorldHistory = new History(); Simulation = new Simulation(); WorldHistory.AddRecord(RecordType.TerrainMap, Map.generateTerrainMap(), Map.printMap); WorldHistory.AddRecord(RecordType.BiomeMap, Map.generateBiomeMap(), Map.printMap); WorldHistory.AddRecord(RecordType.ClimateMap, Map.generateClimateMap(), Map.printMap); Simulation.Run(); Log.CleanOutputDirectory(); Log.StoreInFile(); Console.WriteLine("END OF APPLICATION"); Console.ReadKey(); }
private void DiseasesEdit_Load(object sender, EventArgs e) { int id = int.Parse(lblId.Text); Diseases d = db.Diseases.Find(id); txtDiseaseName.Text = d.Name; }
public unsafe static void CreateDiseaseTable() { //IL_0125: Incompatible stack types: I vs Ref Diseases diseases = Db.Get().Diseases; MemoryStream memoryStream = new MemoryStream(1024); BinaryWriter binaryWriter = new BinaryWriter(memoryStream); binaryWriter.Write(diseases.Count); List <Element> elements = ElementLoader.elements; binaryWriter.Write(elements.Count); for (int i = 0; i < diseases.Count; i++) { Disease disease = diseases[i]; binaryWriter.WriteKleiString(UI.StripLinkFormatting(disease.Name)); binaryWriter.Write(disease.id.GetHashCode()); binaryWriter.Write(disease.strength); disease.temperatureRange.Write(binaryWriter); disease.temperatureHalfLives.Write(binaryWriter); disease.pressureRange.Write(binaryWriter); disease.pressureHalfLives.Write(binaryWriter); for (int j = 0; j < elements.Count; j++) { ElemGrowthInfo elemGrowthInfo = disease.elemGrowthInfo[j]; elemGrowthInfo.Write(binaryWriter); } } byte[] buffer = memoryStream.GetBuffer(); fixed(byte *msg = &((buffer != null && buffer.Length != 0) ? ref buffer[0] : ref *(byte *)null)) { Sim.SIM_HandleMessage(825301935, (int)memoryStream.Length, msg); } }
protected void saveDiseasesButton_Click(object sender, EventArgs e) { Diseases aDiseases = new Diseases(); aDiseases.Name = diseasesNameTextBox.Text; aDiseases.Discription = discriptionTextBox.Text; aDiseases.TreatmentProcedure = treatmentProcedureTextBox.Text; int message = diseasesManager.SaveDiseases(aDiseases); if (message > 0) { messageLabel.Text = "Successfully Saved"; messageLabel.ForeColor = Color.Green; LoadAllDiseases(); } else if (message == 0) { messageLabel.Text = "This Diseases name alresdy saved"; messageLabel.ForeColor = Color.Red; } else { messageLabel.Text = "Saved Failed"; messageLabel.ForeColor = Color.Red; } }
protected void Page_Load(object sender, EventArgs e) { if (!IsPostBack) { Session["FamilyDiseases"] = ""; Session["Diseases"] = ""; checkboxes = new List <CheckBox>() { Heart1, Heart2, Diabetes1, Diabetes2, Asthma1, Asthma2 }; Presenter prs = new Presenter(this); prs.PatientProfile(Application["ID"].ToString()); string[] diseases = Diseases.Split(';'); string[] Fdiseases = FaimilyDiseases.Split(';'); foreach (CheckBox chk in checkboxes) { if (diseases.Contains(chk.ID.Substring(0, chk.ID.Length - 1)) && chk.ID[chk.ID.Length - 1] == '1') { chk.Checked = true; } if (Fdiseases.Contains(chk.ID.Substring(0, chk.ID.Length - 1)) && chk.ID[chk.ID.Length - 1] == '2') { chk.Checked = true; } } } }
public DiseaseShow GetSpecificDisease(int id) { DiseaseShow show; Diseases disease = db.Diseases.FirstOrDefault(c => c.Did == id); if (disease == null) { return(null); } else { var temp = db.DisSymp.Where(c => c.Did == id).Select(c => c.Sid).ToList(); ICollection <Symptoms> symptoms = db.Symptoms.Where(c => temp.Contains(c.Sid)).ToList(); var temp1 = db.DisPrev.Where(c => c.Did == id).Select(c => c.Pid).ToList(); ICollection <Prevention> prevent = db.Prevention.Where(c => temp1.Contains(c.Pid)).ToList(); var temp2 = db.DisRem.Where(c => c.Did == id).Select(c => c.Rid).ToList(); ICollection <Remedies> rem = db.Remedies.Where(c => temp2.Contains(c.Rid)).ToList(); show = new DiseaseShow { disease = disease, symptoms = symptoms, prevention = prevent, remedies = rem }; return(show); } }
public JsonResult Put(Diseases die) { string query = @" update Diseases set Name = '" + die.Name + @"' ,information = '" + die.information + @"' ,PhotoName='" + die.PhotoName + @"' where DiseasesID=" + die.DiseasesID + @" "; DataTable table = new DataTable(); string sqlDataSource = _configuration.GetConnectionString("WellnestAppConn"); SqlDataReader myReader; using (SqlConnection myCon = new SqlConnection(sqlDataSource)) { myCon.Open(); using (SqlCommand myCommand = new SqlCommand(query, myCon)) { myReader = myCommand.ExecuteReader(); table.Load(myReader);; myReader.Close(); myCon.Close(); } return(new JsonResult("Updated Suscccesfully")); } }
public override IQuestAction CreateNew(string source, Quest parentQuest) { // Source must match pattern Match match = Test(source); if (!match.Success) { return(null); } // Get disease type Diseases type = Diseases.None; string name = match.Groups["aDisease"].Value; Table diseasesTable = QuestMachine.Instance.DiseasesTable; if (diseasesTable.HasValue(name)) { type = (Diseases)Parser.ParseInt(diseasesTable.GetValue("id", name)); } else { throw new Exception(string.Format("make pc ill with <aDisease> could not find disease matching '{0}'. See 'Quests-Diseases' table for valid disease names.", name)); } // Factory new action MakePcDiseased action = new MakePcDiseased(parentQuest); action.diseaseType = type; return(action); }
protected DiseaseData GetClassicDiseaseData(Diseases diseaseType) { // Only supports classic diseases, otherwise effect must provide own disease data if (diseaseType == Diseases.None) { return(new DiseaseData()); } // Disease data. Found in FALL.EXE (1.07.213) from offset 0x1C0053. DiseaseData[] diseaseDataSources = { // STR INT WIL AGI END PER SPD LUC HEA FAT SPL MIND MAXD MINS MAXS new DiseaseData(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 10, 0xFF, 0xFF), // Witches' Pox new DiseaseData(1, 0, 1, 1, 1, 1, 1, 1, 1, 1, 1, 3, 30, 0xFF, 0xFF), // Plague new DiseaseData(0, 0, 1, 0, 1, 0, 0, 0, 1, 0, 0, 5, 10, 0xFF, 0xFF), // Yellow Fever new DiseaseData(0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 1, 5, 0xFF, 0xFF), // Stomach Rot new DiseaseData(1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 10, 0xFF, 0xFF), // Consumption new DiseaseData(0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 1, 5, 0xFF, 0xFF), // Brain Fever new DiseaseData(1, 0, 1, 1, 0, 0, 0, 0, 0, 0, 0, 2, 10, 0xFF, 0xFF), // Swamp Rot new DiseaseData(1, 0, 0, 1, 0, 0, 1, 0, 0, 0, 0, 5, 10, 3, 18), // Caliron's Curse new DiseaseData(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 5, 30, 0xFF, 0xFF), // Cholera new DiseaseData(1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 0, 5, 30, 0xFF, 0xFF), // Leprosy new DiseaseData(1, 0, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 4, 0xFF, 0xFF), // Wound Rot new DiseaseData(0, 0, 0, 0, 1, 1, 0, 0, 0, 1, 0, 2, 10, 0xFF, 0xFF), // Red Death new DiseaseData(0, 0, 1, 0, 0, 1, 0, 0, 1, 0, 0, 5, 10, 3, 18), // Blood Rot new DiseaseData(0, 1, 0, 0, 1, 0, 0, 0, 1, 0, 0, 2, 10, 0xFF, 0xFF), // Typhoid Fever new DiseaseData(0, 1, 1, 0, 0, 1, 0, 0, 0, 0, 0, 2, 10, 0xFF, 0xFF), // Dementia new DiseaseData(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 5, 10, 0xFF, 0xFF), // Chrondiasis new DiseaseData(0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 1, 2, 4, 3, 18), // Wizard Fever }; return(diseaseDataSources[(int)diseaseType]); }
public virtual void OnInfected(Diseases disease) { switch (disease) { case Diseases.POOPS: TryPoops(); break; case Diseases.CRACK: case Diseases.MOLASSES: UpdatePlayerSpeed(); break; case Diseases.REVERSED: StartReversed(); break; case Diseases.SWAP: Swap(); break; case Diseases.HYPERSWAP: SwapAll(); break; } }
private void barButtonItem3_ItemClick(object sender, ItemClickEventArgs e) { Diseases diseases = new Diseases(); diseases.MdiParent = this; diseases.Show(); }
public void SaveDiseasesOnDB() { using (var configRepository = new MongoRepository.ConfigRepository()) using (var diseaseRepository = new MongoRepository.DiseaseRepository()) { if (configRepository.selectConfig() == null || LastUpdateDateFromURL > configRepository.selectConfig()?.lastUpdateDateOfDiseasesList) { Console.WriteLine("Update detected!!"); Console.WriteLine("Saving diseases information on DB .."); //We clear the collection diseaseRepository.removeAll(); var lst_diseases = Diseases.ToList(); //We stock the retrieved diseases in DB diseaseRepository.insertList(lst_diseases); //Update update date configRepository.deleteAll(); MongoRepository.entities.Config conf = new MongoRepository.entities.Config(); conf.lastUpdateDateOfDiseasesList = LastUpdateDateFromURL; configRepository.insert(conf); } else { Console.WriteLine("Last update date from DB is: " + configRepository.selectConfig()?.lastUpdateDateOfDiseasesList); Console.WriteLine("No update detected, using offline disease information only"); } } }
public ActionResult DeleteConfirmed(int id) { Diseases diseases = db.Diseaseses.Find(id); db.Diseaseses.Remove(diseases); db.SaveChanges(); return(RedirectToAction("Index")); }
public IActionResult DeleteBreed(int id) { Diseases feed = _repo.Diseases.GetById(id); _repo.Diseases.Delete(id); return(RedirectToAction("Index")); }
private static int UpdateDatabase(string p_doctor, string p_patient, string p_disease, string p_number) { int sent = 0; Diagnoses diagnose; Doctors doctor; Patients patient; Diseases disease; int number = int.Parse(p_number); using (MedicineContext db = new MedicineContext()) { diagnose = db.Diagnoses.Where(d => d.Doctors.fullname == p_doctor && d.Diseases.name == p_disease && d.Patients.fullname == p_patient && d.number == number).FirstOrDefault(); if (diagnose == null) { doctor = db.Doctors.Where(d => d.fullname == p_doctor).FirstOrDefault(); if (doctor == null) { doctor = new Doctors() { id = Guid.NewGuid(), fullname = p_doctor }; sent += SaveToDatabase(doctor); } patient = db.Patients.Where(d => d.fullname == p_patient).FirstOrDefault(); if (patient == null) { patient = new Patients() { id = Guid.NewGuid(), fullname = p_patient }; sent += SaveToDatabase(patient); } disease = db.Diseases.Where(d => d.name == p_disease).FirstOrDefault(); if (disease == null) { disease = new Diseases() { id = Guid.NewGuid(), name = p_disease }; sent += SaveToDatabase(disease); } diagnose = new Diagnoses() { id = Guid.NewGuid(), number = number, patient = patient.id, disease = disease.id, doctor = doctor.id }; sent += SaveToDatabase(diagnose); } } return(sent); }
public override void OnInfected(Diseases disease) { if (m_list != null) { m_list.Add("i:" + disease); } base.OnInfected(disease); }
public override void OnCured(Diseases disease) { if (m_list != null) { m_list.Add("c:" + disease); } base.OnCured(disease); }
private void clearForm() { txtDiseaseName.Text = ""; txtDiseasePercentage.Text = ""; selectedDiseases = null; chkCronic.Checked = false; chkEnabled.Checked = true; btnAddDisease.Text = "Agregar"; }
//function to show disease details using viewmodel public ActionResult Show(int id) { Debug.WriteLine("I am pulling disease with ID:" + id); Diseases disease = db.Diseases.SqlQuery("select * from Diseases where DiseaseID=@DiseaseID", new SqlParameter("@DiseaseID", id)).FirstOrDefault(); ShowDisease viewmodel = new ShowDisease(); viewmodel.Diseases = disease; //returning viewmodel return(View(viewmodel)); }
public override void SetProperties() { Diseases diseaseType = Diseases.WizardFever; properties.Key = GetClassicDiseaseEffectKey(diseaseType); properties.ShowSpellIcon = false; classicDiseaseType = diseaseType; diseaseData = GetClassicDiseaseData(diseaseType); contractedMessageTokens = GetClassicContractedMessageTokens(diseaseType); }
public ActionResult Edit([Bind(Include = "DiseasesId,Name,Description,TreatmentProcedure,PreferdMedicien")] Diseases diseases) { if (ModelState.IsValid) { db.Entry(diseases).State = EntityState.Modified; db.SaveChanges(); return(RedirectToAction("Index")); } return(View(diseases)); }
//deletion function to ask for confirmation whether to delete or not? public ActionResult DeleteConfirm(int id) { Debug.WriteLine("i am asking confirmation of deletion with id " + id); //query to selected all content of a aprticular disease string query = "select * from Diseases where DiseaseID = @id"; SqlParameter param = new SqlParameter("@id", id); Diseases selecteddisease = db.Diseases.SqlQuery(query, param).FirstOrDefault(); //returning selected disease return(View(selecteddisease)); }
public DaggerfallDisease_Deprecated(DiseaseOrPoisonRecord record) { diseaseType = (Diseases)record.ParsedData.ID; if (record.ParsedData.incubationOver == 1) { incubationOver = true; } daysOfSymptomsLeft = (byte)record.ParsedData.daysOfSymptomsLeft; }
public override void RestoreSaveData(object dataIn) { if (dataIn == null) { return; } SaveData_v1 data = (SaveData_v1)dataIn; diseaseType = data.diseaseType; }
public ActionResult Create([Bind(Include = "DiseasesId,Name,Description,TreatmentProcedure,PreferdMedicien")] Diseases diseases) { if (ModelState.IsValid) { db.Diseaseses.Add(diseases); db.SaveChanges(); return(RedirectToAction("Index")); } return(View(diseases)); }
/// <summary> /// Helper to create a classic disease effect bundle. /// </summary> /// <param name="diseaseType">Classic disease type.</param> /// <returns>EntityEffectBundle.</returns> public EntityEffectBundle CreateDisease(Diseases diseaseType) { EffectBundleSettings settings = new EffectBundleSettings() { Version = EntityEffectBroker.CurrentSpellVersion, BundleType = BundleTypes.Disease, Effects = new EffectEntry[] { new EffectEntry(DiseaseEffect.GetClassicDiseaseEffectKey(diseaseType)) }, }; return(new EntityEffectBundle(settings, entityBehaviour)); }
public void AssertNotInfected(Diseases disease) { Assert.IsFalse(IsInfected(disease)); }
public void AssertInfected(Diseases disease) { Assert.IsTrue(IsInfected(disease)); }
public Disease(String name, Diseases type, float duration) { this.m_type = type; this.m_name = name; this.m_duration = duration; }
private bool IsInfected(Diseases disease) { return m_diseases.IsInfected(disease); }
public bool IsInfected(Diseases disease) { int index = ToIndex(disease); return IsInfected(index); }
public bool TryCure(Diseases disease) { int index = ToIndex(disease); return TryCure(index); }
public bool TryInfect(Diseases disease) { int index = ToIndex(disease); return TryInfect(index); }
public static Disease DiseaseForType(Diseases type) { int index = ToIndex(type); return DiseaseForIndex(index); }
public static int ToIndex(Diseases disease) { return (int)disease; }
public virtual void OnCured(Diseases disease) { switch (disease) { case Diseases.CRACK: case Diseases.MOLASSES: UpdatePlayerSpeed(); break; case Diseases.REVERSED: StopReversed(); break; } }
private static String Cured(Diseases disease) { return "c:" + disease; }
private void Init() { diseases = MedicalChestManeger.Instance.Diseases; drugs = MedicalChestManeger.Instance.Drugs; }
/* [TestMethod] public void TestSwap() { } */ /* [TestMethod] public void TestReversed() { } */ private static String Infected(Diseases disease) { return "i:" + disease; }