网格
12 个节点
本页内容 12
统计格子
函数How many cells hold a value.
统计格子(网格: Value Grid, 值: 整数) -> 整数
int CountCells(ValueGrid grid, int value)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 值 | 整数 | — | The value. |
返回
| 数量 | 整数 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
查找格子
函数The cells holding a value, row by row from the top.
查找格子 -> (数量: 整数, 列: 整数数组, 行: 整数数组)
网格: Value Grid
值: 整数int FindCells(
ValueGrid grid,
int value,
out int[] xs,
out int[] ys)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 值 | 整数 | — | The value. |
返回
| 数量 | 整数 |
| 列 | 整数数组 |
| 行 | 整数数组 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
查找网格路径
函数The cheapest path between two cells, moving four ways through cells holding the open value; the two ends may hold anything. Steps and turns each cost what they are given, a turn limit can be set, and a margin lets the path run round the outside of the grid. The corners are the start, each turn and the end - enough to draw the path as straight lines - and may lie in the margin.
查找网格路径 -> (找到: 真否, 拐点列: 整数数组, 拐点行: 整数数组, 拐弯数: 整数)
网格: Value Grid
起点列: 整数
起点行: 整数
终点列: 整数
终点行: 整数
可通行值: 整数
外围格数: 整数
每步代价: 整数
拐弯代价: 整数
最多拐弯数: 整数bool FindPath(
ValueGrid grid,
int fromX,
int fromY,
int toX,
int toY,
out int[] xs,
out int[] ys,
out int turns,
int open = 0,
int margin = 0,
int stepCost = 1,
int turnCost = 0,
int maxTurns = -1)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 起点列 | 整数 | — | Start column. |
| 起点行 | 整数 | — | Start row. |
| 终点列 | 整数 | — | End column. |
| 终点行 | 整数 | — | End row. |
| 可通行值 | 整数 | 0 | The value of a cell the path may cross. |
| 外围格数 | 整数 | 0 | How many cells beyond each edge the path may use. |
| 每步代价 | 整数 | 1 | What each step costs. |
| 拐弯代价 | 整数 | 0 | What each turn costs. |
| 最多拐弯数 | 整数 | -1 | The most turns allowed; -1 for no limit. |
返回
| 找到 | 真否 |
| 拐点列 | 整数数组 |
| 拐点行 | 整数数组 |
| 拐弯数 | 整数 |
备注
With the defaults it is the shortest walk. A tile-matching link - straight runs through empty cells with at most two turns, round the outside if need be - is open 0, margin 1, step cost 0, turn cost 1, max turns 2.
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
由数值生成网格
函数A grid holding the given values, row by row from the top.
由数值生成网格 -> Value Grid
宽度: 整数
高度: 整数
数值: 整数数组ValueGrid FromValues(int width, int height, int[] values)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 宽度 | 整数 | — | Cells across. |
| 高度 | 整数 | — | Cells down. |
| 数值 | 整数数组 | — | Width × height of them. |
返回
| 网格 | Value Grid |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
读取格子
函数What a cell holds; the grid's outside value for a cell beyond it.
读取格子(网格: Value Grid, 列: 整数, 行: 整数) -> 整数
int GetCell(ValueGrid grid, int x, int y)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 列 | 整数 | — | Column. |
| 行 | 整数 | — | Row. |
返回
| 值 | 整数 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
创建网格
函数A grid with every cell holding one value.
创建网格(宽度: 整数, 高度: 整数, 填充值: 整数) -> Value Grid
ValueGrid Make(int width = 8, int height = 8, int fill = 0)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 宽度 | 整数 | 8 | Cells across. |
| 高度 | 整数 | 8 | Cells down. |
| 填充值 | 整数 | 0 | What every cell holds. |
返回
| 网格 | Value Grid |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
相邻格子配对
函数As many pairs of side-by-side cells holding a value as can be made with no cell used twice: a tiling by dominoes. The nth pair is (first xs, first ys) and (second xs, second ys) at n.
相邻格子配对 -> (对数: 整数, 第一格列: 整数数组, 第一格行: 整数数组, 第二格列: 整数数组, 第二格行: 整数数组)
网格: Value Grid
值: 整数
种子: 整数int PairNeighbours(
ValueGrid grid,
int value,
out int[] firstXs,
out int[] firstYs,
out int[] secondXs,
out int[] secondYs,
int seed = 0)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 值 | 整数 | — | Which cells to pair. |
| 种子 | 整数 | 0 | Different seeds give different tilings; 0 gives the same one every time. |
返回
| 对数 | 整数 |
| 第一格列 | 整数数组 |
| 第一格行 | 整数数组 |
| 第二格列 | 整数数组 |
| 第二格行 | 整数数组 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
网格区域
函数The cells holding the same value as a starting cell and joined to it four ways: what a paint bucket fills.
网格区域 -> (数量: 整数, 列: 整数数组, 行: 整数数组)
网格: Value Grid
起点列: 整数
起点行: 整数int Region(
ValueGrid grid,
int x,
int y,
out int[] xs,
out int[] ys)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 起点列 | 整数 | — | Start column. |
| 起点行 | 整数 | — | Start row. |
返回
| 数量 | 整数 |
| 列 | 整数数组 |
| 行 | 整数数组 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
设置格子
函数The grid with one cell holding a new value.
设置格子 -> Value Grid
网格: Value Grid
列: 整数
行: 整数
值: 整数ValueGrid SetCell(ValueGrid grid, int x, int y, int value)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 列 | 整数 | — | Column. |
| 行 | 整数 | — | Row. |
| 值 | 整数 | — | What it holds now. |
返回
| 网格 | Value Grid |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
设置多个格子
函数The grid with several cells set at once, the nth cell to the nth value - or every cell to the one value when only one is given.
设置多个格子 -> Value Grid
网格: Value Grid
列: 整数数组
行: 整数数组
值: 整数数组ValueGrid SetCells(
ValueGrid grid,
int[] xs,
int[] ys,
int[] values)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 列 | 整数数组 | — | Columns. |
| 行 | 整数数组 | — | Rows, as many as columns. |
| 值 | 整数数组 | — | One value for all, or one for each cell. |
返回
| 网格 | Value Grid |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
打乱网格格子
函数The grid with what its cells hold shuffled among them, leaving every cell that holds the kept value where it is.
打乱网格格子 -> Value Grid
网格: Value Grid
保留值: 整数
种子: 整数ValueGrid ShuffleCells(
ValueGrid grid,
int keep = 0,
int seed = 1)参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
| 保留值 | 整数 | 0 | The value that stays put; 0 keeps the empty cells empty. |
| 种子 | 整数 | 1 | The same seed shuffles the same way. |
返回
| 网格 | Value Grid |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎
网格数值
函数Every cell's value, row by row from the top.
网格数值(网格: Value Grid) -> 整数数组
int[] Values(ValueGrid grid)
参数
| 名称 | 类型 | 默认值 | 说明 |
|---|---|---|---|
| 网格 | Value Grid | — | The grid. |
返回
| 数值 | 整数数组 |
- 所属发行版
- 元编程(教育版)元编程(专业版)
- 可用的图种类
- 数据流 函数 事件 例程 蓝图 状态机状态
- 声明于
- 网格
- 所属包
- 罪案引擎