Type function
Library wattageTileEngine.LineOfSightModel.*
Return value LineOfSightModel
See also  


This function creates a new instance of LineOfSightModel.

Syntax params )
params (required)

Table. Contains all required inputs. See Required Properties below.

Required Properties

The params table contains the following properties:

radius (required)

Number. Maximum radius of the line of sight.

isTransparent (required)

function. Callback which returns true if the tile is transparent. The callback must have the following signature:

boolean function(column, row)


local TileEngine = require "plugin.wattageTileEngine"

-- Callback to indicate whether line of sight can pass through tile
local function isTransparent(column, row)
    -- Make an opaque wall along column 5
    return column ~= 5

local lineOfSightModel ={
    radius = 15,
    isTransparent = isTransparent