/**
 *
 * @author Ananaskelly
 */
define(['./gameConfig'], function (gameConfig) {
    return {
        compile: function () {
            $('.cell').has('div.figure').addClass('busy');
            var userId = $('.board').attr('data-user');
            var white = $('.board').attr('data-player-white');
            var black = $('.board').attr('data-player-black');
            var userBlack = $('.board').attr('data-player-login-black');
            var userWhite = $('.board').attr('data-player-login-white');
            if (userId === white || userId === black) {
                if (userId === white) {
                    gameConfig.setConfig('userState', 'white');
                    gameConfig.setConfig('revert', true);
                    $('#user1').attr('data-color', 'black');
                    $('#user2').attr('data-color', 'white');
                    $('#user1-img').attr('src', '/img/black.png');
                    $('#user2-img').attr('src', '/img/white.png');
                } else {
                    gameConfig.setConfig('userState', 'black');
                    $('#user1').attr('data-color', 'white');
                    $('#user2').attr('data-color', 'black');
                    $('#user2-img').attr('src', '/img/black.png');
                    $('#user1-img').attr('src', '/img/white.png');
                }
                $('[data-color=black]').text(userBlack);
                $('[data-color=white]').text(userWhite);
            }
        }
    }
})


@@ -116,24 +116,257 @@
 nction () %7B%0A
+            var currentTurn = $('.game-info').attr('data-turn');%0A            if (parseInt(currentTurn)%252 !== 0) %7B%0A                gameConfig.setConfig('current', 1);%0A                gameConfig.setConfig('opposite', 0);%0A            %7D%0A
             
@@ -408,24 +408,24 @@
 ss('busy');%0A
-
             
@@ -954,24 +954,130 @@
 rt', true);%0A
+                    $('.up').addClass('hit-white');%0A                    $('.down').addClass('hit-black');%0A
             
@@ -1345,16 +1345,16 @@
  else %7B%0A
-
         
@@ -1401,32 +1401,138 @@
 ate', 'black');%0A
+                    $('.up').addClass('hit-black');%0A                    $('.down').addClass('hit-white');%0A
                 

revert fields for killed figures