Skip to content

Commit

Permalink
JSDoc additions and changes
Browse files Browse the repository at this point in the history
  • Loading branch information
haykam821 committed Jul 11, 2018
1 parent 1832967 commit 4fa9512
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion index.js
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ const waitUntil = require("async-wait-until");
const msgpack = require("msgpack");

/**
* An event representing a raw websocket message.
* An event representing a message from the Moomoo.io server.
*/
class RawMessageEvent extends events.Event {
constructor(msg) {
Expand Down Expand Up @@ -71,6 +71,11 @@ class MoomooClient extends events.EventTarget {
}]);
}

/**
* Controls the direction of the client.
* @param {number} direction The direction to face.
* @param {boolean} move Whether we should also move in the direction.
*/
direction(direction = 0, move = false) {
this.send("2", [
direction,
Expand All @@ -80,6 +85,15 @@ class MoomooClient extends events.EventTarget {
]);
}

/**
* Stops movement.
*/
stopMovement() {
this.send("3", [
null,
]);
}

/**
* Sends a ping on the minimap.
*/
Expand All @@ -89,6 +103,10 @@ class MoomooClient extends events.EventTarget {
]);
}

/**
* Joins a tribe by its name.
* @param {string} tribeName The name of the tribe to join.
*/
joinTribe(tribeName) {
this.send("10", [
tribeName,
Expand Down

0 comments on commit 4fa9512

Please sign in to comment.