forked from malvadsold/AgarRepacker
-
Notifications
You must be signed in to change notification settings - Fork 0
/
cell.js
38 lines (38 loc) · 962 Bytes
/
cell.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
class Cell {
constructor(){
this.id = 0
this.isVirus = false
this.isEjected = false
this.isAgitated = false
this.isEnemyEject = false
this.isPellet = false
this.flags = 0
this.extendedFlags = 0
this.hasExtendedFlags = false
this.colors = false
this.nick = ''
this.skin = ''
this.size = 0
this.mass = 0
this.r = 0
this.g = 0
this.b = 0
}
setColor(r,g,b){
if(!this.colors){
this.r = r
this.g = g
this.b = b
this.colors = true
}
}
setStrings(skin, name){
this.skin == '' ? this.skin = skin : this.skin = this.skin
this.nick == '' ? this.nick = name : this.nick = this.nick
}
setSize(size){
this.size = size
this.mass = (size * size) / 100
}
}
module.exports = Cell