]> git.xn--bdkaa.com Git - where-are-you.py.git/commitdiff
init varlamov
authorEvgenii Akentev <i@ak3n.com>
Sun, 19 May 2019 00:17:43 +0000 (03:17 +0300)
committerEvgenii Akentev <i@ak3n.com>
Sun, 19 May 2019 00:18:47 +0000 (03:18 +0300)
src/Game.js
src/GameController.js
src/img/varlamov.png [new file with mode: 0644]

index 8e9b9bd449fc3e0591e027593e26e161028c01c1..c4d46e2f00f4732d1ff589000fb1c53ae04d3cfc 100644 (file)
@@ -2,6 +2,7 @@ import React, { Component } from 'react';
 
 import { AppLayout } from './AppLayout';
 import logo from './img/cat.png';
+import varlamov from './img/varlamov.png';
 import { createMap } from './createMap';
 import { GameController } from './GameController';
 import { Notification } from './Notification';
@@ -11,6 +12,10 @@ export class Game extends Component {
   constructor(props) {
     super(props);
     this.notification = new Notification();
+    this.handleVarlamov = function(tips) {
+      console.log(tips);
+      return tips;
+    }
     this.gameController = new GameController(this.notification);
     this.state = {
       tips: this.gameController.tips(),
@@ -21,7 +26,7 @@ export class Game extends Component {
   componentDidMount() {
     this.gameController.createGame().then(() => this.gameController.loadTips()).then(() => {
       this.setState({
-        tips: this.gameController.tips(),
+        tips: this.handleVarlamov(this.gameController.tips()),
         loading: false
       }, () => {
         createMap('map', this.onMapClick);
@@ -37,7 +42,7 @@ export class Game extends Component {
   askTip = () => {
     this.gameController.getMoreTips().then(() => {
       this.setState({
-        tips: this.gameController.tips()
+        tips: this.handleVarlamov(this.gameController.tips())
       })
     }).catch(error => {
       this.notification.show(
@@ -50,7 +55,7 @@ export class Game extends Component {
   move = () => {
     this.gameController.goForward().then(() => {
       this.setState({
-        tips: this.gameController.tips()
+        tips: this.handleVarlamov(this.gameController.tips())
       })
     }).catch(error => {
       this.notification.show(
index b14f2ca07abea51b5e8a27b84b7598d3d65a4a9c..7ad696e3d0b5c1d8a92b52d2951c53ffd2a47a3a 100644 (file)
@@ -44,4 +44,4 @@ export class GameController {
   tryFinish(ltLng) {
     return api.post(`/games/${this.gameId}/finish/${ltLng}`);
   }
-}
\ No newline at end of file
+}
diff --git a/src/img/varlamov.png b/src/img/varlamov.png
new file mode 100644 (file)
index 0000000..d56e70f
Binary files /dev/null and b/src/img/varlamov.png differ