BLOCKS CONDITION - bloodwiing/BrawlMapGen GitHub Wiki

List of CONDITION Blocks

CONDITION Blocks are solvable. They solve the inputs to yield a boolean output.

These Blocks can be chained however wanted, they always can have their own type as an input along with any other VALUE Block. There are only a few exceptions for blocks.


QUICK NAVIGATION



COMPARATIVE

These types of CONDITION blocks, depending on the actual block, can have any or a few types as the inputs, but both inputs must have matching types, the operators that can be used in these blocks are all comparative, such as EQUALS, LESS, etc.


== (EQUALS)

EQUALS Block

Returns true if both inputs have the same value.

a

ALLOWED TYPES: Any VALUE
Required

The first input.

b

ALLOWED TYPES: Any VALUE
Required

The second input.

EXAMPLE

{
  "type": "==",
  "a": {
    "type": "COLOR",
    "r": 6,
    "g": 6,
    "b": 6
  },
  "b": 6
}

!= (NOT EQUALS)

NOT EQUALS Block

Returns true if both inputs have different values.

a

ALLOWED TYPES: Any VALUE
Required

The first input.

b

ALLOWED TYPES: Any VALUE
Required

The second input.

EXAMPLE

{
  "type": "!=",
  "a": "Apples",
  "b": "Oranges"
}

< (LESS)

LESS Block

Returns true if the value in a is less than the value in b.

a

ALLOWED TYPES: Number, Color, MATH
Required

The first input.

b

ALLOWED TYPES: Number, Color, MATH
Required

The second input.

EXAMPLE

{
  "type": "<",
  "a": 1,
  "b": 9
}

<= (LESS OR EQUALS)

LESS OR EQUALS Block

Returns true if the value in a is less than or equals to the value in b.

a

ALLOWED TYPES: Number, Color, MATH
Required

The first input.

b

ALLOWED TYPES: Number, Color, MATH
Required

The second input.

EXAMPLE

{
  "type": "<=",
  "a": -8,
  "b": -8
}

> (GREATER)

GREATER Block

Returns true if the value in a is greater than the value in b.

a

ALLOWED TYPES: Number, Color, MATH
Required

The first input.

b

ALLOWED TYPES: Number, Color, MATH
Required

The second input.

EXAMPLE

{
  "type": ">",
  "a": 16,
  "b": -2
}

>= (GREATER OR EQUALS)

GREATER OR EQUALS Block

Returns true if the value in a is greater than or equals to the value in b.

a

ALLOWED TYPES: Number, Color, MATH
Required

The first input.

b

ALLOWED TYPES: Number, Color, MATH
Required

The second input.

EXAMPLE

{
  "type": ">=",
  "a": 6,
  "b": 6
}


LOGICAL

These types of CONDITION blocks have 2 boolean inputs, the operators that can be used in these blocks are all logic-based, such as AND, OR, XNOR, etc.


OR

OR Block

Returns true if at least a or b is true.

a

ALLOWED TYPES: Boolean, LOGICAL
Required

The first input.

b

ALLOWED TYPES: Boolean, LOGICAL
Required

The second input.

EXAMPLE

{
  "type": "OR",
  "a": true,
  "b": false
}

NOR

NOT OR Block

Returns true if both a and b are false. Inverted OR Block.

a

ALLOWED TYPES: Boolean, LOGICAL
Required

The first input.

b

ALLOWED TYPES: Boolean, LOGICAL
Required

The second input.

EXAMPLE

{
  "type": "NOR",
  "a": false,
  "b": false
}

AND

AND Block

Returns true if both a and b are true.

a

ALLOWED TYPES: Boolean, LOGICAL
Required

The first input.

b

ALLOWED TYPES: Boolean, LOGICAL
Required

The second input.

EXAMPLE

{
  "type": "AND",
  "a": true,
  "b": true
}

NAND

NOT AND Block

Returns true if at least one a or b is false. Inverted AND Block.

a

ALLOWED TYPES: Boolean, LOGICAL
Required

The first input.

b

ALLOWED TYPES: Boolean, LOGICAL
Required

The second input.

EXAMPLE

{
  "type": "NAND",
  "a": false,
  "b": true
}

XOR

EXCLUSIVE OR Block

Returns true if only a and b is true. In other words: returns true when booleans don't match.

a

ALLOWED TYPES: Boolean, LOGICAL
Required

The first input.

b

ALLOWED TYPES: Boolean, LOGICAL
Required

The second input.

EXAMPLE

{
  "type": "NAND",
  "a": true,
  "b": false
}

XNOR

NOT EXCLUSIVE OR Block

Returns true if none or both a and b are true. In other words: returns true when booleans match. Inverted XOR Block.

a

ALLOWED TYPES: Boolean, LOGICAL
Required

The first input.

b

ALLOWED TYPES: Boolean, LOGICAL
Required

The second input.

EXAMPLE

{
  "type": "NAND",
  "a": false,
  "b": false
}

NOT

NOT Block

Returns true if input is false. Basically inverts the boolean.

input

ALLOWED TYPES: Boolean, LOGICAL
Required

The input of the NOT Block.

EXAMPLE

{
  "type": "NOT",
  "input": false
}
⚠️ **GitHub.com Fallback** ⚠️