Commit bc7f1c64 authored by Arthur POIGNONNEC's avatar Arthur POIGNONNEC

Merge branch 'master' of https://gvipers.imt-lille-douai.fr/arthur.poignonnec/geometry

# Conflicts:
#	garage/src/Option/Option.java
#	garage/src/vehicle/part/engine/Engine.java
parents 23b372a2 97b957a8
......@@ -2,11 +2,13 @@
<project version="4">
<component name="ChangeListManager">
<list default="true" id="b9f7e8e0-35d9-4b18-a962-7ed056e3a2a5" name="Default Changelist" comment="">
<change afterPath="$PROJECT_DIR$/src/Option/Option.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/package-info.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Option/Aircon.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Option/CareerBars.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Option/ElectricGlass.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Option/GPS.java" afterDir="false" />
<change afterPath="$PROJECT_DIR$/src/Option/HotSeat.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/.idea/workspace.xml" beforeDir="false" afterPath="$PROJECT_DIR$/.idea/workspace.xml" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Engine/DieselEngine.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Engine/DieselEngine.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Engine/Engine.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Engine/Engine.java" afterDir="false" />
<change beforePath="$PROJECT_DIR$/src/Option/Option.java" beforeDir="false" afterPath="$PROJECT_DIR$/src/Option/Option.java" afterDir="false" />
</list>
<ignored path="$PROJECT_DIR$/out/" />
<option name="EXCLUDED_CONVERTED_TO_IGNORED" value="true" />
......@@ -20,65 +22,95 @@
</component>
<component name="FileEditorManager">
<leaf SIDE_TABS_SIZE_LIMIT_KEY="300">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Engine/EngineType.java">
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Option/Option.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="12" selection-start-line="2" selection-start-column="12" selection-end-line="2" selection-end-column="12" />
<state relative-caret-position="75">
<caret line="5" lean-forward="true" selection-start-line="5" selection-end-line="5" />
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/test/TestEngine.java">
<entry file="file://$PROJECT_DIR$/src/Option/ElectricGlass.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="23" selection-start-line="2" selection-start-column="23" selection-end-line="2" selection-end-column="23" />
<state relative-caret-position="75">
<caret line="5" column="19" selection-start-line="5" selection-start-column="19" selection-end-line="5" selection-end-column="19" />
<folding>
<element signature="e#97#98#0" expanded="true" />
<element signature="e#121#122#0" expanded="true" />
<element signature="e#159#160#0" expanded="true" />
<element signature="e#222#223#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/main/Main.java">
<entry file="file://$PROJECT_DIR$/src/Option/HotSeat.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" column="44" selection-start-line="4" selection-start-column="44" selection-end-line="4" selection-end-column="44" />
<state relative-caret-position="75">
<caret line="5" column="23" selection-start-line="5" selection-start-column="23" selection-end-line="5" selection-end-column="23" />
<folding>
<element signature="e#143#144#0" expanded="true" />
<element signature="e#169#170#0" expanded="true" />
<element signature="e#201#202#0" expanded="true" />
<element signature="e#268#269#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="true">
<entry file="file://$PROJECT_DIR$/src/Engine/Engine.java">
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Option/Aircon.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435">
<caret line="29" column="1" lean-forward="true" selection-start-line="29" selection-start-column="1" selection-end-line="29" selection-end-column="1" />
<state relative-caret-position="135">
<caret line="9" column="22" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
<folding>
<element signature="e#446#447#0" expanded="true" />
<element signature="e#472#473#0" expanded="true" />
<element signature="e#86#87#0" expanded="true" />
<element signature="e#120#121#0" expanded="true" />
<element signature="e#156#157#0" expanded="true" />
<element signature="e#225#226#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Option/Option.java">
<entry file="file://$PROJECT_DIR$/src/Option/CareerBars.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" selection-start-line="4" selection-end-line="4" />
<state relative-caret-position="120">
<caret line="8" column="27" selection-start-line="8" selection-start-column="27" selection-end-line="8" selection-end-column="27" />
<folding>
<element signature="e#89#90#0" expanded="true" />
<element signature="e#123#124#0" expanded="true" />
<element signature="e#159#160#0" expanded="true" />
<element signature="e#228#229#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/package-info.java">
<provider selected="true" editor-type-id="text-editor" />
<entry file="file://$PROJECT_DIR$/src/Option/GPS.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" column="18" selection-start-line="5" selection-start-column="18" selection-end-line="5" selection-end-column="18" />
<folding>
<element signature="e#88#89#0" expanded="true" />
<element signature="e#122#123#0" expanded="true" />
<element signature="e#158#159#0" expanded="true" />
<element signature="e#227#228#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
</file>
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Engine/HybridEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="25" selection-start-line="2" selection-start-column="25" selection-end-line="2" selection-end-column="25" />
<state relative-caret-position="150">
<caret line="11" column="22" selection-start-line="11" selection-start-column="22" selection-end-line="11" selection-end-column="22" />
</state>
</provider>
</entry>
......@@ -86,8 +118,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Engine/ElectricEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="27" selection-start-line="2" selection-start-column="27" selection-end-line="2" selection-end-column="27" />
<state relative-caret-position="60">
<caret line="4" column="4" selection-start-line="4" selection-start-column="4" selection-end-line="12" selection-end-column="5" />
</state>
</provider>
</entry>
......@@ -95,8 +127,8 @@
<file pinned="false" current-in-tab="false">
<entry file="file://$PROJECT_DIR$/src/Engine/PetrolEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="25" selection-start-line="2" selection-start-column="25" selection-end-line="2" selection-end-column="25" />
<state relative-caret-position="150">
<caret line="11" column="22" selection-start-line="11" selection-start-column="22" selection-end-line="11" selection-end-column="22" />
</state>
</provider>
</entry>
......@@ -105,11 +137,7 @@
<entry file="file://$PROJECT_DIR$/src/Engine/DieselEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="31" lean-forward="true" selection-start-line="11" selection-start-column="31" selection-end-line="11" selection-end-column="31" />
<folding>
<element signature="e#234#235#0" expanded="true" />
<element signature="e#255#256#0" expanded="true" />
</folding>
<caret line="13" column="1" selection-start-line="13" selection-start-column="1" selection-end-line="13" selection-end-column="1" />
</state>
</provider>
</entry>
......@@ -137,17 +165,25 @@
<option value="$PROJECT_DIR$/src/main/Vehicle.java" />
<option value="$PROJECT_DIR$/src/Vehicle/Brand.java" />
<option value="$PROJECT_DIR$/src/Vehicle/Vehicle.java" />
<option value="$PROJECT_DIR$/src/Option/Option.java" />
<option value="$PROJECT_DIR$/src/Engine/DieselEngine.java" />
<option value="$PROJECT_DIR$/src/Engine/ElectricEngine.java" />
<option value="$PROJECT_DIR$/src/Engine/HybridEngine.java" />
<option value="$PROJECT_DIR$/src/Engine/PetrolEngine.java" />
<option value="$PROJECT_DIR$/src/Engine/Engine.java" />
<option value="$PROJECT_DIR$/src/Option/Option.java" />
<option value="$PROJECT_DIR$/src/Option/GPS.java" />
<option value="$PROJECT_DIR$/src/Option/ElectricGlass.java" />
<option value="$PROJECT_DIR$/src/Option/HotSeat.java" />
<option value="$PROJECT_DIR$/src/Option/Aircon.java" />
<option value="$PROJECT_DIR$/src/Option/CareerBars.java" />
</list>
</option>
</component>
<component name="ProjectFrameBounds">
<option name="x" value="21" />
<option name="y" value="28" />
<option name="x" value="1941" />
<option name="y" value="45" />
<option name="width" value="1878" />
<option name="height" value="1031" />
<option name="height" value="1014" />
</component>
<component name="ProjectLevelVcsManager" settingsEditedManually="true">
<ConfirmationsSetting value="2" id="Add" />
......@@ -158,7 +194,6 @@
</navigator>
<panes>
<pane id="Scope" />
<pane id="PackagesPane" />
<pane id="ProjectPane">
<subPane>
<expand>
......@@ -205,6 +240,7 @@
<select />
</subPane>
</pane>
<pane id="PackagesPane" />
</panes>
</component>
<component name="PropertiesComponent">
......@@ -269,10 +305,10 @@
<servers />
</component>
<component name="ToolWindowManager">
<frame x="21" y="28" width="1878" height="1031" extended-state="0" />
<frame x="1941" y="45" width="1878" height="1014" extended-state="0" />
<editor active="true" />
<layout>
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.13671024" />
<window_info active="true" content_ui="combo" id="Project" order="0" visible="true" weight="0.13562092" />
<window_info id="Structure" order="1" side_tool="true" weight="0.25" />
<window_info id="Image Layers" order="2" />
<window_info id="Designer" order="3" />
......@@ -334,6 +370,14 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Option.java" />
<entry file="file://$PROJECT_DIR$/src/Engine/EngineType.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="360">
<caret line="28" selection-start-line="28" selection-end-line="28" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/test/TestEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
......@@ -348,73 +392,116 @@
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Engine/Engine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="480">
<caret line="34" column="9" selection-start-line="34" selection-start-column="9" selection-end-line="34" selection-end-column="9" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/package-info.java">
<provider selected="true" editor-type-id="text-editor" />
</entry>
<entry file="file://$PROJECT_DIR$/src/Engine/HybridEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="25" selection-start-line="2" selection-start-column="25" selection-end-line="2" selection-end-column="25" />
<state relative-caret-position="150">
<caret line="11" column="22" selection-start-line="11" selection-start-column="22" selection-end-line="11" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Engine/PetrolEngine.java">
<entry file="file://$PROJECT_DIR$/src/Engine/ElectricEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="25" selection-start-line="2" selection-start-column="25" selection-end-line="2" selection-end-column="25" />
<state relative-caret-position="60">
<caret line="4" column="4" selection-start-line="4" selection-start-column="4" selection-end-line="12" selection-end-column="5" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/package-info.java">
<provider selected="true" editor-type-id="text-editor" />
<entry file="file://$PROJECT_DIR$/src/Engine/PetrolEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="150">
<caret line="11" column="22" selection-start-line="11" selection-start-column="22" selection-end-line="11" selection-end-column="22" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Option.java">
<entry file="file://$PROJECT_DIR$/src/Engine/DieselEngine.java">
<provider selected="true" editor-type-id="text-editor">
<state>
<caret column="13" selection-start-column="13" selection-end-column="13" />
<state relative-caret-position="165">
<caret line="13" column="1" selection-start-line="13" selection-start-column="1" selection-end-line="13" selection-end-column="1" />
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Option/Option.java">
<entry file="file://$PROJECT_DIR$/src/Option/Aircon.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="60">
<caret line="4" selection-start-line="4" selection-end-line="4" />
<state relative-caret-position="135">
<caret line="9" column="22" selection-start-line="9" selection-start-column="22" selection-end-line="9" selection-end-column="22" />
<folding>
<element signature="e#86#87#0" expanded="true" />
<element signature="e#120#121#0" expanded="true" />
<element signature="e#156#157#0" expanded="true" />
<element signature="e#225#226#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Engine/ElectricEngine.java">
<entry file="file://$PROJECT_DIR$/src/Option/ElectricGlass.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="27" selection-start-line="2" selection-start-column="27" selection-end-line="2" selection-end-column="27" />
<state relative-caret-position="75">
<caret line="5" column="19" selection-start-line="5" selection-start-column="19" selection-end-line="5" selection-end-column="19" />
<folding>
<element signature="e#97#98#0" expanded="true" />
<element signature="e#121#122#0" expanded="true" />
<element signature="e#159#160#0" expanded="true" />
<element signature="e#222#223#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Engine/EngineType.java">
<entry file="file://$PROJECT_DIR$/src/Option/CareerBars.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="30">
<caret line="2" column="12" selection-start-line="2" selection-start-column="12" selection-end-line="2" selection-end-column="12" />
<state relative-caret-position="120">
<caret line="8" column="27" selection-start-line="8" selection-start-column="27" selection-end-line="8" selection-end-column="27" />
<folding>
<element signature="e#89#90#0" expanded="true" />
<element signature="e#123#124#0" expanded="true" />
<element signature="e#159#160#0" expanded="true" />
<element signature="e#228#229#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Engine/DieselEngine.java">
<entry file="file://$PROJECT_DIR$/src/Option/GPS.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="165">
<caret line="11" column="31" lean-forward="true" selection-start-line="11" selection-start-column="31" selection-end-line="11" selection-end-column="31" />
<state relative-caret-position="75">
<caret line="5" column="18" selection-start-line="5" selection-start-column="18" selection-end-line="5" selection-end-column="18" />
<folding>
<element signature="e#234#235#0" expanded="true" />
<element signature="e#255#256#0" expanded="true" />
<element signature="e#88#89#0" expanded="true" />
<element signature="e#122#123#0" expanded="true" />
<element signature="e#158#159#0" expanded="true" />
<element signature="e#227#228#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Engine/Engine.java">
<entry file="file://$PROJECT_DIR$/src/Option/HotSeat.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="435">
<caret line="29" column="1" lean-forward="true" selection-start-line="29" selection-start-column="1" selection-end-line="29" selection-end-column="1" />
<state relative-caret-position="75">
<caret line="5" column="23" selection-start-line="5" selection-start-column="23" selection-end-line="5" selection-end-column="23" />
<folding>
<element signature="e#446#447#0" expanded="true" />
<element signature="e#472#473#0" expanded="true" />
<element signature="e#143#144#0" expanded="true" />
<element signature="e#169#170#0" expanded="true" />
<element signature="e#201#202#0" expanded="true" />
<element signature="e#268#269#0" expanded="true" />
</folding>
</state>
</provider>
</entry>
<entry file="file://$PROJECT_DIR$/src/Option/Option.java">
<provider selected="true" editor-type-id="text-editor">
<state relative-caret-position="75">
<caret line="5" lean-forward="true" selection-start-line="5" selection-end-line="5" />
</state>
</provider>
</entry>
</component>
<component name="masterDetails">
<states>
......
......@@ -21,7 +21,7 @@ public abstract class Vehicle {
// return "\t" + this.brandName + "is a " + name + " with that options : + " ?? " + ". Price : " + price.
// Add an option
// public void addOption(opt : Option)
// public void addOption(opt : vehicle.part.option)
// GETTER
......@@ -31,7 +31,7 @@ public abstract class Vehicle {
// public Brand getBrand()
// Get the options of the car
// public List<Option> getOptions()
// public List<vehicle.part.option> getOptions()
// Get the price
// public Double getPrice();
......
package vehicle.part.engine;
public class DieselEngine extends Engine {
public class DieselEngine extends Engine{
public DieselEngine(String _cylindre, Double _price) {
......
package vehicle.part.engine;
public class ElectricEngine {
public class ElectricEngine extends Engine {
public ElectricEngine(String _cylindre, Double _price) {
super(_cylindre, _price);
this.type = EngineType.ELECTRIC;
}
public String toString() {
return "Electric Engine";
}
}
......@@ -3,22 +3,38 @@ package vehicle.part.engine;
public class Engine {
protected EngineType type;
private String cylindre;
private Double price;
protected String cylindre;
protected Double price;
public Engine (String _cylindre, Double _price) {
this.cylindre = _cylindre;
this.price = _price;
this.price = getPrice();
}
public String toString() {
return "This is a " + cylindre + "engine, it's a " + type + " engine and it costs " + price + " €.";
return "This vehicle has a " + cylindre + "engine, it's a " + type + " engine and it costs " + price + " €.";
}
public String getCylindre() {
return this.cylindre;
}
public Double getPrice() {
if (this.getClass() == DieselEngine.class) {
return 2000d;
} else if (this.getClass() == ElectricEngine.class) {
return 1800d;
} else if (this.getClass() == HybridEngine.class) {
return 3000d;
} else if (this.getClass() == PetrolEngine.class) {
return 1400d;
} else {
return 0d;
}
}
}
package vehicle.part.engine;
public class HybridEngine {
public class HybridEngine extends Engine {
public HybridEngine(String _cylindre, Double _price) {
super(_cylindre, _price);
this.type = EngineType.HYBRID;
}
public String toString() {
return "Hybrid Engine";
}
}
package vehicle.part.engine;
public class PetrolEngine {
public class PetrolEngine extends Engine {
public PetrolEngine(String _cylindre, Double _price) {
super(_cylindre, _price);
this.type = EngineType.PETROL;
}
public String toString() {
return "Petrol Engine";
}
}
package vehicle.part.option;
public class Aircon implements Option {
public double getPrice() {
return 300d;
}
public String toString() {
return "Aircon (" + this.getPrice() + " €)";
}
}
package vehicle.part.option;
public class CareerBars implements Option{
public double getPrice() {
return 100;
}
public String toString() {
return "Career bars (" + this.getPrice() + " €)";
}
}
package vehicle.part.option;
public class ElectricGlass implements Option{
public double getPrice() {
return 200d;
}
public String toString() {
return "Electric glass (" + this.getPrice() + " €)";
}
}
package vehicle.part.option;
public class GPS implements Option {
public double getPrice() {
return 50d;
}
public String toString() {
return "GPS (" + this.getPrice() + " €)";
}
}
package vehicle.part.option;
public class HotSeat implements Option {
public double getPrice() {
return 150d;
}
public String toString() {
return "Hot seat (" + this.getPrice() + " €)";
}
}
}
package vehicle.part.option;
public interface Option {
double getPrice();
String toString();
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment