UNPKG

transformice.js

Version:

Node.js client for Transformice with full Typescript support.

59 lines (58 loc) 2.1 kB
"use strict"; var __extends = (this && this.__extends) || (function () { var extendStatics = function (d, b) { extendStatics = Object.setPrototypeOf || ({ __proto__: [] } instanceof Array && function (d, b) { d.__proto__ = b; }) || function (d, b) { for (var p in b) if (Object.prototype.hasOwnProperty.call(b, p)) d[p] = b[p]; }; return extendStatics(d, b); }; return function (d, b) { extendStatics(d, b); function __() { this.constructor = d; } d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __()); }; })(); var __importDefault = (this && this.__importDefault) || function (mod) { return (mod && mod.__esModule) ? mod : { "default": mod }; }; Object.defineProperty(exports, "__esModule", { value: true }); var Player_1 = __importDefault(require("./Player")); /** Represents a friend from the friend list */ var Friend = /** @class */ (function (_super) { __extends(Friend, _super); /** * @hidden */ function Friend(client) { var _this = _super.call(this, client) || this; _this.id = 0; _this.gender = 0; _this.isSoulmate = false; _this.hasAddedBack = false; _this.isConnected = false; _this.community = 0; _this.roomName = ""; _this.lastConnection = 0; return _this; } /** * Returns friend data from a packet * * @hidden */ Friend.prototype.read = function (packet, isSoulmate) { this.id = packet.readInt(); this.name = packet.readUTF(); this.gender = packet.readByte(); packet.readInt(); // ? this.isSoulmate = isSoulmate; this.hasAddedBack = packet.readBoolean(); this.isConnected = packet.readBoolean(); this.community = packet.readInt(); this.roomName = packet.readUTF(); this.lastConnection = packet.readInt(); return this; }; return Friend; }(Player_1.default)); exports.default = Friend;