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

Inherits SandBox.BoardGames.BoardGameBase.

Classes

struct  BoardInformation
 
struct  PawnInformation
 

Public Types

enum  State {
  InProgress ,
  Aborted ,
  PlayerWon ,
  AIWon
}
 

Public Member Functions

 BoardGameTablut (MissionBoardGameLogic mission, PlayerTurn startingPlayer)
 
override void InitializeUnits ()
 
override void InitializeTiles ()
 
override void InitializeSound ()
 
override void Reset ()
 
override List< MoveCalculateValidMoves (PawnBase pawn)
 
override void SetPawnCaptured (PawnBase pawn, bool fake=false)
 
bool AIMakeMove (Move move)
 
bool HasAvailableMoves (PawnTablut pawn)
 
Move GetRandomAvailableMove (PawnTablut pawn)
 
BoardInformation TakeBoardSnapshot ()
 
void UndoMove (ref BoardInformation board)
 
State CheckGameState ()
 
- Public Member Functions inherited from SandBox.BoardGames.BoardGameBase
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 Member Functions

static bool IsCitadelTile (int tileX, int tileY)
 

Static Public Attributes

const int BoardWidth = 9
 
const int BoardHeight = 9
 
const int AttackerPawnCount = 16
 
const int DefenderPawnCount = 9
 
- Static Public Attributes inherited from SandBox.BoardGames.BoardGameBase
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

override void OnAfterBoardSetUp ()
 
override PawnBase SelectPawn (PawnBase pawn)
 
override void MovePawnToTileDelayed (PawnBase pawn, TileBase tile, bool instantMove, bool displayMessage, float delay)
 
override void SwitchPlayerTurn ()
 
override bool CheckGameEnded ()
 
- Protected Member Functions inherited from SandBox.BoardGames.BoardGameBase
 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 ()
 

Properties

override int TileCount [get]
 
override bool RotateBoard [get]
 
override bool PreMovementStagePresent [get]
 
override bool DiceRollRequired [get]
 
- Properties inherited from SandBox.BoardGames.BoardGameBase
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]
 

Additional Inherited Members

- Protected Attributes inherited from SandBox.BoardGames.BoardGameBase
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 inherited from SandBox.BoardGames.BoardGameBase
const int InvalidDice = -1
 
const float DelayBeforeMovingAnyPawn = 0.25f
 
const float DelayBetweenPawnMovementsBegin = 0.15f
 

Member Enumeration Documentation

◆ State

Enumerator
InProgress 
Aborted 
PlayerWon 
AIWon 

Constructor & Destructor Documentation

◆ BoardGameTablut()

SandBox.BoardGames.BoardGameTablut.BoardGameTablut ( MissionBoardGameLogic  mission,
PlayerTurn  startingPlayer 
)

Member Function Documentation

◆ IsCitadelTile()

static bool SandBox.BoardGames.BoardGameTablut.IsCitadelTile ( int  tileX,
int  tileY 
)
static

◆ InitializeUnits()

override void SandBox.BoardGames.BoardGameTablut.InitializeUnits ( )
virtual

◆ InitializeTiles()

override void SandBox.BoardGames.BoardGameTablut.InitializeTiles ( )
virtual

◆ InitializeSound()

override void SandBox.BoardGames.BoardGameTablut.InitializeSound ( )
virtual

◆ Reset()

override void SandBox.BoardGames.BoardGameTablut.Reset ( )
virtual

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ CalculateValidMoves()

override List< Move > SandBox.BoardGames.BoardGameTablut.CalculateValidMoves ( PawnBase  pawn)
virtual

◆ SetPawnCaptured()

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

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ OnAfterBoardSetUp()

override void SandBox.BoardGames.BoardGameTablut.OnAfterBoardSetUp ( )
protectedvirtual

◆ SelectPawn()

override PawnBase SandBox.BoardGames.BoardGameTablut.SelectPawn ( PawnBase  pawn)
protectedvirtual

◆ MovePawnToTileDelayed()

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

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ SwitchPlayerTurn()

override void SandBox.BoardGames.BoardGameTablut.SwitchPlayerTurn ( )
protectedvirtual

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ CheckGameEnded()

override bool SandBox.BoardGames.BoardGameTablut.CheckGameEnded ( )
protectedvirtual

◆ AIMakeMove()

bool SandBox.BoardGames.BoardGameTablut.AIMakeMove ( Move  move)

◆ HasAvailableMoves()

bool SandBox.BoardGames.BoardGameTablut.HasAvailableMoves ( PawnTablut  pawn)

◆ GetRandomAvailableMove()

Move SandBox.BoardGames.BoardGameTablut.GetRandomAvailableMove ( PawnTablut  pawn)

◆ TakeBoardSnapshot()

BoardInformation SandBox.BoardGames.BoardGameTablut.TakeBoardSnapshot ( )

◆ UndoMove()

void SandBox.BoardGames.BoardGameTablut.UndoMove ( ref BoardInformation  board)

◆ CheckGameState()

State SandBox.BoardGames.BoardGameTablut.CheckGameState ( )

Member Data Documentation

◆ BoardWidth

const int SandBox.BoardGames.BoardGameTablut.BoardWidth = 9
static

◆ BoardHeight

const int SandBox.BoardGames.BoardGameTablut.BoardHeight = 9
static

◆ AttackerPawnCount

const int SandBox.BoardGames.BoardGameTablut.AttackerPawnCount = 16
static

◆ DefenderPawnCount

const int SandBox.BoardGames.BoardGameTablut.DefenderPawnCount = 9
static

Property Documentation

◆ TileCount

override int SandBox.BoardGames.BoardGameTablut.TileCount
get

◆ RotateBoard

override bool SandBox.BoardGames.BoardGameTablut.RotateBoard
getprotected

◆ PreMovementStagePresent

override bool SandBox.BoardGames.BoardGameTablut.PreMovementStagePresent
getprotected

◆ DiceRollRequired

override bool SandBox.BoardGames.BoardGameTablut.DiceRollRequired
getprotected