Arcturus-Community/src/main/java/com/eu/habbo/habbohotel/navigation/NavigatorPublicCategory.java

34 lines
973 B
Java
Raw Normal View History

2018-07-06 15:30:00 +02:00
package com.eu.habbo.habbohotel.navigation;
import com.eu.habbo.habbohotel.rooms.Room;
import java.sql.ResultSet;
import java.sql.SQLException;
import java.util.ArrayList;
import java.util.List;
2019-05-26 20:14:53 +02:00
public class NavigatorPublicCategory {
2018-07-06 15:30:00 +02:00
public final int id;
public final String name;
public final List<Room> rooms;
public final ListMode image;
2018-11-17 14:28:00 +01:00
public final int order;
2018-07-06 15:30:00 +02:00
2019-05-26 20:14:53 +02:00
public NavigatorPublicCategory(ResultSet set) throws SQLException {
2018-07-06 15:30:00 +02:00
this.id = set.getInt("id");
this.name = set.getString("name");
this.image = set.getString("image").equals("1") ? ListMode.THUMBNAILS : ListMode.LIST;
2018-11-17 14:28:00 +01:00
this.order = set.getInt("order_num");
2018-09-28 21:25:00 +02:00
this.rooms = new ArrayList<>();
2018-07-06 15:30:00 +02:00
}
2019-05-26 20:14:53 +02:00
public void addRoom(Room room) {
2018-07-06 15:30:00 +02:00
room.preventUncaching = true;
this.rooms.add(room);
}
2019-03-18 02:22:00 +01:00
2019-05-26 20:14:53 +02:00
public void removeRoom(Room room) {
2019-03-18 02:22:00 +01:00
this.rooms.remove(room);
room.preventUncaching = room.isPublicRoom();
}
2018-07-06 15:30:00 +02:00
}