blob: b0df4e808769f48c8dda2379cf95f6284150dc61 (
plain) (
blame)
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
|
package space.m0e.quga.oop.lab56maven.entities.macro;
import javafx.scene.control.Label;
import javafx.scene.image.Image;
import javafx.scene.image.ImageView;
import javafx.scene.layout.VBox;
import space.m0e.quga.oop.lab56maven.Main;
import space.m0e.quga.oop.lab56maven.entities.micro.Dwarf;
import space.m0e.quga.oop.lab56maven.entities.micro.Immigrant;
import space.m0e.quga.oop.lab56maven.entities.micro.Nobel;
import java.util.ArrayList;
import java.util.Objects;
import java.util.Optional;
public class ThroneRoom {
private Image spriteImage = new Image(Objects.requireNonNull(ThroneRoom.class.getResourceAsStream("throne_room.jpg")));;
private ImageView sprite = new ImageView(spriteImage);
private Label nameLabel = new Label();
public Label getCountLabel() {
return countLabel;
}
private Label countLabel = new Label();
private ArrayList<Nobel> nobels = new ArrayList<>();
String name;
private VBox vBox = new VBox();
public ThroneRoom(String name) {
this.name = name;
sprite.setFitHeight(150);
sprite.setFitWidth(150);
nameLabel.setText(name);
countLabel.setText("0");
nameLabel.setStyle("-fx-text-fill: white; -fx-font-size: 16px; -fx-background-color: grey");
countLabel.setStyle("-fx-text-fill: white; -fx-font-size: 16px; -fx-background-color: grey");
vBox.getChildren().addAll(nameLabel, sprite, countLabel);
Main.root.getChildren().add(vBox);
};
public void add(Nobel nobel) {
nobels.add(nobel);
}
public ArrayList<Nobel> getNobels() {
return nobels;
}
public VBox getGroup() {
return vBox;
}
}
|