public RequirementsSetViewModel(RequirementsSetModel requirements) : this() { foreach (RequirementModelBase requirement in requirements.Requirements) { if (requirement is RoleRequirementModel) { this.Role = new RoleRequirementViewModel((RoleRequirementModel)requirement); } else if (requirement is CooldownRequirementModel) { this.Cooldown = new CooldownRequirementViewModel((CooldownRequirementModel)requirement); } else if (requirement is CurrencyRequirementModel) { this.Currency.Add((CurrencyRequirementModel)requirement); } else if (requirement is RankRequirementModel) { this.Rank.Add((RankRequirementModel)requirement); } else if (requirement is InventoryRequirementModel) { this.Inventory.Add((InventoryRequirementModel)requirement); } else if (requirement is ThresholdRequirementModel) { this.Threshold = new ThresholdRequirementViewModel((ThresholdRequirementModel)requirement); } else if (requirement is SettingsRequirementModel) { this.Settings = new SettingsRequirementViewModel((SettingsRequirementModel)requirement); } } }
public RequirementsSetModel GetRequirements() { RequirementsSetModel requirements = new RequirementsSetModel(); foreach (RequirementViewModelBase requirement in this.Requirements) { requirements.Requirements.Add(requirement.GetRequirement()); } return(requirements); }