Beispiel #1
0
        protected void init()
        {
            //Build Logical Chessboard
            GameLogic.Chessboard.resetReference();
            logicalChessboard = GameLogic.Chessboard.getReference();

            //Read XML file
            GameLogic.ChessboardBuilder.readXML(gameFile);

            //Fill the logical chessboard with data read from XML file
            GameLogic.ChessboardBuilder.fillChessboard();

            //Init chessboard
            chessboard = null;

            //Create the Checkers Matrix
            createCheckersMatrix();

            //Now, create the models, they'll allign themselves (in their Update method)
            createAndAllignModels();

            // Chessboard Texture

            createChessboardTexture();

            //Adjust the visuals for the Checkers Matrix
            adjustVisuals();
        }
Beispiel #2
0
 public Chessboard getChessboard(CompoundGameComponent parent) //factory method h3h3h3
 {
     if (chessboard == null)
     {
         chessboard = new Chessboard(game, parent, checkers, models, chessboardTexture);
         if (game.Services.GetService(typeof(Chessboard)) != null)
         {
             game.Services.RemoveService(typeof(Chessboard));
         }
         game.Services.AddService(typeof(Chessboard), chessboard);
     }
     return(chessboard);
 }