Example #1
0
        /// <summary>
        /// Initializes a new instance of the <see cref="VisualBoard"/> class.
        /// </summary>
        /// <param name="piecesProvider">The pieces provider.</param>
        public VisualBoard(PiecesProvider piecesProvider)
        {
            _piecesProvider = piecesProvider;

            FriendlyBoard      = new FriendlyBoard();
            _selectionsManager = new SelectionsManager();
            _axesManager       = new AxesManager();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="GameModeBase"/> class.
        /// </summary>
        /// <param name="consoleManager">The console manager instance</param>
        /// <param name="commandsManager">The commands manager instance</param>
        protected GameModeBase(ConsoleManager consoleManager, CommandsManager commandsManager)
        {
            ConsoleManager  = consoleManager;
            CommandsManager = commandsManager;

            PiecesProvider = new PiecesProvider();

            VisualBoard     = new VisualBoard(PiecesProvider);
            PromotionWindow = new PromotionWindow(PiecesProvider);

            SetCommandHandlers();
        }
        /// <summary>
        /// Initializes a new instance of the <see cref="PromotionWindow"/> class.
        /// </summary>
        /// <param name="piecesProvider">PiecesProvider instance.</param>
        public PromotionWindow(PiecesProvider piecesProvider)
        {
            Active = false;

            _highlightPosition = null;
            _piecesProvider    = piecesProvider;

            _predefinedPieceTypes = new List <PieceType> {
                PieceType.Queen, PieceType.Rook, PieceType.Bishop, PieceType.Knight
            };
            _availablePieces = new List <PromotionPiece>();
            _promotionMoves  = new List <PromotionMove>();
        }
 /// <summary>
 /// Loads the resources. Must be called before first use of any other class method.
 /// </summary>
 /// <param name="contentManager">Monogame content manager.</param>
 public virtual void LoadContent(ContentManager contentManager)
 {
     PiecesProvider.LoadContent(contentManager);
     VisualBoard.LoadContent(contentManager);
     PromotionWindow.LoadContent(contentManager);
 }