Esempio n. 1
0
        private bool CreateBoard()
        {
            Bitmap mapImg = null;

            if (m_configHandler.MapOrigin == "generate")    //don't use generated filed in bomberman game
            {
                //mapSize = m_configHandler.MapSize;
            }
            else if (m_configHandler.MapOrigin == "file")
            {
                string path = "../../Resources/";
                path  += m_configHandler.MapPath;
                mapImg = new Bitmap(path);
                //MapLoader loader = new MapLoader(m_configHandler.MapPath);
                //mapSize = loader.MapSize;
            }
            else
            {
                throw new Exception("Invalid value provided for 'mapOrigin' config.");
            }

            Func <int, int, BombermanBasics.Field> allocateField = (int x, int y) =>
            {
                return(new Bomberman.Field(m_configHandler.Teams.Count, x, y));  //TODO: complete constructor like BombermanBasics.Field
            };

            m_gameBoard = new GameBoard(mapImg, allocateField);
            putTeamsToBoardOnGameStart();

            return(true);
        }
Esempio n. 2
0
 public Explosion(GameBoard gameBoard, Bomb explodedBomb)
 {
     m_radius       = explodedBomb.getExplosiveRadius();
     m_explodedBomb = explodedBomb;
     m_gameBoard    = gameBoard;
 }