Categories > Board > rex_matcher

Introduction

Pick tiles which match the pattern on board object.

Links


Categories > Board > rex_matcherIntroductionLinksDependenceUsagePrepareConceptSymbolReserve symbolWild card symbolPattern1-d pattern2-d patternGet matched tilesUpdate symbol tableAxis of square board

Dependence

Usage

Prepare

This plugin picks matched tiles into a group. therefor rex_board and rex_ginstgroup objects should be put into project first.

Concept

Symbol

Each tile has a symbol indicated by a word, like 1, or null, stored in the symbol table.

Reserve symbol

, is a reserved symbol of delimiter.

Wild card symbol

Wild card symbol will not be compared, and returns matched directly.

Set wildcard symbol in Wildcard property, or Action:Set Wildcard. (Sample capx)

Pattern

1-d pattern

A pattern is a sequence of symbols, it could be one-dimension, like 111. Or separated by , like 1,1,1.

2-d pattern

The pattern also could be two-dimensions represented by csv format, for example

1,1,1
,1,

This pattern is composed of four "1" symbols within "T" shaped.

Get matched tiles

NoYes+Condition:For each 1d pattern+Condition:For each N symbols....Updating symbol table?Scan symbol table----For each matched tiles,Pick tiles into group, andtrigger sub-eventGet symbol of each tile----+Condition:On get symbolTile Expression:TileUIDat (Expression:TileX, Expression:TileY)-Action:Set symbol

Get symbol of a tile

+Condition:On get symbolTile Expression:TileUIDat (Expression:TileX, Expression:TileY)-Action:Set symbol

Sample capx

Steps of picking matched tiles

  1. the matching procedure starts by these conditions

    • 1d pattern

      • Condition:For each 1d pattern,

      • Condition:For each N symbols

        • Expression:MatchedSymbol, to get matched symbol
      • Condition:Any 1d pattern, to pick first matched pattern

      • Condition:Any N symbols, to pick first matched pattern

        • Expression:MatchedSymbol, to get matched symbol
    • 2d pattern

      • Condition:For each 2D pattern,

      • Condition:For each 2D template pattern

        • Expression:MatchedSymbol, to get matched symbol
      • Condition:Any 2D pattern, to pick first matched pattern

      • Condition:Any 2D template pattern, to pick first matched pattern

        • Expression:MatchedSymbol, to get matched symbol
  2. updating symbol table for each tile if property Update symbols is set to Auto

    • Condition:On get symbol,
    • to get symbol on a tile Expression:TileUIDat (Expression:TileX, Expression:TileY, 0)
    • return symbol by Action:Set symbol.
  3. picking each matched tiles into instance group, and trigger sub event.

Condition:No pattern returns true if no matched found in last picking condition.

Update symbol table

Symbol table will be updated when

These actions only updates symbol of a tile

Axis of square board

There are three axis for 1d pattern of square board, enable them in properties table or actions