Forráskód Böngészése

Push stack on gameOver with Setup

Nikatlas 6 éve
szülő
commit
a5edd9d30c

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 227 - 227
package-lock.json


+ 1 - 1
package.json

@@ -27,7 +27,7 @@
   },
   "devDependencies": {
     "eslint": "^4.19.0",
-    "eslint-plugin-react": "^7.7.0"
+    "eslint-plugin-react": "^7.11.1"
   },
   "proxy": {
     "/api": {

+ 11 - 11
src/App.js

@@ -7,17 +7,17 @@ import {UIRouter, UIView} from '@uirouter/react';
 import {router} from './router.config.js';
 
 class App extends Component {
-  render() {
-    return (
-      <MuiThemeProvider>
-        <UIRouter router={router}>
-          <div className="App">
-            <UIView />
-          </div>
-        </UIRouter>
-      </MuiThemeProvider>
-    );
-  }
+    render() {
+        return (
+            <MuiThemeProvider>
+                <UIRouter router={router}>
+                    <div className="App">
+                        <UIView />
+                    </div>
+                </UIRouter>
+            </MuiThemeProvider>
+        );
+    }
 }
 
 export default App;

+ 2 - 2
src/App.test.js

@@ -3,6 +3,6 @@ import ReactDOM from 'react-dom';
 import App from './App';
 
 it('renders without crashing', () => {
-  const div = document.createElement('div');
-  ReactDOM.render(<App />, div);
+    const div = document.createElement('div');
+    ReactDOM.render(<App />, div);
 });

+ 5 - 5
src/Game/assets/deck.js

@@ -1,13 +1,13 @@
 import * as PIXI from 'pixi.js';
 
 let Deck = {
-	Textures: [],
-	Filenames: []
+    Textures: [],
+    Filenames: []
 };
 for(var i=0;i<6;i++) {
-	let filename = '/files/assets/cards/sketches/' + i + '.png';
-	Deck.Filenames.push(filename);
-	Deck.Textures.push(PIXI.Texture.fromImage(filename));
+    let filename = '/files/assets/cards/sketches/' + i + '.png';
+    Deck.Filenames.push(filename);
+    Deck.Textures.push(PIXI.Texture.fromImage(filename));
 }
 
 export default Deck;

+ 9 - 9
src/Game/config.js

@@ -1,12 +1,12 @@
 let config = {
-	CARD: {
-		WIDTH: 494,
-		HEIGHT: 683,
-		OFFSET: {
-			X: 64,
-			Y: 67
-		}
-	}
-}
+    CARD: {
+        WIDTH: 494,
+        HEIGHT: 683,
+        OFFSET: {
+            X: 64,
+            Y: 67
+        }
+    }
+};
 
 export default config;

+ 1 - 1
src/Game/game/index.js

@@ -6,4 +6,4 @@ module.exports = {
     Card,
     GameMachine,
     GameMoves
-}
+};

+ 12 - 12
src/Game/game/machine/Booster.js

@@ -5,19 +5,19 @@ const SHA = CryptoJS.SHA256;
 // var salt = CryptoJS.lib.WordArray.random(128 / 8).toString();
 
 class Booster {
-	constructor(user) {
-		if(!user) throw Error("Booster must be owned by a user!");
-		this.id = this.randomID();
-		this.treasure = this.randomTreasure();
-		this.user = user;
-	}
+    constructor(user) {
+        if(!user) throw Error('Booster must be owned by a user!');
+        this.id = this.randomID();
+        this.treasure = this.randomTreasure();
+        this.user = user;
+    }
 
-	randomID() {
-		return CryptoJS.lib.WordArray.random(128 / 8).toString();
-	}
+    randomID() {
+        return CryptoJS.lib.WordArray.random(128 / 8).toString();
+    }
 
-	randomTreasure() {
-		return CryptoJS.lib.WordArray.random(256 / 8).toString();
-	}
+    randomTreasure() {
+        return CryptoJS.lib.WordArray.random(256 / 8).toString();
+    }
 }
 module.exports = Booster;

+ 10 - 10
src/Game/game/machine/BoosterService.js

@@ -2,22 +2,22 @@ let BoostersRepository = require('../../database').Repositories.Boosters;
 var Booster = require('./Booster');
 
 class BoosterService {
-	constructor() {
-	}
+    constructor() {
+    }
 
-	getUserBoosters(user) {
-		return BoostersRepository.getBoostersByUser(user);
-	}
+    getUserBoosters(user) {
+        return BoostersRepository.getBoostersByUser(user);
+    }
 
-	givePack(user) {
-		let {id, ...boosterdata} = new Booster(user);
-		return BoostersRepository.insert(id, boosterdata);
-	}
+    givePack(user) {
+        let {id, ...boosterdata} = new Booster(user);
+        return BoostersRepository.insert(id, boosterdata);
+    }
 }
 
 
 let service = null; 
 function getSingleton() { 
-	return service = (service === null ? new BoosterService() : service);
+    return service = (service === null ? new BoosterService() : service);
 }
 module.exports = getSingleton();

+ 12 - 3
src/Game/game/machine/GameMachine.js

@@ -8,22 +8,27 @@ const SHA256 = require('crypto-js/sha256');
 // Players can have their names placed on state.players on init, showing turns and colors
 
 class GameMachine {
-    constructor() {
+    constructor(setup) {
         this.state = {
             board: new Board(),
             players: [],
             hash: '0123456789',
+            setup: setup,
             stacks: {
                 moves: [],
                 hashes: []
             }
         };
+        this.setPlayers(setup.id);
     }
 
     getStack() {
         return {
-            moves: this.state.stacks.moves.map((move) => move.export()),
-            hashes: this.state.stacks.hashes
+            setup: this.state.setup,
+            stack: {
+                moves: this.state.stacks.moves.map((move) => move.export()),
+                hashes: this.state.stacks.hashes
+            }
         };
     }
 
@@ -52,6 +57,10 @@ class GameMachine {
         this.state = { ...this.state, players};
     }
 
+    getMyTeam(token) {
+        return this.state.setup.id.indexOf(token);
+    }
+
     getPlayerNumber(player) {
         return this.state.players[0] === player ? 0 : 1;
         // return this.state.players[0] === UserService.getUsername() ? 0 : 1;

+ 4 - 8
src/Game/services/GameService.js

@@ -6,8 +6,7 @@ class GameService {
     constructor() {
         this.state = {
             cards: [],
-            salts: [],
-            setup: {}
+            salts: []
         };
         this.stack = [];
 
@@ -15,13 +14,10 @@ class GameService {
     }
 
     init(game) {
-        this.GameMachine = new Game.GameMachine();
+        this.GameMachine = new Game.GameMachine(game.setup);
         this.stack = [];
         this.state.cards = game.cards.playerCardsArray;
         this.state.salts = game.cards.saltArray;
-        this.state.setup = game.setup;
-
-        this.GameMachine.setPlayers(game.setup.id);
 
         if(this.onInit) this.onInit();
         SocketService.on('move', (data) => this.move(data));
@@ -33,7 +29,7 @@ class GameService {
     }
 
     getMyTeam() {
-        return this.state.setup.id.indexOf(UserService.getToken());
+        return this.GameMachine.getMyTeam(UserService.getToken());
     }
 
     setLastTime(time) {
@@ -78,7 +74,7 @@ class GameService {
             SocketService.emit('broadcast', move);
             this.end();
         } catch(e) {
-            console.log("[ /!\\ ] GameService: Cannot run Reveal Move!");
+            console.log('[ /!\\ ] GameService: Cannot run Reveal Move!');
             throw e;
         }
     }

+ 5 - 5
src/Game/services/InputManager.test.js

@@ -1,14 +1,14 @@
-var InputManager = require("./InputManager");
+var InputManager = require('./InputManager');
 
 var Action = InputManager.Action;
 
-let ad = new Action("testad");
+let ad = new Action('testad');
 ad.addCondition('a', true);
 ad.addCondition('d', true);
 
-let a = new Action("testa");
+let a = new Action('testa');
 a.addCondition('a', true);
 a.addCondition('d', true);
 
-InputManager.onAction(ad, () => console.log("AD Action is here"));
-InputManager.onAction(a, () => console.log("A Action is here"));
+InputManager.onAction(ad, () => console.log('AD Action is here'));
+InputManager.onAction(a, () => console.log('A Action is here'));

+ 1 - 1
src/Game/services/SocketService.js

@@ -12,7 +12,7 @@ class SocketService {
     openSocket(channel) {
         if(this.socket)
             this.socket.disconnect();
-        this.socket = openSocket('http://localhost:3555/' + channel, { query: "token=" + UserService.getToken() });
+        this.socket = openSocket('http://localhost:3555/' + channel, { query: 'token=' + UserService.getToken() });
         this.on = this.socket.on.bind(this.socket);
         this.once = this.socket.once.bind(this.socket);
         this.emit = this.socket.emit.bind(this.socket);

+ 7 - 7
src/Game/services/index.js

@@ -6,10 +6,10 @@ var Network = require('./Net.js');
 var Injector = require('./Injector.js');
 
 module.exports = {
-	API, 
-	Event,
-	Gameloop,
-	Input,
-	Network,
-	Injector
-}
+    API, 
+    Event,
+    Gameloop,
+    Input,
+    Network,
+    Injector
+};

+ 1 - 1
src/Game/views/base/Card.js

@@ -172,7 +172,7 @@ class Card extends GuiableContainer{
 
     // Animate to Position
     moveTo(point, milliseconds=1000) {
-        if(typeof point === "undefined") {
+        if(typeof point === 'undefined') {
             return; // Some times this happens...
         }
         let path = new PIXI.tween.TweenPath();

+ 1 - 1
src/Game/views/base/CardCollection.js

@@ -21,7 +21,7 @@ class CardCollection extends GuiableContainer{
         this.x = x || 0;
         this.y = y || 0;
 
-          // GUI
+        // GUI
         this.addFolder('CardCollection');
         this.addToFolder('CardCollection', this, 'imageURL').onFinishChange((v) => this.loadImage(v));
         this.addToFolder('CardCollection', this, 'x').onFinishChange((v) => this.position.x = v);

+ 4 - 4
src/Game/views/base/CollectionDeck.js

@@ -44,26 +44,26 @@ class CollectionDeck extends GuiableContainer{
         this.sprite.width = w;
         this.sprite.height= h;
 
-        this.sprite.parentLayer = Injector.getByName("BackgroundLayer");
+        this.sprite.parentLayer = Injector.getByName('BackgroundLayer');
 
         this.addChild(this.sprite);
 
 
 
         let cardHolder1 = new CardHolder({GameLayer,'x':0,'y':-240,'s':0.30});
-        cardHolder1.parentLayer = Injector.getByName("MainLayer");
+        cardHolder1.parentLayer = Injector.getByName('MainLayer');
         this.addChild(cardHolder1);
         // let cardHolder2 = new CardHolder({GameLayer,'x':0,'y':-120,'s':0.30});
         // cardHolder2.parentLayer = Injector.getByName("TopLayer");
         // this.addChild(cardHolder2);
         let cardHolder3 = new CardHolder({GameLayer,'x':0,'y':0,'s':0.30});
-        cardHolder3.parentLayer = Injector.getByName("TopLayer");
+        cardHolder3.parentLayer = Injector.getByName('TopLayer');
         this.addChild(cardHolder3);
         // let cardHolder4 = new CardHolder({GameLayer,'x':0,'y':120,'s':0.30});
         // cardHolder4.parentLayer = Injector.getByName("TopLayer");
         // this.addChild(cardHolder4);
         let cardHolder5 = new CardHolder({GameLayer,'x':0,'y':240,'s':0.30});
-        cardHolder5.parentLayer = Injector.getByName("TopLayer");
+        cardHolder5.parentLayer = Injector.getByName('TopLayer');
         this.addChild(cardHolder5);
 
     }

+ 1 - 1
src/Game/views/base/ProgressBar.js

@@ -106,7 +106,7 @@ class ProgressBar extends GuiableContainer{
 
     // Animate to Position
     moveTo(point, milliseconds=1000) {
-        if(typeof point === "undefined") {
+        if(typeof point === 'undefined') {
             return; // Some times this happens...
         }
         let path = new PIXI.tween.TweenPath();

+ 1 - 1
src/Game/views/misc/Dialogue.js

@@ -16,7 +16,7 @@ class Dialogue extends PIXI.Sprite{
         this.imageURL = image || getParam('imageURL') || DefaultImageUrl;
         if(Gui) {
             this.Gui = Gui;
-            let folder = Gui.addFolder("Button");
+            let folder = Gui.addFolder('Button');
             this.controller = folder.add(this, 'imageURL').onFinishChange((v) => this.loadImage(v));
         }
 

A különbségek nem kerülnek megjelenítésre, a fájl túl nagy
+ 448 - 448
src/Game/views/misc/PixiTextInput.js


+ 2 - 2
src/helpers/draggable.js

@@ -1,6 +1,6 @@
 function draggable(sprite) {
-	sprite
-		// events for drag start
+    sprite
+    // events for drag start
         .on('mousedown', onDragStart)
         .on('touchstart', onDragStart)
         // events for drag end

+ 69 - 69
src/helpers/generator.js

@@ -1,92 +1,92 @@
 function Ziggurat(seeder = 123456789){
 
-  var jsr = seeder;
+    var jsr = seeder;
 
-  var wn = Array(128);
-  var fn = Array(128);
-  var kn = Array(128);
+    var wn = Array(128);
+    var fn = Array(128);
+    var kn = Array(128);
 
-  function RNOR(){
-    var hz = SHR3();
-    var iz = hz & 127;
-    return (Math.abs(hz) < kn[iz]) ? hz * wn[iz] : nfix(hz, iz);
-  }
+    function RNOR(){
+        var hz = SHR3();
+        var iz = hz & 127;
+        return (Math.abs(hz) < kn[iz]) ? hz * wn[iz] : nfix(hz, iz);
+    }
 
-  this.nextGaussian = function(){
-    return RNOR();
-  }
+    this.nextGaussian = function(){
+        return RNOR();
+    };
 
-  function nfix(hz, iz){
-    var r = 3.442619855899;
-    var r1 = 1.0 / r;
-    var x;
-    var y;
-    while(true){
-      x = hz * wn[iz];
-      if( iz === 0 ){
-        x = (-Math.log(UNI()) * r1); 
-        y = -Math.log(UNI());
-        while( y + y < x * x){
-          x = (-Math.log(UNI()) * r1); 
-          y = -Math.log(UNI());
-        }
-        return ( hz > 0 ) ? r+x : -r-x;
-      }
+    function nfix(hz, iz){
+        var r = 3.442619855899;
+        var r1 = 1.0 / r;
+        var x;
+        var y;
+        while(true){
+            x = hz * wn[iz];
+            if( iz === 0 ){
+                x = (-Math.log(UNI()) * r1); 
+                y = -Math.log(UNI());
+                while( y + y < x * x){
+                    x = (-Math.log(UNI()) * r1); 
+                    y = -Math.log(UNI());
+                }
+                return ( hz > 0 ) ? r+x : -r-x;
+            }
 
-      if( fn[iz] + UNI() * (fn[iz-1] - fn[iz]) < Math.exp(-0.5 * x * x) ){
-         return x;
-      }
-      hz = SHR3();
-      iz = hz & 127;
+            if( fn[iz] + UNI() * (fn[iz-1] - fn[iz]) < Math.exp(-0.5 * x * x) ){
+                return x;
+            }
+            hz = SHR3();
+            iz = hz & 127;
  
-      if( Math.abs(hz) < kn[iz]){
-        return (hz * wn[iz]);
-      }
+            if( Math.abs(hz) < kn[iz]){
+                return (hz * wn[iz]);
+            }
+        }
     }
-  }
 
-  function SHR3(){
-    var jz = jsr;
-    var jzr = jsr;
-    jzr ^= (jzr << 13);
-    jzr ^= (jzr >>> 17);
-    jzr ^= (jzr << 5);
-    jsr = jzr;
-    return (jz+jzr) | 0;
-  }
+    function SHR3(){
+        var jz = jsr;
+        var jzr = jsr;
+        jzr ^= (jzr << 13);
+        jzr ^= (jzr >>> 17);
+        jzr ^= (jzr << 5);
+        jsr = jzr;
+        return (jz+jzr) | 0;
+    }
 
-  function UNI(){
-    return 0.5 * (1 + SHR3() / -Math.pow(2,31));
-  }
+    function UNI(){
+        return 0.5 * (1 + SHR3() / -Math.pow(2,31));
+    }
 
-  function zigset(){
+    function zigset(){
     // seed generator based on current time
     //jsr ^= new Date().getTime();
 
-    var m1 = 2147483648.0;
-    var dn = 3.442619855899;
-    var tn = dn;
-    var vn = 9.91256303526217e-3;
+        var m1 = 2147483648.0;
+        var dn = 3.442619855899;
+        var tn = dn;
+        var vn = 9.91256303526217e-3;
     
-    var q = vn / Math.exp(-0.5 * dn * dn);
-    kn[0] = Math.floor((dn/q)*m1);
-    kn[1] = 0;
+        var q = vn / Math.exp(-0.5 * dn * dn);
+        kn[0] = Math.floor((dn/q)*m1);
+        kn[1] = 0;
 
-    wn[0] = q / m1;
-    wn[127] = dn / m1;
+        wn[0] = q / m1;
+        wn[127] = dn / m1;
 
-    fn[0] = 1.0;
-    fn[127] = Math.exp(-0.5 * dn * dn);
+        fn[0] = 1.0;
+        fn[127] = Math.exp(-0.5 * dn * dn);
 
-    for(var i = 126; i >= 1; i--){
-      dn = Math.sqrt(-2.0 * Math.log( vn / dn + Math.exp( -0.5 * dn * dn)));
-      kn[i+1] = Math.floor((dn/tn)*m1);
-      tn = dn;
-      fn[i] = Math.exp(-0.5 * dn * dn);
-      wn[i] = dn / m1;
+        for(var i = 126; i >= 1; i--){
+            dn = Math.sqrt(-2.0 * Math.log( vn / dn + Math.exp( -0.5 * dn * dn)));
+            kn[i+1] = Math.floor((dn/tn)*m1);
+            tn = dn;
+            fn[i] = Math.exp(-0.5 * dn * dn);
+            wn[i] = dn / m1;
+        }
     }
-  }
-  zigset();
+    zigset();
 }
 
 module.exports = Ziggurat;

+ 74 - 74
src/registerServiceWorker.js

@@ -9,100 +9,100 @@
 // This link also includes instructions on opting out of this behavior.
 
 const isLocalhost = Boolean(
-  window.location.hostname === 'localhost' ||
+    window.location.hostname === 'localhost' ||
     // [::1] is the IPv6 localhost address.
     window.location.hostname === '[::1]' ||
     // 127.0.0.1/8 is considered localhost for IPv4.
     window.location.hostname.match(
-      /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
+        /^127(?:\.(?:25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?)){3}$/
     )
 );
 
 export default function register() {
-  if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
+    if (process.env.NODE_ENV === 'production' && 'serviceWorker' in navigator) {
     // The URL constructor is available in all browsers that support SW.
-    const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
-    if (publicUrl.origin !== window.location.origin) {
-      // Our service worker won't work if PUBLIC_URL is on a different origin
-      // from what our page is served on. This might happen if a CDN is used to
-      // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
-      return;
-    }
+        const publicUrl = new URL(process.env.PUBLIC_URL, window.location);
+        if (publicUrl.origin !== window.location.origin) {
+            // Our service worker won't work if PUBLIC_URL is on a different origin
+            // from what our page is served on. This might happen if a CDN is used to
+            // serve assets; see https://github.com/facebookincubator/create-react-app/issues/2374
+            return;
+        }
 
-    window.addEventListener('load', () => {
-      const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
+        window.addEventListener('load', () => {
+            const swUrl = `${process.env.PUBLIC_URL}/service-worker.js`;
 
-      if (isLocalhost) {
-        // This is running on localhost. Lets check if a service worker still exists or not.
-        checkValidServiceWorker(swUrl);
-      } else {
-        // Is not local host. Just register service worker
-        registerValidSW(swUrl);
-      }
-    });
-  }
+            if (isLocalhost) {
+                // This is running on localhost. Lets check if a service worker still exists or not.
+                checkValidServiceWorker(swUrl);
+            } else {
+                // Is not local host. Just register service worker
+                registerValidSW(swUrl);
+            }
+        });
+    }
 }
 
 function registerValidSW(swUrl) {
-  navigator.serviceWorker
-    .register(swUrl)
-    .then(registration => {
-      registration.onupdatefound = () => {
-        const installingWorker = registration.installing;
-        installingWorker.onstatechange = () => {
-          if (installingWorker.state === 'installed') {
-            if (navigator.serviceWorker.controller) {
-              // At this point, the old content will have been purged and
-              // the fresh content will have been added to the cache.
-              // It's the perfect time to display a "New content is
-              // available; please refresh." message in your web app.
-              console.log('New content is available; please refresh.');
-            } else {
-              // At this point, everything has been precached.
-              // It's the perfect time to display a
-              // "Content is cached for offline use." message.
-              console.log('Content is cached for offline use.');
-            }
-          }
-        };
-      };
-    })
-    .catch(error => {
-      console.error('Error during service worker registration:', error);
-    });
+    navigator.serviceWorker
+        .register(swUrl)
+        .then(registration => {
+            registration.onupdatefound = () => {
+                const installingWorker = registration.installing;
+                installingWorker.onstatechange = () => {
+                    if (installingWorker.state === 'installed') {
+                        if (navigator.serviceWorker.controller) {
+                            // At this point, the old content will have been purged and
+                            // the fresh content will have been added to the cache.
+                            // It's the perfect time to display a "New content is
+                            // available; please refresh." message in your web app.
+                            console.log('New content is available; please refresh.');
+                        } else {
+                            // At this point, everything has been precached.
+                            // It's the perfect time to display a
+                            // "Content is cached for offline use." message.
+                            console.log('Content is cached for offline use.');
+                        }
+                    }
+                };
+            };
+        })
+        .catch(error => {
+            console.error('Error during service worker registration:', error);
+        });
 }
 
 function checkValidServiceWorker(swUrl) {
-  // Check if the service worker can be found. If it can't reload the page.
-  fetch(swUrl)
-    .then(response => {
-      // Ensure service worker exists, and that we really are getting a JS file.
-      if (
-        response.status === 404 ||
+    // Check if the service worker can be found. If it can't reload the page.
+    fetch(swUrl)
+        .then(response => {
+            // Ensure service worker exists, and that we really are getting a JS file.
+            if (
+                response.status === 404 ||
         response.headers.get('content-type').indexOf('javascript') === -1
-      ) {
-        // No service worker found. Probably a different app. Reload the page.
-        navigator.serviceWorker.ready.then(registration => {
-          registration.unregister().then(() => {
-            window.location.reload();
-          });
+            ) {
+                // No service worker found. Probably a different app. Reload the page.
+                navigator.serviceWorker.ready.then(registration => {
+                    registration.unregister().then(() => {
+                        window.location.reload();
+                    });
+                });
+            } else {
+                // Service worker found. Proceed as normal.
+                registerValidSW(swUrl);
+            }
+        })
+        .catch(() => {
+            console.log(
+                'No internet connection found. App is running in offline mode.'
+            );
         });
-      } else {
-        // Service worker found. Proceed as normal.
-        registerValidSW(swUrl);
-      }
-    })
-    .catch(() => {
-      console.log(
-        'No internet connection found. App is running in offline mode.'
-      );
-    });
 }
 
 export function unregister() {
-  if ('serviceWorker' in navigator) {
-    navigator.serviceWorker.ready.then(registration => {
-      registration.unregister();
-    });
-  }
+    if ('serviceWorker' in navigator) {
+        navigator.serviceWorker.ready.then(registration => {
+            registration.unregister();
+        });
+    }
 }

+ 1 - 1
src/router.config.js

@@ -17,7 +17,7 @@ appStates.forEach(state => router.stateRegistry.register(state));
 router.urlService.config.baseHref('/');
 
 router.urlService.rules.initial({ 
-	state: 'home' 
+    state: 'home' 
 });
 
 // Start the router

+ 20 - 20
src/states.js

@@ -4,24 +4,24 @@ import Playground from './components/Playground';
 import Stats from './components/Stats';
 
 export default [
-{
-  name : "home",
-  url  : "/home",
-  component: Home
-},
-{
-  name : 'game',
-  url  : '/game',
-  component: Game
-},
-{
-  name : 'playground',
-  url  : '/playground',
-  component: Playground
-},
-{
-  name : 'stats',
-  url  : '/stats',
-  component: Stats
-}
+    {
+        name : 'home',
+        url  : '/home',
+        component: Home
+    },
+    {
+        name : 'game',
+        url  : '/game',
+        component: Game
+    },
+    {
+        name : 'playground',
+        url  : '/playground',
+        component: Playground
+    },
+    {
+        name : 'stats',
+        url  : '/stats',
+        component: Stats
+    }
 ];

Nem az összes módosított fájl került megjelenítésre, mert túl sok fájl változott