C# 클래스 BVG.Board

상속: UnityEngine.MonoBehaviour
파일 보기 프로젝트 열기: BigVikingGames/checkers-starter 1 사용 예제들

공개 프로퍼티들

프로퍼티 타입 설명
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