Show / Hide Table of Contents

Class Validator

Validates the configuration of objects.

Inheritance
System.Object
Validator
Namespace: BlueprintCore.Utils
Assembly: BlueprintCore.dll
Syntax
public class Validator
Remarks

Any API implemented in BlueprintCore calls this for all relevant object types. If you instantiate objects outside of BlueprintCore you can call Check(Object) to get validation warnings.

Constructors

| Improve this Doc View Source

Validator(String, String)

Creates a Validator for an object. The name and type name are used to generate the error string.

Declaration
public Validator(string name, string typeName)
Parameters
Type Name Description
System.String name
System.String typeName

Methods

| Improve this Doc View Source

Check(Object)

Validates the given object

Declaration
public void Check(object obj)
Parameters
Type Name Description
System.Object obj
Remarks

Uses a combination of Wrath validation logic and custom logic validating that implicit object constraints are met. The exact validation run varies by type.

  • Kingmaker.ElementsSystem.Element typesVerifies that Kingmaker.ElementsSystem.Element.name is set.
  • Kingmaker.Blueprints.BlueprintComponent typesKingmaker.Blueprints.BlueprintComponent.ApplyValidation(Owlcat.QA.Validation.ValidationContext, System.Int32)
  • Owlcat.QA.Validation.IValidated typesOwlcat.QA.Validation.IValidated.Validate(Owlcat.QA.Validation.ValidationContext,System.Int32)
There are some special cases as well, such as Kingmaker.Designers.EventConditionActionSystem.Actions.DealStatDamage.

Note that you can call this method multiple time for a given Validator instance. All of the errors will be bundled into a single error string. This is useful when constructing a several related objects. For example, a single BlueprintConfigurator instance stores a single Validator which is used to validate all of its fields, components, actions, and conditions.

| Improve this Doc View Source

GetErrorString()

Returns a string listing each validation error on a separate line, or an empty string if there are no errors.

Declaration
public string GetErrorString()
Returns
Type Description
System.String
| Improve this Doc View Source

HasErrors()

Declaration
public bool HasErrors()
Returns
Type Description
System.Boolean
  • Improve this Doc
  • View Source
In This Article
Back to top Generated by DocFX