Struct Move
Struct that encapsulates a swap of adjacent cells. A Move can be constructed from either a starting row, column, and direction, or from a "move index" between 0 and NumPotentialMoves()-1. Moves are enumerated as the internal edges of the game grid. Left/right moves come first. There are (maxCols - 1) * maxRows of these. Up/down moves are next. There are (maxRows - 1) * maxCols of these.
Inherited Members
Namespace: Unity.MLAgents.Integrations.Match3
Assembly: solution.dll
Syntax
public struct Move
Fields
| Name | Description |
|---|---|
| Column | Column of the cell that will be moved. |
| Direction | Direction that the cell will be moved. |
| MoveIndex | Index of the move, from 0 to NumPotentialMoves-1. |
| Row | Row of the cell that will be moved. |
Methods
| Name | Description |
|---|---|
| FromMoveIndex(int, BoardSize) | Construct a Move from its move index and the board size. This is useful for iterating through all the Moves on a board, or constructing the Move corresponding to an Agent decision. |
| FromPositionAndDirection(int, int, Direction, BoardSize) | Construct a Move from the row, column, direction, and board size. |
| InRangeForBoard(BoardSize) | Check if the move is valid for the given board size. This will be passed the return value from AbstractBoard.GetCurrentBoardSize(). |
| Next(BoardSize) | Increment the Move to the next MoveIndex, and update the Row, Column, and Direction accordingly. |
| NumPotentialMoves(BoardSize) | Return the number of potential moves for a board of the given size. This is equivalent to the number of internal edges in the board. |
| OtherCell() | Get the other row and column that correspond to this move. |
| OtherDirection() | Get the opposite direction of this move. |