Skip to content
Snippets Groups Projects

Compare revisions

Changes are shown as if the source revision was being merged into the target revision. Learn more about comparing revisions.

Source

Select target project
No results found
Select Git revision
Loading items

Target

Select target project
  • l22015417/firefighterstarter
  • m19023837/firefighter-starter-mansour-chadi-chahine-rami
  • r24025701/firefighterstarter
  • n24026202/firefighterstarter
  • couetoux.b/firefighterstarter
  • b23027938/firefighterstarter
  • z20039716/fire-fighter
  • a18023913/firefighterstarter
  • o22010261/firefighterstarter
  • b22015516/firefighterstarter
  • alaboure/firefighter-template
  • p21211679/firefighter-luis-parra-yanis-lounadi
  • v23014723/firefighter-project
  • k20014011/firefighter-template
  • m23022217/firefighter-template
  • p20006624/firefighter-template
  • l21221596/firefighter-template
  • s21232465/firefighter-template
  • y21224754/firefighter-template
  • w21225935/firefighter-template
  • h22023886/firefighter-template
  • b21221604/firefighter-template-boucenna-yacine-zeghar-mohamed-lamine
  • c23025119/firefighterstarter
  • b20031964/firefighterstarter
24 results
Select Git revision
Loading items
Show changes
src/main/resources/view/icons/virus/docteur.png

28.7 KiB

src/main/resources/view/icons/virus/humain.png

17.4 KiB

src/main/resources/view/icons/virus/patient.png

20.3 KiB

src/main/resources/view/icons/virus/virus.png

28.1 KiB

<?xml version="1.0" encoding="UTF-8"?>
<?import javafx.scene.control.Button?>
<?import javafx.scene.control.Label?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.layout.HBox?>
<?import javafx.scene.layout.VBox?>
<?import view.FirefighterGrid?>
<?import javafx.scene.control.ToggleButton?>
<?import javafx.scene.control.Separator?>
<?import javafx.scene.control.Label?>
<HBox styleClass="background" stylesheets="@DarkTheme.css"
xmlns="http://javafx.com/javafx" xmlns:fx="http://javafx.com/fxml"
xmlns="http://javafx.com/javafx"
xmlns:fx="http://javafx.com/fxml"
fx:controller="controller.Controller">
<VBox>
<Separator maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0" />
<Label maxHeight="-Infinity" maxWidth="-Infinity" alignment="CENTER" prefHeight="24.0" prefWidth="200.0"
<Label maxHeight="-Infinity" maxWidth="-Infinity"
alignment="CENTER" prefHeight="24.0" prefWidth="200.0"
text="Generation number" />
<Label fx:id="generationNumberLabel" alignment="CENTER" contentDisplay="TEXT_ONLY"
maxHeight="-Infinity" maxWidth="-Infinity" prefHeight="24.0" prefWidth="200.0"/>
<Label fx:id="generationNumberLabel"
alignment="CENTER" contentDisplay="TEXT_ONLY"
maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0" />
<Separator maxHeight="-Infinity" maxWidth="-Infinity"
prefHeight="24.0" prefWidth="200.0" />
<Button fx:id="restartButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#restartButtonAction" prefHeight="24.0" prefWidth="200.0"
text="Restart"/>
mnemonicParsing="false" onAction="#restartButtonAction"
prefHeight="24.0" prefWidth="200.0" text="Restart" />
<Button fx:id="oneStepButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#oneStepButtonAction" prefHeight="24.0" prefWidth="200.0"
text="One step"/>
mnemonicParsing="false" onAction="#oneStepButtonAction"
prefHeight="24.0" prefWidth="200.0" text="One step" />
<ToggleButton fx:id="playToggleButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#playToggleButtonAction" prefHeight="24.0"
prefWidth="200.0" styleClass="button" text="Play"/>
mnemonicParsing="false" onAction="#playToggleButtonAction"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Play" />
<ToggleButton fx:id="pauseToggleButton" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#pauseToggleButtonAction" prefHeight="24.0"
prefWidth="200.0" styleClass="button" text="Pause"/>
mnemonicParsing="false" onAction="#pauseToggleButtonAction"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Pause" />
<ToggleButton fx:id="initFireFighter" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializeFireFighter"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start FireFighter" />
<ToggleButton fx:id="initVirus" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializeDoctor"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start Virus" />
<ToggleButton fx:id="initPfc" maxHeight="-Infinity" maxWidth="-Infinity"
mnemonicParsing="false" onAction="#initializePfc"
prefHeight="24.0" prefWidth="200.0"
styleClass="button" text="Start RockPaperCisor" />
</VBox>
<FirefighterGrid fx:id="grid"
xmlns="http://javafx.com/javafx"
......
package model;
import org.junit.jupiter.api.Test;
import util.Position;
import java.util.List;
import static org.assertj.core.api.Assertions.*;
public class FirefighterBoardTest {
@Test
void testColumnCount(){
Board<List<ModelElement>> board = new FirefighterBoard(20, 10, 1, 3);
assertThat(board.columnCount()).isEqualTo(20);
}
@Test
void testRowCount(){
Board<List<ModelElement>> board = new FirefighterBoard(20, 10, 1, 3);
assertThat(board.rowCount()).isEqualTo(10);
}
@Test
void testStepNumber(){
Board<List<ModelElement>> board = new FirefighterBoard(20, 10, 1, 3);
for(int index = 0; index < 10; index++){
assertThat(board.stepNumber()).isEqualTo(index);
board.updateToNextGeneration();
}
assertThat(board.stepNumber()).isEqualTo(10);
}
@Test
void testGetState_afterSet(){
Board<List<ModelElement>> board = new FirefighterBoard(20, 10, 0, 0);
Position position = new Position(1,2);
assertThat(board.getState(position)).isEmpty();
board.setState(List.of(ModelElement.FIRE), position);
assertThat(board.getState(position)).containsExactly(ModelElement.FIRE);
}
}
package view;
import org.junit.jupiter.api.Test;
import static org.assertj.core.api.Assertions.*;
import static org.assertj.core.api.Assertions.assertThat;
import org.junit.jupiter.api.Test;
public class FirefighterGridTest {
@Test
void testColumnCount(){
Grid<ViewElement> grid = new FirefighterGrid();
grid.setDimensions(20,10,10,10);
grid.setDimensions(20,10,5,5);
assertThat(grid.columnCount()).isEqualTo(20);
}
@Test
void testRowCount(){
Grid<ViewElement> grid = new FirefighterGrid();
grid.setDimensions(20,10,10,10);
grid.setDimensions(20,10,5,5);
assertThat(grid.rowCount()).isEqualTo(10);
}
}