TQL: Difference between revisions

From Tygron Support wiki
Jump to navigation Jump to search
Line 55: Line 55:
|-
|-
| <code>CATEGORY</code>
| <code>CATEGORY</code>
| A building belongs to the specific [[function category | Function category]]  
| A building belongs to the specific [[List_of_actions#Construction_Options | Function category]]  
| Function category
| Function category
| <code>Function category</code>
| <code>Function category</code>
|-
|-
| <code>FUNCTION</code>
| <code>FUNCTION</code>
| A buildings belongs to the specified [[function category | Function category]]  
| A buildings belongs to a specific [[Function]]  
| Function category
| Function ID
| <code>Function category</code>
| <code>SELECT_FLOORSIZE_WHERE_FUNCTION_IS_621</code>
|-
|-
| <code>DIKE</code>
| <code>DIKE</code>
| A buildings belongs to the specified [[function category | Function category]]  
| A building is constructed or planned on top of a particular type of dike [[function category | Function category]]  
| Function category
| Function category
| <code>Function category</code>
| <code>Function category</code>

Revision as of 14:29, 30 June 2015

Please note: This page is currently being updated!

Template:Learned

TQL

The Tygron Query Language is a special-purpose programming language designed for obtaining spacial area information from a specific game session on the Tygron Engine. The primary reason for its development was to make an easy to use bridge between the Tygron Engine and Microsoft Excel.

Queries

The operation used in TQL is the query, which is performed with the declarative SELECT statement. SELECT retrieves data from a running Tygron game session. The SELECT statements have no persistent effects on the game session itself.

Queries allow the user to describe desired data, leaving the Tygron Engine responsible for planning, optimizing, and performing the physical operations necessary to produce that result as it chooses.

A query includes a parameter to include in the final result, immediately following the SELECT keyword. Currently, one of the following result parameters can be chosen:

Result Parameter Description Example
FLOORSIZE Floor size of buildings. SELECT_FLOORSIZE_WHERE_CATEGORY_IS_OFFICES
LOTSIZE Lot size of buildings. SELECT_LOTSIZE_WHERE_CATEGORY_IS_OFFICES
UNITS Amount of housing units. SELECT_UNITS_WHERE_CATEGORY_IS_SOCIAL
DIKES Surface space of constructed dikes or levees. SELECT_DIKES_WHERE_ZONE_IS_1

Comparison Predicate and Clauses

The SELECT and result parameter are followed by the WHERE statement. The WHERE statements includes a comparison predicate, which restricts the information taken into account by the query. The WHERE clause eliminates all information from the result set where the comparison predicate does not evaluate to True.

The comparison predicate consists of 0 or more clauses. Clauses consists of three parts;

  • Clause Type
  • Operator
  • Value

The clause types and expected values currently supported are:

Clause Type Description Value Type Example
CATEGORY A building belongs to the specific Function category Function category Function category
FUNCTION A buildings belongs to a specific Function Function ID SELECT_FLOORSIZE_WHERE_FUNCTION_IS_621
DIKE A building is constructed or planned on top of a particular type of dike Function category Function category Function category
MAP A building is present in the specified map or view. Also see Game Mode Function category Function category
STAKEHOLDER A building belongs to a specific Stakeholder Stakeholder ID SELECT_DIKES_WHERE_STAKEHOLDER_IS_3
MAP A buildings belongs to the specified Function category Function category Function category
MAP A buildings belongs to the specified Function category Function category Function category
MAP A buildings belongs to the specified Function category Function category Function category


Operators

TQL clausses currently support the following Operators:

Operator Description Example
IS Equal to CATEGORY_IS_OFFICES