Libraries.Interface.Controls.Scenes.Blueprints.ItemBlueprintComparison Documentation

The ItemBlueprintComparison class is used to compare two ItemBlueprint objects and determine if they are equal or if one if considered larger. ItemBlueprints are compared based on their names so it is similar to comparing to text objects. This Comparison is mainly used to sort blueprints.

Inherits from: Libraries.Containers.Support.Comparison, Libraries.Language.Object

Actions Documentation

Compare(number a, number b)

This action provides a way to compare two objects. The returned values from its sole action is an integer with the value of -1 (the left item is smaller), 0 (the items are equal) or 1 (the left item is larger).It can be used to override the standard comparison in Object for various applications (e.g., sorting).

Parameters

  • number a
  • number b

Return

integer:

Compare(integer a, integer b)

This action provides a way to compare two objects. The returned values from its sole action is an integer with the value of -1 (the left item is smaller), 0 (the items are equal) or 1 (the left item is larger).It can be used to override the standard comparison in Object for various applications (e.g., sorting).

Parameters

  • integer a
  • integer b

Return

integer:

Compare(Libraries.Language.Object a, Libraries.Language.Object b)

This action provides a way to compare two objects. The returned values from its sole action is an integer with the value of -1 (the left item is smaller), 0 (the items are equal) or 1 (the left item is larger).It can be used to override the standard comparison in Object for various applications (e.g., sorting). For the ItemBlueprint class this action is used for when an Item Blueprint is compared to another ItemBlueprint. When two ItemBlueprints are compared they are compared using their names. If any of their names are undefined then they are assumed to be equal.

Parameters

Return

integer:

Compare(Libraries.Language.Object object)

This action compares two object hash codes and returns an integer. The result is larger if this hash code is larger than the object passed as a parameter, smaller, or equal. In this case, -1 means smaller, 0 means equal, and 1 means larger. This action was changed in Quorum 7 to return an integer, instead of a CompareResult object, because the previous implementation was causing efficiency issues.

Parameters

Return

integer: The Compare result, Smaller, Equal, or Larger.

Example

Object o
Object t
integer result = o:Compare(t) //1 (larger), 0 (equal), or -1 (smaller)

Compare(boolean a, boolean b)

This action provides a way to compare two objects. The returned values from its sole action is an integer with the value of -1 (the left item is smaller), 0 (the items are equal) or 1 (the left item is larger).It can be used to override the standard comparison in Object for various applications (e.g., sorting). In the case of booleans, by default, false is considered less than true.

Parameters

  • boolean a
  • boolean b

Return

integer:

Equals(Libraries.Language.Object object)

This action determines if two objects are equal based on their hash code values.

Parameters

Return

boolean: True if the hash codes are equal and false if they are not equal.

Example

use Libraries.Language.Object
use Libraries.Language.Types.Text
Object o
Text t
boolean result = o:Equals(t)

GetHashCode()

This action gets the hash code for an object.

Return

integer: The integer hash code of the object.

Example

Object o
integer hash = o:GetHashCode()