2018-07-06 13:30:00 +00:00
|
|
|
package com.eu.habbo.habbohotel.rooms;
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public class RoomMoodlightData {
|
2018-07-06 13:30:00 +00:00
|
|
|
private int id;
|
|
|
|
private boolean enabled;
|
|
|
|
private boolean backgroundOnly;
|
|
|
|
private String color;
|
|
|
|
private int intensity;
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public RoomMoodlightData(int id, boolean enabled, boolean backgroundOnly, String color, int intensity) {
|
2018-07-06 13:30:00 +00:00
|
|
|
this.id = id;
|
|
|
|
this.enabled = enabled;
|
|
|
|
this.backgroundOnly = backgroundOnly;
|
|
|
|
this.color = color;
|
|
|
|
this.intensity = intensity;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public static RoomMoodlightData fromString(String s) {
|
|
|
|
String[] data = s.split(",");
|
|
|
|
|
|
|
|
if (data.length == 5) {
|
|
|
|
return new RoomMoodlightData(Integer.valueOf(data[1]), data[0].equalsIgnoreCase("2"), data[2].equalsIgnoreCase("2"), data[3], Integer.valueOf(data[4]));
|
|
|
|
} else {
|
|
|
|
return new RoomMoodlightData(1, true, true, "#000000", 255);
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
public int getId() {
|
2018-07-06 13:30:00 +00:00
|
|
|
return this.id;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public void setId(int id) {
|
2018-07-06 13:30:00 +00:00
|
|
|
this.id = id;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public boolean isEnabled() {
|
2018-07-06 13:30:00 +00:00
|
|
|
return this.enabled;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public void enable() {
|
2018-07-06 13:30:00 +00:00
|
|
|
this.enabled = true;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public void disable() {
|
2018-07-06 13:30:00 +00:00
|
|
|
this.enabled = false;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public boolean isBackgroundOnly() {
|
2018-07-06 13:30:00 +00:00
|
|
|
return this.backgroundOnly;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public void setBackgroundOnly(boolean backgroundOnly) {
|
2018-07-06 13:30:00 +00:00
|
|
|
this.backgroundOnly = backgroundOnly;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public String getColor() {
|
2018-07-06 13:30:00 +00:00
|
|
|
return this.color;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public void setColor(String color) {
|
2018-07-06 13:30:00 +00:00
|
|
|
this.color = color;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public int getIntensity() {
|
2018-07-06 13:30:00 +00:00
|
|
|
return this.intensity;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public void setIntensity(int intensity) {
|
2018-07-06 13:30:00 +00:00
|
|
|
this.intensity = intensity;
|
|
|
|
}
|
|
|
|
|
2019-05-26 21:14:53 +03:00
|
|
|
public String toString() {
|
2018-07-06 13:30:00 +00:00
|
|
|
return (this.enabled ? 2 : 1) + "," + this.id + "," + (this.backgroundOnly ? 2 : 1) + "," + this.color + "," + this.intensity;
|
|
|
|
}
|
|
|
|
}
|