private string GetTreeName(Guid requirementId) { string treeName = ""; RequirementModel reqModel; string tableName = ""; EnhancementSlotModel slotModel; EnhancementModel enhModel; reqModel = GetRequirementModel(requirementId); tableName = TableNamesModel.GetTableNameFromId(reqModel.TableNamesId); slotModel = new EnhancementSlotModel(); if (tableName == "EnhancementSlot") { slotModel.Initialize(reqModel.ApplytoId); treeName = EnhancementTreeModel.GetNameFromId(slotModel.EnhancementTreeId); } if (tableName == "Enhancement") { enhModel = new EnhancementModel(); enhModel.Initialize(reqModel.ApplytoId); slotModel.Initialize(enhModel.EnhancementSlotId); treeName = EnhancementTreeModel.GetNameFromId(slotModel.EnhancementTreeId); } return(treeName); }
private EnhancementSlotModel GetSlotModel(Guid requirementId) { EnhancementSlotModel slotModel; EnhancementModel enhModel; RequirementModel reqModel; string tableName = ""; slotModel = new EnhancementSlotModel(); reqModel = GetRequirementModel(requirementId); //tableName = TableNamesModel.GetNameFromId(reqModel.Id); tableName = TableNamesModel.GetTableNameFromId(reqModel.TableNamesId); if (tableName == "EnhancementSlot") { slotModel.Initialize(reqModel.ApplytoId); } if (tableName == "Enhancement") { enhModel = new EnhancementModel(); enhModel.Initialize(reqModel.ApplytoId); slotModel.Initialize(enhModel.EnhancementSlotId); } return(slotModel); }
private string BuildRequirementText(Guid requirementId, string requirementComparison, double requirementValue) { string text; string tableName; RequirementModel reqModel; text = ""; //text = RequirementModel.GetNameFromId(requirementId) + " " + requirementComparison + " " + requirementValue.ToString(); reqModel = new RequirementModel(); reqModel.Initialize(requirementId); tableName = TableNamesModel.GetTableNameFromId(reqModel.TableNamesId); if (tableName == "Ability") { text = AbilityModel.GetNameFromId(reqModel.ApplytoId) + " " + requirementComparison + " " + requirementValue.ToString(); } else if (tableName == "Alignments") { text = "Alignment: " + requirementComparison + " " + AlignmentModel.GetNameFromID(reqModel.ApplytoId); } else if (tableName == "Attribute") { text = AttributeModel.GetNameFromId(reqModel.ApplytoId) + " " + requirementComparison + " " + requirementValue.ToString(); } else if (tableName == "Character") { text = "Character " + requirementComparison + " Level " + requirementValue.ToString(); } else if (tableName == "Class") { text = ClassModel.GetNameFromId(reqModel.ApplytoId) + " " + requirementComparison + " Level " + requirementValue.ToString(); } else if (tableName == "Enhancement") { text = "Enhnacement: " + EnhancementModel.GetNameFromId(reqModel.ApplytoId) + " " + requirementComparison + " Rank " + requirementValue.ToString(); } else if (tableName == "EnhancementSlot") { text = "Enhancement Slot: " + BuildSlotName(reqModel.ApplytoId) + " " + requirementComparison + " Rank " + requirementValue.ToString(); } else if (tableName == "Feat") { text = "Feat: " + FeatModel.GetNameFromId(reqModel.ApplytoId); } else if (tableName == "Race") { text = RaceModel.GetNameFromId(reqModel.ApplytoId) + " " + requirementComparison + " Level " + requirementValue.ToString(); } else if (tableName == "Skill") { text = SkillModel.GetNameFromId(reqModel.ApplytoId) + " " + requirementComparison + " " + requirementValue.ToString(); } else { //we should not reach here Debug.WriteLine("Error: No category exists for this requirement. RequirementPanel2: BuildRequirementText()"); } return(text); }
private string GetCategoryName(Guid requirementId) { string name = ""; RequirementModel model; model = new RequirementModel(); model.Initialize(requirementId); name = TableNamesModel.GetTableNameFromId(model.TableNamesId); return(name); }
private string GetCategoryName(Guid modifierId) { string name; ModifierModel model; model = new ModifierModel(); model.Initialize(modifierId); name = TableNamesModel.GetTableNameFromId(model.TableNamesId); return(name); }
private string GetApplyToName(Guid requirementId) { string applyToName; string tableName; RequirementModel reqModel; EnhancementModel enhancementModel; reqModel = GetRequirementModel(requirementId); //tableName = "Class"; tableName = TableNamesModel.GetTableNameFromId(reqModel.TableNamesId); if (tableName == "Ability") { applyToName = AbilityModel.GetNameFromId(reqModel.ApplytoId); } else if (tableName == "Alignments") { applyToName = AlignmentModel.GetNameFromID(reqModel.ApplytoId); } else if (tableName == "Attribute") { applyToName = AttributeModel.GetNameFromId(reqModel.ApplytoId); } else if (tableName == "Character") { applyToName = "Level"; } else if (tableName == "Class") { applyToName = ClassModel.GetNameFromId(reqModel.ApplytoId); } else if (tableName == "Enhancement") { //"Pos " + model.DisplayOrder.ToString() + ":: " + model.Name) enhancementModel = new EnhancementModel(); enhancementModel.Initialize(reqModel.ApplytoId); applyToName = "Pos " + enhancementModel.DisplayOrder + ":: " + enhancementModel.Name; } else if (tableName == "EnhancementSlot") { applyToName = BuildSlotName(GetSlotModel(requirementId)); } else if (tableName == "Feat") { applyToName = FeatModel.GetNameFromId(reqModel.ApplytoId); } else if (tableName == "Race") { applyToName = RaceModel.GetNameFromId(reqModel.ApplytoId); } else if (tableName == "Skill") { applyToName = SkillModel.GetNameFromId(reqModel.ApplytoId); } else { applyToName = ""; } Debug.WriteLine("ApplyToName = " + applyToName); return(applyToName); }