Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
T
tok-chef
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Antoine HAZEBROUCK
tok-chef
Commits
2c9fa1ff
Commit
2c9fa1ff
authored
Sep 11, 2024
by
Antoine Hazebrouck
Browse files
Options
Browse Files
Download
Plain Diff
Merge branch 'master' of
https://gvipers.imt-nord-europe.fr/antoine.hazebrouck/tok-chef
parents
63efb5ef
48edc0fe
Pipeline
#2883
failed with stages
Changes
6
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
6 changed files
with
23 additions
and
13 deletions
+23
-13
Application.java
src/main/java/imt/Application.java
+6
-3
Autre.java
src/main/java/imt/ingredients/Autre.java
+1
-1
Epice.java
src/main/java/imt/ingredients/Epice.java
+1
-1
Ingredient.java
src/main/java/imt/ingredients/Ingredient.java
+11
-7
Legume.java
src/main/java/imt/ingredients/Legume.java
+1
-1
ViandePoisson.java
src/main/java/imt/ingredients/ViandePoisson.java
+3
-0
No files found.
src/main/java/imt/Application.java
View file @
2c9fa1ff
...
@@ -16,10 +16,13 @@ public class Application {
...
@@ -16,10 +16,13 @@ public class Application {
Ingredient
ingredient1
=
new
Legume
(
1
,
"Oignons"
,
120
,
false
);
Ingredient
ingredient1
=
new
Legume
(
1
,
"Oignons"
,
120
,
false
);
Ingredient
ingredient2
=
new
Legume
(
2
,
"Patate"
,
120
,
false
);
Ingredient
ingredient2
=
new
Legume
(
2
,
"Patate"
,
120
,
false
);
Ingredient
ingredient3
=
new
ViandePoisson
(
3
,
"Poulet"
,
120
,
12
);
Ingredient
ingredient3
=
new
ViandePoisson
(
3
,
"Poulet"
,
120
,
12
);
ingredient1
.
setConsigne
(
Consigne
.
CUIT
);
Consigne
[]
consignes
=
Consigne
.
values
();
ingredient2
.
setConsigne
(
Consigne
.
CUIT
);
ingredient3
.
setConsigne
(
Consigne
.
CUIT
);
Ingredient
[]
ingredients
=
{
ingredient1
,
ingredient2
,
ingredient3
};
Ingredient
[]
ingredients
=
{
ingredient1
,
ingredient2
,
ingredient3
};
for
(
int
i
=
0
;
i
<=
2
;
i
++){
ingredients
[
i
].
setConsignes
(
consignes
);
}
System
.
out
.
println
(
ingredient1
);
Plat
plat
=
new
Plat
(
1
,
"Oignon Poulet patate"
,
ingredients
);
Plat
plat
=
new
Plat
(
1
,
"Oignon Poulet patate"
,
ingredients
);
System
.
out
.
println
(
plat
);
System
.
out
.
println
(
plat
);
...
...
src/main/java/imt/ingredients/Autre.java
View file @
2c9fa1ff
...
@@ -27,6 +27,6 @@ public class Autre extends Ingredient {
...
@@ -27,6 +27,6 @@ public class Autre extends Ingredient {
}
}
public
String
toString
()
{
public
String
toString
()
{
return
"Autre [calories="
+
calories
+
", bio="
+
bio
+
", idIngredient="
+
getIdIngredient
()
+
", nomIngredient="
+
getNomIngredient
()
+
"]"
;
return
super
.
toString
()
+
" Autre [calories="
+
calories
+
", bio="
+
bio
+
"]"
;
}
}
}
}
src/main/java/imt/ingredients/Epice.java
View file @
2c9fa1ff
...
@@ -17,6 +17,6 @@ public class Epice extends Ingredient{
...
@@ -17,6 +17,6 @@ public class Epice extends Ingredient{
}
}
public
String
toString
()
{
public
String
toString
()
{
return
"Epice [bio="
+
bio
+
", idIngredient="
+
getIdIngredient
()
+
", nomIngredient="
+
getNomIngredient
()
+
"]"
;
return
super
.
toString
()
+
" Epice [bio="
+
bio
+
"]"
;
}
}
}
}
src/main/java/imt/ingredients/Ingredient.java
View file @
2c9fa1ff
...
@@ -4,13 +4,13 @@ public class Ingredient {
...
@@ -4,13 +4,13 @@ public class Ingredient {
private
int
idIngredient
;
private
int
idIngredient
;
private
String
nomIngredient
;
private
String
nomIngredient
;
private
int
quantit
é
;
private
int
quantit
é
;
private
Consigne
consigne
;
private
Consigne
[]
consignes
;
public
Ingredient
(
int
idIngredient
,
String
nomIngredient
)
{
public
Ingredient
(
int
idIngredient
,
String
nomIngredient
)
{
this
.
idIngredient
=
idIngredient
;
this
.
idIngredient
=
idIngredient
;
this
.
nomIngredient
=
nomIngredient
;
this
.
nomIngredient
=
nomIngredient
;
this
.
quantit
é
=
0
;
this
.
quantit
é
=
0
;
this
.
consigne
=
null
;
this
.
consigne
s
=
null
;
}
}
public
int
getIdIngredient
()
{
public
int
getIdIngredient
()
{
...
@@ -37,15 +37,19 @@ public class Ingredient {
...
@@ -37,15 +37,19 @@ public class Ingredient {
this
.
quantit
é
=
quantit
é
;
this
.
quantit
é
=
quantit
é
;
}
}
public
Consigne
getConsigne
()
{
public
Consigne
[]
getConsignes
()
{
return
consigne
;
return
consigne
s
;
}
}
public
void
setConsigne
(
Consigne
consigne
)
{
public
void
setConsigne
s
(
Consigne
[]
consignes
)
{
this
.
consigne
=
consigne
;
this
.
consigne
s
=
consignes
;
}
}
public
String
toString
()
{
public
String
toString
()
{
return
"Ingredient [idIngredient="
+
idIngredient
+
", nomIngredient="
+
nomIngredient
+
"]"
;
String
strConsigne
=
""
;
for
(
int
i
=
0
;
i
<
consignes
.
length
;
i
++)
{
strConsigne
+=
consignes
[
i
].
toString
()+
", "
;
}
return
"Ingredient [idIngredient="
+
idIngredient
+
", nomIngredient="
+
nomIngredient
+
", Consignes="
+
strConsigne
+
"]"
;
}
}
}
}
src/main/java/imt/ingredients/Legume.java
View file @
2c9fa1ff
...
@@ -27,6 +27,6 @@ public class Legume extends Ingredient{
...
@@ -27,6 +27,6 @@ public class Legume extends Ingredient{
}
}
public
String
toString
()
{
public
String
toString
()
{
return
"Legume [calories="
+
calories
+
", bio="
+
bio
+
", idIngredient="
+
getIdIngredient
()
+
", nomIngredient="
+
getNomIngredient
()
+
"]"
;
return
super
.
toString
()
+
" Legume [calories="
+
calories
+
", bio="
+
bio
+
"]"
;
}
}
}
}
src/main/java/imt/ingredients/ViandePoisson.java
View file @
2c9fa1ff
...
@@ -26,5 +26,8 @@ public class ViandePoisson extends Ingredient{
...
@@ -26,5 +26,8 @@ public class ViandePoisson extends Ingredient{
this
.
gras
=
gras
;
this
.
gras
=
gras
;
}
}
public
String
toString
()
{
return
super
.
toString
()
+
" Viande/Poisson [calories="
+
calories
+
", gras="
+
gras
+
"]"
;
}
}
}
\ No newline at end of file
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment