Skip to content

Scratch

Hyomoto edited this page Oct 12, 2020 · 10 revisions
Jump To Go Back Arguments Methods Variables

Pair( a, b )

A simple garbage-collected pair of values.

var _pair = new Pair( "Hello", "World!" )

show_debug_message( _pair.a + _pair.b );

Arguments

Name Type Purpose
a any The value of a
b any The value of b

Methods

Jump To top equals is

equals( pair )

Returns: N/A (undefined)

Name Type Purpose
pair Pair The Pair to compare to this one

This method can also be provided another Vec2 for purposes of comparison. This is a strict comparison of the internal values, testing a Pair against itself will return true, but does not test if the Vec2 structures are the same one.


equals( a, b )

Returns: N/A (undefined)

Name Type Purpose
a any The value to compare a to
b any The value to compare b to

This method is used to compare two values against this pair to see if they match. This is a strict comparison, thus it will only return true if both a and b match the provided arguments.


is( type )

Returns: boolean (true or false)

Name Type Purpose
type struct id The structure type to compare this against.

Returns true if the provided type is Pair.


Variables

Jump To top
  • a - the a value
  • b - the b value
Clone this wiki locally