@unitn-asa/deliveroo-js-sdk 1.3.5 → 1.3.10

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@unitn-asa/deliveroo-js-sdk",
3
- "version": "1.3.5",
3
+ "version": "1.3.10",
4
4
  "description": "Software development kit for Deliveroo.js",
5
5
  "author": "Marco Robol <marco.robol@unitn.it>",
6
6
  "type": "module",
@@ -254,6 +254,14 @@ export class DjsServerSocket extends Socket {
254
254
  super.on( 'restart', callback );
255
255
  }
256
256
 
257
+ /**
258
+ * Process request for rewarding an agent with a certain amount of points
259
+ * @param { function ( {agentId: string, points: number} ) : void } callback
260
+ */
261
+ onReward ( callback ) {
262
+ super.on( 'reward', callback );
263
+ }
264
+
257
265
 
258
266
 
259
267
  /**
@@ -1,6 +1,6 @@
1
1
 
2
2
  /**
3
- * @typedef { 'frame' | '1s' | '2s' | '5s' | '10s' | 'infinite' } IOClockEvent
3
+ * @typedef { 'frame' | '1s' | '2s' | '5s' | '10s' | '1m' | '1h' | 'infinite' } IOClockEvent
4
4
  */
5
5
 
6
6
 
@@ -10,7 +10,7 @@
10
10
  * @returns { IOClockEvent }
11
11
  */
12
12
  function parseClockEvent ( event ) {
13
- if ( event == 'frame' || event == '1s' || event == '2s' || event == '5s' || event == '10s' || event == 'infinite' )
13
+ if ( event == 'frame' || event == '1s' || event == '2s' || event == '5s' || event == '10s' || event == '1m' || event == '1h' || event == 'infinite' )
14
14
  return event;
15
15
  else
16
16
  console.warn( `IOClockEvent: invalid event '${event}', defaulting to '1s'` );
@@ -20,6 +20,7 @@
20
20
  * 'crate': function ( 'create' | 'dispose', { x:number, y:number } ) : void,
21
21
  * 'restart': function () : void,
22
22
  * 'tile': function ( IOTile ) : void,
23
+ * 'reward': function ( { agentId: string, points: number } ) : void,
23
24
  * 'log': function ( ...any ) : void
24
25
  * }} IOClientEvents
25
26
  */