C# Class RunicBoard

Mostra file Open project: LilTsubaki/Les-fragments-d-Erule Class Usage Examples

Public Methods

Method Description
CanLaunchSpell ( ) : bool

Check if the combination of runes exists in the database

ChangeRunePosition ( int actualPosition, int newPosition ) : bool

Change a rune's position if it doesn't break the chain to the center.

EverythingIsConnectedToCenter ( Rune>.Dictionary &board ) : bool

Check if every runes placed on the board are correctly connected to the center

GetPolesInfluence ( float &perfection, float &sublimation, float &stability ) : void

Calculates the percentage acquired from the influence of each pole on every rune.

GetRuneLinks ( ) : Element>>.List

Creates a list containing every unique link between two runes placed on the board.

GetSortedElementList ( ) : List

GetSortedElementQueue ( ) : Queue

IsConnectedToCenter ( int position, List &explored, Rune>.Dictionary &board ) : bool

Return if the position is connected to the center

LogHand ( ) : void

Display in console runes in Hand

LogRunesOnBoard ( ) : void

Display in console runes on board

PlaceRuneOnBoard ( int index, int position ) : int

Verify if you can place a rune at the position, and place it if it is OK.

RemoveAllRunes ( ) : void

Remove all runes from the runic board and put them back in the hand.

RemoveAllRunesExceptHistory ( bool ignoreSecond ) : void
RemoveAllRunesFromThisTurn ( ) : void

Remove all runes that were placed on the current turn.

RemoveRuneFromBoard ( int position, bool sendRemove = true ) : bool

Remove a rune from the board at this position, and put in back in the hand.

RunicBoard ( ) : UnityEngine
RunicBoard ( Rune>.Dictionary hand ) : UnityEngine
Testing ( ) : void

Private Methods

Method Description
GetAdjacentPositions ( int position ) : List

Get adjacent positions to the one in parameter.

GetNeighboursPosition ( int position ) : List

Get positions of runes adjacent to the position in parameter using runesOnBoard

GetNeighboursPosition ( int position, Rune>.Dictionary board ) : List

get positions of runes adjacent to the position in paramater, using the board in paramater

PositionExists ( int p ) : bool

Check if the position exists on the board.

Method Details

CanLaunchSpell() public method

Check if the combination of runes exists in the database
public CanLaunchSpell ( ) : bool
return bool

ChangeRunePosition() public method

Change a rune's position if it doesn't break the chain to the center.
public ChangeRunePosition ( int actualPosition, int newPosition ) : bool
actualPosition int The actual position if the rune to move
newPosition int Where to place the rune
return bool

EverythingIsConnectedToCenter() public method

Check if every runes placed on the board are correctly connected to the center
public EverythingIsConnectedToCenter ( Rune>.Dictionary &board ) : bool
board Rune>.Dictionary The board to test
return bool

GetPolesInfluence() public method

Calculates the percentage acquired from the influence of each pole on every rune.
public GetPolesInfluence ( float &perfection, float &sublimation, float &stability ) : void
perfection float The perfection percentage.
sublimation float The sublimation percentage.
stability float The stability percentage.
return void

GetRuneLinks() public method

Creates a list containing every unique link between two runes placed on the board.
public GetRuneLinks ( ) : Element>>.List
return Element>>.List

GetSortedElementList() public method

public GetSortedElementList ( ) : List
return List

GetSortedElementQueue() public method

public GetSortedElementQueue ( ) : Queue
return Queue

IsConnectedToCenter() public method

Return if the position is connected to the center
public IsConnectedToCenter ( int position, List &explored, Rune>.Dictionary &board ) : bool
position int The position to test
explored List List of explored positions
board Rune>.Dictionary The board to test
return bool

LogHand() public method

Display in console runes in Hand
public LogHand ( ) : void
return void

LogRunesOnBoard() public method

Display in console runes on board
public LogRunesOnBoard ( ) : void
return void

PlaceRuneOnBoard() public method

Verify if you can place a rune at the position, and place it if it is OK.
public PlaceRuneOnBoard ( int index, int position ) : int
index int The index in runesInHand list
position int The position where the rune will be placed
return int

RemoveAllRunes() public method

Remove all runes from the runic board and put them back in the hand.
public RemoveAllRunes ( ) : void
return void

RemoveAllRunesExceptHistory() public method

public RemoveAllRunesExceptHistory ( bool ignoreSecond ) : void
ignoreSecond bool
return void

RemoveAllRunesFromThisTurn() public method

Remove all runes that were placed on the current turn.
public RemoveAllRunesFromThisTurn ( ) : void
return void

RemoveRuneFromBoard() public method

Remove a rune from the board at this position, and put in back in the hand.
public RemoveRuneFromBoard ( int position, bool sendRemove = true ) : bool
position int The position where the rune is expected to be
sendRemove bool
return bool

RunicBoard() public method

public RunicBoard ( ) : UnityEngine
return UnityEngine

RunicBoard() public method

public RunicBoard ( Rune>.Dictionary hand ) : UnityEngine
hand Rune>.Dictionary
return UnityEngine

Testing() public method

public Testing ( ) : void
return void