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

Inherits SandBox.BoardGames.BoardGameBase.

Classes

struct  BoardInformation
 
struct  PawnInformation
 

Public Member Functions

 BoardGameKonane (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)
 
void AIMakeMove (Move move)
 
int CheckForRemovablePawns (bool playerOne)
 
BoardInformation TakeBoardSnapshot ()
 
void UndoMove (ref BoardInformation board)
 
- 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)
 

Public Attributes

List< PawnBaseRemovablePawns = new List<PawnBase>()
 

Static Public Attributes

const int WhitePawnCount = 18
 
const int BlackPawnCount = 18
 
static readonly int BoardWidth = 6
 
static readonly int BoardHeight = 6
 
- 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 PawnBase SelectPawn (PawnBase pawn)
 
override void HandlePreMovementStage (float dt)
 
override void HandlePreMovementStageAI (Move move)
 
override void MovePawnToTileDelayed (PawnBase pawn, TileBase tile, bool instantMove, bool displayMessage, float delay)
 
override void SwitchPlayerTurn ()
 
override bool CheckGameEnded ()
 
override void OnAfterBoardSetUp ()
 
void CheckWhichPawnsAreCaptured (PawnKonane pawn, bool fake=false)
 
- 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
 

Constructor & Destructor Documentation

◆ BoardGameKonane()

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

Member Function Documentation

◆ InitializeUnits()

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

◆ InitializeTiles()

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

◆ InitializeSound()

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

◆ Reset()

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

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ CalculateValidMoves()

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

◆ SetPawnCaptured()

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

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ SelectPawn()

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

◆ HandlePreMovementStage()

override void SandBox.BoardGames.BoardGameKonane.HandlePreMovementStage ( float  dt)
protectedvirtual

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ HandlePreMovementStageAI()

override void SandBox.BoardGames.BoardGameKonane.HandlePreMovementStageAI ( Move  move)
protectedvirtual

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ MovePawnToTileDelayed()

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

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ SwitchPlayerTurn()

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

Reimplemented from SandBox.BoardGames.BoardGameBase.

◆ CheckGameEnded()

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

◆ OnAfterBoardSetUp()

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

◆ AIMakeMove()

void SandBox.BoardGames.BoardGameKonane.AIMakeMove ( Move  move)

◆ CheckForRemovablePawns()

int SandBox.BoardGames.BoardGameKonane.CheckForRemovablePawns ( bool  playerOne)

◆ TakeBoardSnapshot()

BoardInformation SandBox.BoardGames.BoardGameKonane.TakeBoardSnapshot ( )

◆ UndoMove()

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

◆ CheckWhichPawnsAreCaptured()

void SandBox.BoardGames.BoardGameKonane.CheckWhichPawnsAreCaptured ( PawnKonane  pawn,
bool  fake = false 
)
protected

Member Data Documentation

◆ WhitePawnCount

const int SandBox.BoardGames.BoardGameKonane.WhitePawnCount = 18
static

◆ BlackPawnCount

const int SandBox.BoardGames.BoardGameKonane.BlackPawnCount = 18
static

◆ BoardWidth

readonly int SandBox.BoardGames.BoardGameKonane.BoardWidth = 6
static

◆ BoardHeight

readonly int SandBox.BoardGames.BoardGameKonane.BoardHeight = 6
static

◆ RemovablePawns

List<PawnBase> SandBox.BoardGames.BoardGameKonane.RemovablePawns = new List<PawnBase>()

Property Documentation

◆ TileCount

override int SandBox.BoardGames.BoardGameKonane.TileCount
get

◆ RotateBoard

override bool SandBox.BoardGames.BoardGameKonane.RotateBoard
getprotected

◆ PreMovementStagePresent

override bool SandBox.BoardGames.BoardGameKonane.PreMovementStagePresent
getprotected

◆ DiceRollRequired

override bool SandBox.BoardGames.BoardGameKonane.DiceRollRequired
getprotected