C# Класс BVG.Board

Наследование: UnityEngine.MonoBehaviour
Показать файл Открыть проект Примеры использования класса

Открытые свойства

Свойство Тип Описание
BOARD_GRID_SIZE int
blackPiecePrefab UnityEngine.GameObject
blackSquarePrefab UnityEngine.GameObject
redPiecePrefab UnityEngine.GameObject
whiteSquarePrefab UnityEngine.GameObject

Открытые методы

Метод Описание
AddPlayerToken ( bool isRed, IntVector2 boardPosition ) : void

Adds a player token of a given colour to the given coordinates.

BoardClicked ( IntVector2 boardPosition ) : void

Callback for a tile getting clicked.

GetBoardState ( IntVector2 boardPosition ) : BoardState

Get the state of the board at a given coordinate.

MovePlayerToken ( ) : void

TODO: Implement for moving a player token. Note: The API can be changed, you can add functions, parameters, properties, whatever.

Приватные методы

Метод Описание
Awake ( ) : void
GetDirectionForIntVector ( IntVector2 vec ) : MoveDirection

Gets the equivalent MoveDirection for an IntVector2.

InstantiateSquare ( GameObject squarePrefab, IntVector2 boardPosition ) : void

Instantiate a given square prefab with the given coordinates. Set all the right properties and add it to the board.

IsValidBoardPosition ( IntVector2 boardPosition ) : bool

Determines whether this instance is valid board position the specified boardPosition.

Описание методов

AddPlayerToken() публичный Метод

Adds a player token of a given colour to the given coordinates.
public AddPlayerToken ( bool isRed, IntVector2 boardPosition ) : void
isRed bool If set to true is red.
boardPosition IntVector2 The position on the board to add a player token to.
Результат void

BoardClicked() публичный Метод

Callback for a tile getting clicked.
public BoardClicked ( IntVector2 boardPosition ) : void
boardPosition IntVector2 The position on the board that was clicked.
Результат void

GetBoardState() публичный Метод

Get the state of the board at a given coordinate.
public GetBoardState ( IntVector2 boardPosition ) : BoardState
boardPosition IntVector2 The board position to get the state of.
Результат BoardState

MovePlayerToken() публичный Метод

TODO: Implement for moving a player token. Note: The API can be changed, you can add functions, parameters, properties, whatever.
public MovePlayerToken ( ) : void
Результат void

Описание свойств

BOARD_GRID_SIZE публичное статическое свойство

public static int BOARD_GRID_SIZE
Результат int

blackPiecePrefab публичное свойство

public GameObject,UnityEngine blackPiecePrefab
Результат UnityEngine.GameObject

blackSquarePrefab публичное свойство

public GameObject,UnityEngine blackSquarePrefab
Результат UnityEngine.GameObject

redPiecePrefab публичное свойство

public GameObject,UnityEngine redPiecePrefab
Результат UnityEngine.GameObject

whiteSquarePrefab публичное свойство

public GameObject,UnityEngine whiteSquarePrefab
Результат UnityEngine.GameObject