M&B: Bannerlord 1.2.7
The horns sound, the ravens gather.
Loading...
Searching...
No Matches
SandBox.BoardGames.BoardGameBase Class Referenceabstract

Inherited by SandBox.BoardGames.BoardGameBaghChal, SandBox.BoardGames.BoardGameKonane, SandBox.BoardGames.BoardGameMuTorere, SandBox.BoardGames.BoardGamePuluc, SandBox.BoardGames.BoardGameSeega, and SandBox.BoardGames.BoardGameTablut.

Public Member Functions

abstract void InitializeUnits ()
 
abstract void InitializeTiles ()
 
abstract void InitializeSound ()
 
abstract List< MoveCalculateValidMoves (PawnBase pawn)
 
virtual void RollDice ()
 
virtual void InitializeDiceBoard ()
 
virtual void Reset ()
 
virtual void InitializeCapturedUnitsZones ()
 
virtual void SetPawnCaptured (PawnBase pawn, bool fake=false)
 
virtual List< List< Move > > CalculateAllValidMoves (BoardGameSide side)
 
void SetUserRay (Vec3 rayBegin, Vec3 rayEnd)
 
void SetStartingPlayer (PlayerTurn player)
 
void SetGameOverInfo (GameOverEnum info)
 
bool HasMovesAvailable (ref List< List< Move > > moves)
 
int GetTotalMovesAvailable (ref List< List< Move > > moves)
 
void PlayDiceRollSound ()
 
int GetPlayerOneUnitsAlive ()
 
int GetPlayerTwoUnitsAlive ()
 
int GetPlayerOneUnitsDead ()
 
int GetPlayerTwoUnitsDead ()
 
void Initialize ()
 
bool Tick (float dt)
 
void ForceDice (int value)
 

Static Public Attributes

const string StringBoardGame = "str_boardgame"
 
const string StringForfeitQuestion = "str_boardgame_forfeit_question"
 
const string StringMovePiecePlayer = "str_boardgame_move_piece_player"
 
const string StringMovePieceOpponent = "str_boardgame_move_piece_opponent"
 
const string StringCapturePiecePlayer = "str_boardgame_capture_piece_player"
 
const string StringCapturePieceOpponent = "str_boardgame_capture_piece_opponent"
 
const string StringVictoryMessage = "str_boardgame_victory_message"
 
const string StringDefeatMessage = "str_boardgame_defeat_message"
 
const string StringDrawMessage = "str_boardgame_draw_message"
 
const string StringNoAvailableMovesPlayer = "str_boardgame_no_available_moves_player"
 
const string StringNoAvailableMovesOpponent = "str_boardgame_no_available_moves_opponent"
 
const string StringSeegaBarrierByP1DrawMessage = "str_boardgame_seega_barrier_by_player_one_draw_message"
 
const string StringSeegaBarrierByP2DrawMessage = "str_boardgame_seega_barrier_by_player_two_draw_message"
 
const string StringSeegaBarrierByP1VictoryMessage = "str_boardgame_seega_barrier_by_player_one_victory_message"
 
const string StringSeegaBarrierByP2VictoryMessage = "str_boardgame_seega_barrier_by_player_two_victory_message"
 
const string StringSeegaBarrierByP1DefeatMessage = "str_boardgame_seega_barrier_by_player_one_defeat_message"
 
const string StringSeegaBarrierByP2DefeatMessage = "str_boardgame_seega_barrier_by_player_two_defeat_message"
 
const string StringRollDicePlayer = "str_boardgame_roll_dice_player"
 
const string StringRollDiceOpponent = "str_boardgame_roll_dice_opponent"
 

Protected Member Functions

 BoardGameBase (MissionBoardGameLogic mission, TextObject name, PlayerTurn startingPlayer)
 
abstract PawnBase SelectPawn (PawnBase pawn)
 
abstract bool CheckGameEnded ()
 
abstract void OnAfterBoardSetUp ()
 
virtual void OnAfterBoardRotated ()
 
virtual void OnBeforeEndTurn ()
 
virtual void UpdateAllTilesPositions ()
 
virtual void OnPawnArrivesGoalPosition (PawnBase pawn, Vec3 prevPos, Vec3 currentPos)
 
virtual void HandlePreMovementStage (float dt)
 
virtual void HandlePreMovementStageAI (Move move)
 
virtual void SwitchPlayerTurn ()
 
virtual void MovePawnToTile (PawnBase pawn, TileBase tile, bool instantMove=false, bool displayMessage=true)
 
virtual void MovePawnToTileDelayed (PawnBase pawn, TileBase tile, bool instantMove, bool displayMessage, float delay)
 
virtual void OnAfterDiceRollAnimation ()
 
void RemovePawnFromBoard (PawnBase pawn, float speed, bool instantMove=false)
 
PawnBase InitializeUnit (PawnBase pawnToInit)
 
Move HandlePlayerInput (float dt)
 
PawnBase GetHoveredPawnIfAny ()
 
TileBase GetHoveredTileIfAny ()
 
void CheckSwitchPlayerTurn ()
 
void OnVictory (string message=StringVictoryMessage)
 
void OnAfterEndTurn ()
 
void OnDefeat (string message=StringDefeatMessage)
 
void OnDraw (string message=StringDrawMessage)
 
void EndTurn ()
 
void ClearValidMoves ()
 
void HideAllValidTiles ()
 
void ShowAllValidTiles ()
 
void OnAIWantsForfeit ()
 

Protected Attributes

uint PawnSelectedFactor = 0xFFFFFFFF
 
uint PawnUnselectedFactor = 0xFF3D3D3D
 
MissionBoardGameLogic MissionHandler
 
GameEntity BoardEntity
 
GameEntity DiceBoard
 
bool JustStoppedDraggingUnit
 
CapturedPawnsPool PlayerOnePool
 
bool ReadyToPlay
 
CapturedPawnsPool PlayerTwoPool
 
bool SettingUpBoard = true
 
bool HasToMovePawnsAcross
 
float DiceRollAnimationTimer
 
int MovesLeftToEndTurn
 
bool DiceRollAnimationRunning
 
int DiceRollSoundCodeID
 

Static Protected Attributes

const int InvalidDice = -1
 
const float DelayBeforeMovingAnyPawn = 0.25f
 
const float DelayBetweenPawnMovementsBegin = 0.15f
 

Properties

abstract int TileCount [get]
 
abstract bool RotateBoard [get]
 
abstract bool PreMovementStagePresent [get]
 
abstract bool DiceRollRequired [get]
 
virtual int UnitsToPlacePerTurnInPreMovementStage [get]
 
virtual PawnBase SelectedUnit [get, set]
 
TextObject Name [get]
 
bool InPreMovementStage [get, protected set]
 
TileBase[] Tiles [get, protected set]
 
List< PawnBasePlayerOneUnits [get, protected set]
 
List< PawnBasePlayerTwoUnits [get, protected set]
 
int LastDice [get, protected set]
 
bool IsReady [get]
 
PlayerTurn PlayerWhoStarted [get]
 
GameOverEnum GameOverInfo [get]
 
PlayerTurn PlayerTurn [get, protected set]
 
IInputContext InputManager [get]
 
List< PawnBasePawnSelectFilter [get]
 
BoardGameAIBase AIOpponent [get]
 

Constructor & Destructor Documentation

◆ BoardGameBase()

SandBox.BoardGames.BoardGameBase.BoardGameBase ( MissionBoardGameLogic  mission,
TextObject  name,
PlayerTurn  startingPlayer 
)
protected

Member Function Documentation

◆ InitializeUnits()

◆ InitializeTiles()

◆ InitializeSound()

◆ CalculateValidMoves()

◆ SelectPawn()

◆ CheckGameEnded()

◆ OnAfterBoardSetUp()

◆ OnAfterBoardRotated()

virtual void SandBox.BoardGames.BoardGameBase.OnAfterBoardRotated ( )
protectedvirtual

◆ OnBeforeEndTurn()

virtual void SandBox.BoardGames.BoardGameBase.OnBeforeEndTurn ( )
protectedvirtual

◆ RollDice()

virtual void SandBox.BoardGames.BoardGameBase.RollDice ( )
virtual

◆ UpdateAllTilesPositions()

virtual void SandBox.BoardGames.BoardGameBase.UpdateAllTilesPositions ( )
protectedvirtual

◆ InitializeDiceBoard()

virtual void SandBox.BoardGames.BoardGameBase.InitializeDiceBoard ( )
virtual

◆ Reset()

◆ OnPawnArrivesGoalPosition()

virtual void SandBox.BoardGames.BoardGameBase.OnPawnArrivesGoalPosition ( PawnBase  pawn,
Vec3  prevPos,
Vec3  currentPos 
)
protectedvirtual

◆ HandlePreMovementStage()

virtual void SandBox.BoardGames.BoardGameBase.HandlePreMovementStage ( float  dt)
protectedvirtual

◆ InitializeCapturedUnitsZones()

virtual void SandBox.BoardGames.BoardGameBase.InitializeCapturedUnitsZones ( )
virtual

◆ HandlePreMovementStageAI()

virtual void SandBox.BoardGames.BoardGameBase.HandlePreMovementStageAI ( Move  move)
protectedvirtual

◆ SetPawnCaptured()

virtual void SandBox.BoardGames.BoardGameBase.SetPawnCaptured ( PawnBase  pawn,
bool  fake = false 
)
virtual

◆ CalculateAllValidMoves()

virtual List< List< Move > > SandBox.BoardGames.BoardGameBase.CalculateAllValidMoves ( BoardGameSide  side)
virtual

◆ SwitchPlayerTurn()

◆ MovePawnToTile()

virtual void SandBox.BoardGames.BoardGameBase.MovePawnToTile ( PawnBase  pawn,
TileBase  tile,
bool  instantMove = false,
bool  displayMessage = true 
)
protectedvirtual

◆ MovePawnToTileDelayed()

virtual void SandBox.BoardGames.BoardGameBase.MovePawnToTileDelayed ( PawnBase  pawn,
TileBase  tile,
bool  instantMove,
bool  displayMessage,
float  delay 
)
protectedvirtual

◆ OnAfterDiceRollAnimation()

virtual void SandBox.BoardGames.BoardGameBase.OnAfterDiceRollAnimation ( )
protectedvirtual

◆ SetUserRay()

void SandBox.BoardGames.BoardGameBase.SetUserRay ( Vec3  rayBegin,
Vec3  rayEnd 
)

◆ SetStartingPlayer()

void SandBox.BoardGames.BoardGameBase.SetStartingPlayer ( PlayerTurn  player)

◆ SetGameOverInfo()

void SandBox.BoardGames.BoardGameBase.SetGameOverInfo ( GameOverEnum  info)

◆ HasMovesAvailable()

bool SandBox.BoardGames.BoardGameBase.HasMovesAvailable ( ref List< List< Move > >  moves)

◆ GetTotalMovesAvailable()

int SandBox.BoardGames.BoardGameBase.GetTotalMovesAvailable ( ref List< List< Move > >  moves)

◆ PlayDiceRollSound()

void SandBox.BoardGames.BoardGameBase.PlayDiceRollSound ( )

◆ GetPlayerOneUnitsAlive()

int SandBox.BoardGames.BoardGameBase.GetPlayerOneUnitsAlive ( )

◆ GetPlayerTwoUnitsAlive()

int SandBox.BoardGames.BoardGameBase.GetPlayerTwoUnitsAlive ( )

◆ GetPlayerOneUnitsDead()

int SandBox.BoardGames.BoardGameBase.GetPlayerOneUnitsDead ( )

◆ GetPlayerTwoUnitsDead()

int SandBox.BoardGames.BoardGameBase.GetPlayerTwoUnitsDead ( )

◆ Initialize()

void SandBox.BoardGames.BoardGameBase.Initialize ( )

◆ RemovePawnFromBoard()

void SandBox.BoardGames.BoardGameBase.RemovePawnFromBoard ( PawnBase  pawn,
float  speed,
bool  instantMove = false 
)
protected

◆ Tick()

bool SandBox.BoardGames.BoardGameBase.Tick ( float  dt)

◆ ForceDice()

void SandBox.BoardGames.BoardGameBase.ForceDice ( int  value)

◆ InitializeUnit()

PawnBase SandBox.BoardGames.BoardGameBase.InitializeUnit ( PawnBase  pawnToInit)
protected

◆ HandlePlayerInput()

Move SandBox.BoardGames.BoardGameBase.HandlePlayerInput ( float  dt)
protected

◆ GetHoveredPawnIfAny()

PawnBase SandBox.BoardGames.BoardGameBase.GetHoveredPawnIfAny ( )
protected

◆ GetHoveredTileIfAny()

TileBase SandBox.BoardGames.BoardGameBase.GetHoveredTileIfAny ( )
protected

◆ CheckSwitchPlayerTurn()

void SandBox.BoardGames.BoardGameBase.CheckSwitchPlayerTurn ( )
protected

◆ OnVictory()

void SandBox.BoardGames.BoardGameBase.OnVictory ( string  message = StringVictoryMessage)
protected

◆ OnAfterEndTurn()

void SandBox.BoardGames.BoardGameBase.OnAfterEndTurn ( )
protected

◆ OnDefeat()

void SandBox.BoardGames.BoardGameBase.OnDefeat ( string  message = StringDefeatMessage)
protected

◆ OnDraw()

void SandBox.BoardGames.BoardGameBase.OnDraw ( string  message = StringDrawMessage)
protected

◆ EndTurn()

void SandBox.BoardGames.BoardGameBase.EndTurn ( )
protected

◆ ClearValidMoves()

void SandBox.BoardGames.BoardGameBase.ClearValidMoves ( )
protected

◆ HideAllValidTiles()

void SandBox.BoardGames.BoardGameBase.HideAllValidTiles ( )
protected

◆ ShowAllValidTiles()

void SandBox.BoardGames.BoardGameBase.ShowAllValidTiles ( )
protected

◆ OnAIWantsForfeit()

void SandBox.BoardGames.BoardGameBase.OnAIWantsForfeit ( )
protected

Member Data Documentation

◆ StringBoardGame

const string SandBox.BoardGames.BoardGameBase.StringBoardGame = "str_boardgame"
static

◆ StringForfeitQuestion

const string SandBox.BoardGames.BoardGameBase.StringForfeitQuestion = "str_boardgame_forfeit_question"
static

◆ StringMovePiecePlayer

const string SandBox.BoardGames.BoardGameBase.StringMovePiecePlayer = "str_boardgame_move_piece_player"
static

◆ StringMovePieceOpponent

const string SandBox.BoardGames.BoardGameBase.StringMovePieceOpponent = "str_boardgame_move_piece_opponent"
static

◆ StringCapturePiecePlayer

const string SandBox.BoardGames.BoardGameBase.StringCapturePiecePlayer = "str_boardgame_capture_piece_player"
static

◆ StringCapturePieceOpponent

const string SandBox.BoardGames.BoardGameBase.StringCapturePieceOpponent = "str_boardgame_capture_piece_opponent"
static

◆ StringVictoryMessage

const string SandBox.BoardGames.BoardGameBase.StringVictoryMessage = "str_boardgame_victory_message"
static

◆ StringDefeatMessage

const string SandBox.BoardGames.BoardGameBase.StringDefeatMessage = "str_boardgame_defeat_message"
static

◆ StringDrawMessage

const string SandBox.BoardGames.BoardGameBase.StringDrawMessage = "str_boardgame_draw_message"
static

◆ StringNoAvailableMovesPlayer

const string SandBox.BoardGames.BoardGameBase.StringNoAvailableMovesPlayer = "str_boardgame_no_available_moves_player"
static

◆ StringNoAvailableMovesOpponent

const string SandBox.BoardGames.BoardGameBase.StringNoAvailableMovesOpponent = "str_boardgame_no_available_moves_opponent"
static

◆ StringSeegaBarrierByP1DrawMessage

const string SandBox.BoardGames.BoardGameBase.StringSeegaBarrierByP1DrawMessage = "str_boardgame_seega_barrier_by_player_one_draw_message"
static

◆ StringSeegaBarrierByP2DrawMessage

const string SandBox.BoardGames.BoardGameBase.StringSeegaBarrierByP2DrawMessage = "str_boardgame_seega_barrier_by_player_two_draw_message"
static

◆ StringSeegaBarrierByP1VictoryMessage

const string SandBox.BoardGames.BoardGameBase.StringSeegaBarrierByP1VictoryMessage = "str_boardgame_seega_barrier_by_player_one_victory_message"
static

◆ StringSeegaBarrierByP2VictoryMessage

const string SandBox.BoardGames.BoardGameBase.StringSeegaBarrierByP2VictoryMessage = "str_boardgame_seega_barrier_by_player_two_victory_message"
static

◆ StringSeegaBarrierByP1DefeatMessage

const string SandBox.BoardGames.BoardGameBase.StringSeegaBarrierByP1DefeatMessage = "str_boardgame_seega_barrier_by_player_one_defeat_message"
static

◆ StringSeegaBarrierByP2DefeatMessage

const string SandBox.BoardGames.BoardGameBase.StringSeegaBarrierByP2DefeatMessage = "str_boardgame_seega_barrier_by_player_two_defeat_message"
static

◆ StringRollDicePlayer

const string SandBox.BoardGames.BoardGameBase.StringRollDicePlayer = "str_boardgame_roll_dice_player"
static

◆ StringRollDiceOpponent

const string SandBox.BoardGames.BoardGameBase.StringRollDiceOpponent = "str_boardgame_roll_dice_opponent"
static

◆ InvalidDice

const int SandBox.BoardGames.BoardGameBase.InvalidDice = -1
staticprotected

◆ DelayBeforeMovingAnyPawn

const float SandBox.BoardGames.BoardGameBase.DelayBeforeMovingAnyPawn = 0.25f
staticprotected

◆ DelayBetweenPawnMovementsBegin

const float SandBox.BoardGames.BoardGameBase.DelayBetweenPawnMovementsBegin = 0.15f
staticprotected

◆ PawnSelectedFactor

uint SandBox.BoardGames.BoardGameBase.PawnSelectedFactor = 0xFFFFFFFF
protected

◆ PawnUnselectedFactor

uint SandBox.BoardGames.BoardGameBase.PawnUnselectedFactor = 0xFF3D3D3D
protected

◆ MissionHandler

MissionBoardGameLogic SandBox.BoardGames.BoardGameBase.MissionHandler
protected

◆ BoardEntity

GameEntity SandBox.BoardGames.BoardGameBase.BoardEntity
protected

◆ DiceBoard

GameEntity SandBox.BoardGames.BoardGameBase.DiceBoard
protected

◆ JustStoppedDraggingUnit

bool SandBox.BoardGames.BoardGameBase.JustStoppedDraggingUnit
protected

◆ PlayerOnePool

CapturedPawnsPool SandBox.BoardGames.BoardGameBase.PlayerOnePool
protected

◆ ReadyToPlay

bool SandBox.BoardGames.BoardGameBase.ReadyToPlay
protected

◆ PlayerTwoPool

CapturedPawnsPool SandBox.BoardGames.BoardGameBase.PlayerTwoPool
protected

◆ SettingUpBoard

bool SandBox.BoardGames.BoardGameBase.SettingUpBoard = true
protected

◆ HasToMovePawnsAcross

bool SandBox.BoardGames.BoardGameBase.HasToMovePawnsAcross
protected

◆ DiceRollAnimationTimer

float SandBox.BoardGames.BoardGameBase.DiceRollAnimationTimer
protected

◆ MovesLeftToEndTurn

int SandBox.BoardGames.BoardGameBase.MovesLeftToEndTurn
protected

◆ DiceRollAnimationRunning

bool SandBox.BoardGames.BoardGameBase.DiceRollAnimationRunning
protected

◆ DiceRollSoundCodeID

int SandBox.BoardGames.BoardGameBase.DiceRollSoundCodeID
protected

Property Documentation

◆ TileCount

abstract int SandBox.BoardGames.BoardGameBase.TileCount
get

◆ RotateBoard

abstract bool SandBox.BoardGames.BoardGameBase.RotateBoard
getprotected

◆ PreMovementStagePresent

abstract bool SandBox.BoardGames.BoardGameBase.PreMovementStagePresent
getprotected

◆ DiceRollRequired

abstract bool SandBox.BoardGames.BoardGameBase.DiceRollRequired
getprotected

◆ UnitsToPlacePerTurnInPreMovementStage

virtual int SandBox.BoardGames.BoardGameBase.UnitsToPlacePerTurnInPreMovementStage
getprotected

◆ SelectedUnit

virtual PawnBase SandBox.BoardGames.BoardGameBase.SelectedUnit
getsetprotected

◆ Name

TextObject SandBox.BoardGames.BoardGameBase.Name
get

◆ InPreMovementStage

bool SandBox.BoardGames.BoardGameBase.InPreMovementStage
getprotected set

◆ Tiles

TileBase [] SandBox.BoardGames.BoardGameBase.Tiles
getprotected set

◆ PlayerOneUnits

List<PawnBase> SandBox.BoardGames.BoardGameBase.PlayerOneUnits
getprotected set

◆ PlayerTwoUnits

List<PawnBase> SandBox.BoardGames.BoardGameBase.PlayerTwoUnits
getprotected set

◆ LastDice

int SandBox.BoardGames.BoardGameBase.LastDice
getprotected set

◆ IsReady

bool SandBox.BoardGames.BoardGameBase.IsReady
get

◆ PlayerWhoStarted

PlayerTurn SandBox.BoardGames.BoardGameBase.PlayerWhoStarted
get

◆ GameOverInfo

GameOverEnum SandBox.BoardGames.BoardGameBase.GameOverInfo
get

◆ PlayerTurn

PlayerTurn SandBox.BoardGames.BoardGameBase.PlayerTurn
getprotected set

◆ InputManager

IInputContext SandBox.BoardGames.BoardGameBase.InputManager
getprotected

◆ PawnSelectFilter

List<PawnBase> SandBox.BoardGames.BoardGameBase.PawnSelectFilter
getprotected

◆ AIOpponent

BoardGameAIBase SandBox.BoardGames.BoardGameBase.AIOpponent
getprotected