Exemplo n.º 1
0
        public ChessMatchState(Game game)
        {
            //Managers
            m_inputManger      = (IInputManager)game.Services.GetService(typeof(IInputManager));
            m_gameStateManager = (IGameStateManager)game.Services.GetService(typeof(IGameStateManager));
            m_graphicsManager  = (IGraphicsManager)game.Services.GetService(typeof(IGraphicsManager));
            m_resourceManager  = (IResourceManager)game.Services.GetService(typeof(IResourceManager));
            m_audioManager     = (IAudioManager)game.Services.GetService(typeof(IAudioManager));

            //Chess match stuff
            m_matchState = WhitePiecePicking.GetMatchState(this);
            m_chessMatch = new ChessMatch(this);
        }
Exemplo n.º 2
0
        public void LoadContent()
        {
            //Load models
            m_chessboardModel  = m_resourceManager.GetModel(GameModelKey.Chessboard);
            m_lettersModel     = m_resourceManager.GetModel(GameModelKey.Letters);
            m_whitePawnModel   = m_resourceManager.GetModel(GameModelKey.WhitePawn);
            m_whiteRookModel   = m_resourceManager.GetModel(GameModelKey.WhiteRook);
            m_whiteKnightModel = m_resourceManager.GetModel(GameModelKey.WhiteKnight);
            m_whiteBishopModel = m_resourceManager.GetModel(GameModelKey.WhiteBishop);
            m_whiteQueenModel  = m_resourceManager.GetModel(GameModelKey.WhiteQueen);
            m_whiteKingModel   = m_resourceManager.GetModel(GameModelKey.WhiteKing);
            m_blackPawnModel   = m_resourceManager.GetModel(GameModelKey.BlackPawn);
            m_blackRookModel   = m_resourceManager.GetModel(GameModelKey.BlackRook);
            m_blackKnightModel = m_resourceManager.GetModel(GameModelKey.BlackKnight);
            m_blackBishopModel = m_resourceManager.GetModel(GameModelKey.BlackBishop);
            m_blackQueenModel  = m_resourceManager.GetModel(GameModelKey.BlackQueen);
            m_blackKingModel   = m_resourceManager.GetModel(GameModelKey.BlackKing);

            //Load effects
            m_phongBumpReflect        = m_resourceManager.GetEffect(this, GameEffectKey.PhongBumpReflect);
            m_chessboardPickingEffect = m_resourceManager.GetEffect(this, GameEffectKey.SimpleTexture);
            m_phong = m_resourceManager.GetEffect(this, GameEffectKey.Phong);

            //Load textures
            m_chessboardPickingTexture = m_resourceManager.GetTexture(this, GameTextureKey.ChessboardPicking);
            m_chessboardDiffuse        = m_resourceManager.GetTexture(this, GameTextureKey.ChessboardDiffuse);
            m_chessboardBump           = m_resourceManager.GetTexture(this, GameTextureKey.ChessboardBump);
            m_lettersTexture           = m_resourceManager.GetTexture(this, GameTextureKey.LettersDiffuse);
            m_whitePiecesTexture       = m_resourceManager.GetTexture(this, GameTextureKey.WhitePiecesDiffuse);
            m_blackPiecesTexture       = m_resourceManager.GetTexture(this, GameTextureKey.BlackPiecesDiffuse);
            m_selectedPiecesTexture    = m_resourceManager.GetTexture(this, GameTextureKey.SelectedPiecesDiffuse);
            m_piecesBumpMap            = m_resourceManager.GetTexture(this, GameTextureKey.PiecesBumpMap);

            //Load fonts
            m_messageFont = m_resourceManager.GetFont(GameFontKey.VerdanaBig);

            //Setup
            m_chessboardPickingEffect.Parameters["Texture"].SetValue(m_chessboardPickingTexture);

            //Setup the match
            m_chessMatch.SetupGame();
            m_matchState = WhitePiecePicking.GetMatchState(this);

            //Reset the camera
            m_graphicsManager.ResetCamera();
        }