-
Notifications
You must be signed in to change notification settings - Fork 6
/
Copy pathindex.js
119 lines (109 loc) · 4.4 KB
/
index.js
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
/**
* Main Banchojs class
* @prop {BanchoClient} BanchoClient The BanchoClient class (Client alias is kept for history purposes)
* @prop {OutgoingBanchoMessage} OutgoingBanchoMessage The OutgoingMessage class to produce messages
* @prop {ConnectStates} ConnectStates An enum containing all the possible ConnectStates of bancho.js
* @prop {BanchoLobbyPlayerStates} BanchoLobbyPlayerStates An enum containing the different player states for players in lobbies
* @prop {BanchoLobbyTeamModes} BanchoLobbyTeamModes An enum containing the 4 different team modes in Bancho
* @prop {BanchoLobbyTeams} BanchoLobbyTeams An enum containing the 2 different teams in a multiplayer lobby
* @prop {BanchoLobbyWinConditions} BanchoLobbyWinConditions An enum containing the 4 win conditions on Bancho
*/
class Banchojs {
constructor() {
this.Client = this.BanchoClient = require("./lib/BanchoClient");
this.BanchoMessage = require("./lib/BanchoMessage");
this.PrivateMessage = require("./lib/PrivateMessage");
this.ChannelMessage = require("./lib/ChannelMessage");
this.OutgoingBanchoMessage = require("./lib/OutgoingBanchoMessage");
this.ConnectStates = require("./lib/Enums/ConnectStates");
this.BanchoLobbyPlayerStates = require("./lib/Multiplayer/Enums/BanchoLobbyPlayerStates");
this.BanchoLobbyTeamModes = require("./lib/Multiplayer/Enums/BanchoLobbyTeamModes");
this.BanchoLobbyTeams = require("./lib/Multiplayer/Enums/BanchoLobbyTeams");
this.BanchoLobbyWinConditions = require("./lib/Multiplayer/Enums/BanchoLobbyWinConditions");
this.BanchoMods = require("./lib/Multiplayer/Enums/BanchoMods");
this.BanchoUser = require("./lib/BanchoUser");
this.BanchoWhoisReturn = require("./lib/IrcCommands/whois/BanchoWhoisReturn");
this.BanchoBotStatsReturn = require("./lib/StatsCommand/BanchoBotStatsReturn");
this.BanchoChannel = require("./lib/BanchoChannel");
this.BanchoMultiplayerChannel = require("./lib/BanchoMultiplayerChannel");
this.BanchoLobby = require("./lib/Multiplayer/BanchoLobby");
this.BanchoLobbyPlayer = require("./lib/Multiplayer/BanchoLobbyPlayer");
this.BanchoLobbyPlayerScore = require("./lib/Multiplayer/BanchoLobbyPlayerScore");
this.BanchoMod = require("./lib/Multiplayer/BanchoMod");
this.BanchoChannelMemberMode = require("./lib/BanchoChannelMemberMode");
this.BanchoChannelMember = require("./lib/BanchoChannelMember");
}
/**
* Compares the provided object and return true if the object is an instance of BanchoMod.
*
* @param {any} mod
*/
isBanchoMod(mod) {
return mod instanceof require("./lib/Multiplayer/BanchoMod");
}
/**
* Compares the provided object and return true if the object is an instance of BanchoUser.
*
* @param {any} user
*/
isBanchoUser(user) {
return user instanceof require("./lib/BanchoUser");
}
/**
* Compares the provided object and return true if the object is an instance of BanchoChannel.
*
* @param {any} channel
*/
isBanchoChannel(channel) {
return channel instanceof require("./lib/BanchoChannel");
}
/**
* Compares the provided object and return true if the object is an instance of BanchoMultiplayerChannel.
*
* @param {any} channel
*/
isBanchoMultiplayerChannel(channel) {
return channel instanceof require("./lib/BanchoMultiplayerChannel");
}
/**
* Compares the provided object and return true if the object is an instance of BanchoLobby.
*
* @param {any} lobby
*/
isBanchoLobby(lobby) {
return lobby instanceof require("./lib/Multiplayer/BanchoLobby");
}
/**
* Compares the provided object and return true if the object is an instance of BanchoChannelMember.
*
* @param {any} member
*/
isBanchoChannelMember(member) {
return member instanceof require("./lib/BanchoChannelMember");
}
/**
* Compares the provided object and return true if the object is an instance of BanchoMessage.
*
* @param {any} message
*/
isBanchoMessage(message) {
return message instanceof require("./lib/BanchoMessage");
}
/**
* Compares the provided object and return true if the object is an instance of ChannelMessage.
*
* @param {any} message
*/
isChannelMessage(message) {
return message instanceof require("./lib/ChannelMessage");
}
/**
* Compares the provided object and return true if the object is an instance of PrivateMessage.
*
* @param {any} message
*/
isPrivateMessage(message) {
return message instanceof require("./lib/PrivateMessage");
}
}
module.exports = new Banchojs();