From c8028c9192105086b00062c472130289c577e36d Mon Sep 17 00:00:00 2001 From: Vasiliy Kostin Date: Sun, 17 Sep 2017 17:55:31 +0500 Subject: [PATCH 1/5] Copy constructors for Elevator and Passenger fix --- clients/nodejs_client/client/core/api.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clients/nodejs_client/client/core/api.js b/clients/nodejs_client/client/core/api.js index 8b1f9a5..4aa2916 100644 --- a/clients/nodejs_client/client/core/api.js +++ b/clients/nodejs_client/client/core/api.js @@ -1,5 +1,5 @@ class Elevator { - constructor({id, y, passengers, state, speed, floor, next_floor, time_on_floor, type}) { + constructor({id, y, passengers, state, speed, floor, nextFloor, timeOnFloor, type}) { this.id = id; this._y = y; this._passengers = passengers.map((passenger) => { @@ -8,8 +8,8 @@ class Elevator { this._state = state; this._speed = speed; this._floor = floor; - this._nextFloor = next_floor; - this._timeOnFloor = time_on_floor; + this._nextFloor = nextFloor; + this._timeOnFloor = timeOnFloor; this._type = type; this._messages = []; } @@ -66,12 +66,12 @@ class Elevator { } class Passenger { - constructor({id, elevator, x, y, state, time_to_away, from_floor, dest_floor, type, floor}) { + constructor({id, elevator, x, y, state, timeToAway, fromFloor, destFloor, type, floor}) { this.id = id; this._elevator = elevator; - this._fromFloor = from_floor; - this._destFloor = dest_floor; - this._timeToAway = time_to_away; + this._fromFloor = fromFloor; + this._destFloor = destFloor; + this._timeToAway = timeToAway; this._state = state; this._floor = floor; this._type = type; From d2d76f01dbf3b57c769253f95b1a991fc2ad92de Mon Sep 17 00:00:00 2001 From: Vasiliy Kostin Date: Sun, 17 Sep 2017 18:43:05 +0500 Subject: [PATCH 2/5] this.debug.log fix [node.js] MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Нет возможности отладить, но должно сработать. --- clients/nodejs_client/client/core/basestrategy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/nodejs_client/client/core/basestrategy.js b/clients/nodejs_client/client/core/basestrategy.js index c834ccf..6ac3a05 100644 --- a/clients/nodejs_client/client/core/basestrategy.js +++ b/clients/nodejs_client/client/core/basestrategy.js @@ -1,6 +1,6 @@ class BaseStrategy { constructor(debug) { - this.debug = debug.log.bind(debug); + this.debug = debug; } onTick(myPassengers, myElevators, enemyPassengers, enemyElevators) { From d391f93022e9d1638e77aaca325b308c1b420662 Mon Sep 17 00:00:00 2001 From: Vasiliy Kostin Date: Sun, 17 Sep 2017 18:58:11 +0500 Subject: [PATCH 3/5] Undo latest commit. --- clients/nodejs_client/client/core/basestrategy.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/nodejs_client/client/core/basestrategy.js b/clients/nodejs_client/client/core/basestrategy.js index 6ac3a05..c834ccf 100644 --- a/clients/nodejs_client/client/core/basestrategy.js +++ b/clients/nodejs_client/client/core/basestrategy.js @@ -1,6 +1,6 @@ class BaseStrategy { constructor(debug) { - this.debug = debug; + this.debug = debug.log.bind(debug); } onTick(myPassengers, myElevators, enemyPassengers, enemyElevators) { From e6922c843b96adfcaac476763d864579cd0aa150 Mon Sep 17 00:00:00 2001 From: Vasiliy Kostin Date: Sun, 17 Sep 2017 21:11:11 +0500 Subject: [PATCH 4/5] verbose exception logger --- clients/nodejs_client/client/core/api.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/clients/nodejs_client/client/core/api.js b/clients/nodejs_client/client/core/api.js index 4aa2916..06e4198 100644 --- a/clients/nodejs_client/client/core/api.js +++ b/clients/nodejs_client/client/core/api.js @@ -153,7 +153,7 @@ class Debug { this._messages.push({ 'command': 'log', 'args': { - 'text': String(text) + 'text': String(text.stack || text) } }) } From f6c014f9b32955f2c295e78cc938de3f7b599e7a Mon Sep 17 00:00:00 2001 From: Vasiliy Kostin Date: Tue, 19 Sep 2017 14:17:33 +0500 Subject: [PATCH 5/5] undo commit --- clients/nodejs_client/client/core/api.js | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/clients/nodejs_client/client/core/api.js b/clients/nodejs_client/client/core/api.js index 06e4198..6b0249c 100644 --- a/clients/nodejs_client/client/core/api.js +++ b/clients/nodejs_client/client/core/api.js @@ -1,5 +1,5 @@ class Elevator { - constructor({id, y, passengers, state, speed, floor, nextFloor, timeOnFloor, type}) { + constructor({id, y, passengers, state, speed, floor, next_floor, time_on_floor, type}) { this.id = id; this._y = y; this._passengers = passengers.map((passenger) => { @@ -8,8 +8,8 @@ class Elevator { this._state = state; this._speed = speed; this._floor = floor; - this._nextFloor = nextFloor; - this._timeOnFloor = timeOnFloor; + this._nextFloor = next_floor; + this._timeOnFloor = time_on_floor; this._type = type; this._messages = []; } @@ -66,12 +66,12 @@ class Elevator { } class Passenger { - constructor({id, elevator, x, y, state, timeToAway, fromFloor, destFloor, type, floor}) { + constructor({id, elevator, x, y, state, time_to_away, from_floor, dest_floor, type, floor}) { this.id = id; this._elevator = elevator; - this._fromFloor = fromFloor; - this._destFloor = destFloor; - this._timeToAway = timeToAway; + this._fromFloor = from_floor; + this._destFloor = dest_floor; + this._timeToAway = time_to_away; this._state = state; this._floor = floor; this._type = type;