Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
foodora
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Deploy
Releases
Container registry
Model registry
Analyze
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Nicolas Fley
foodora
Commits
31b45b75
Commit
31b45b75
authored
8 years ago
by
Nicolas Fley
Browse files
Options
Downloads
Patches
Plain Diff
myFoodora basics added
parents
Branches
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
.gitignore
+5
-0
5 additions, 0 deletions
.gitignore
src/my/foodora/code/core/MyFoodora.java
+101
-0
101 additions, 0 deletions
src/my/foodora/code/core/MyFoodora.java
with
106 additions
and
0 deletions
.gitignore
0 → 100644
+
5
−
0
View file @
31b45b75
/bin/
/src/provisoire/
.*
!.gitignore
\ No newline at end of file
This diff is collapsed.
Click to expand it.
src/my/foodora/code/core/MyFoodora.java
0 → 100644
+
101
−
0
View file @
31b45b75
package
my.foodora.code.core
;
import
java.util.ArrayList
;
import
provisoire.entities.ContextDeliveryPolicy
;
import
provisoire.entities.ContextTargetProfit
;
import
provisoire.entities.Courier
;
import
provisoire.entities.Customer
;
import
provisoire.entities.Manager
;
import
provisoire.entities.Restaurant
;
/**
* Heart of the project, concatenate all the fonctionalities this project
* must have.
*
*/
public
class
MyFoodora
{
private
double
serviceFee
;
private
double
markupPercentage
;
private
double
deliveryCost
;
private
ContextTargetProfit
contextTargetProfit
;
private
ContextDeliveryPolicy
contextDeliveryPolicy
;
// a mettre dans la logique des user
private
class
ListUser
<
T
>{
private
ArrayList
<
T
>
listUser
=
new
ArrayList
<
T
>();
public
void
addUser
(
T
e
){
listUser
.
add
(
e
);
}
public
void
removeUser
(
int
id
){
// todo
}
public
ArrayList
<
T
>
getList
(){
return
listUser
;
}
}
private
ArrayList
<
Restaurant
>
listRestaurant
=
new
ArrayList
<
Restaurant
>();
private
ArrayList
<
Customer
>
listCustomer
=
new
ArrayList
<
Customer
>();
private
ArrayList
<
Manager
>
listManager
=
new
ArrayList
<
Manager
>();
private
ArrayList
<
Courier
>
listCourier
=
new
ArrayList
<
Courier
>();
/** CUSTOM GETTER AND SETTER **/
public
double
getTotalIncome
(){
return
1.0
;
}
private
double
getTotalProfit
(){
return
1.0
;
}
private
double
getProfitForOneOrder
(
double
priceOrder
){
return
priceOrder
*
markupPercentage
+
serviceFee
-
deliveryCost
;
}
/** CUSTOM ADDING ENTITIES **/
public
void
addRestaurant
(
Restaurant
e
){
listRestaurant
.
add
(
e
);
}
public
void
addCustomer
(
Customer
e
){
listCustomer
.
add
(
e
);
}
public
void
addCourier
(
Courier
e
){
listCourier
.
add
(
e
);
}
public
void
addManager
(
Manager
e
){
listManager
.
add
(
e
);
}
/** GENERIC GETTER AND SETTER **/
public
double
getServiceFee
()
{
return
serviceFee
;
}
public
void
setServiceFee
(
double
serviceFee
)
{
this
.
serviceFee
=
serviceFee
;
}
public
double
getMarkupPercentage
()
{
return
markupPercentage
;
}
public
void
setMarkupPercentage
(
double
markupPercentage
)
{
this
.
markupPercentage
=
markupPercentage
;
}
public
double
getDeliveryCost
()
{
return
deliveryCost
;
}
public
void
setDeliveryCost
(
double
deliveryCost
)
{
this
.
deliveryCost
=
deliveryCost
;
}
/** END GENERIC GETTER AND SETTER **/
public
static
void
main
(
String
[]
args
)
{
// TODO Auto-generated method stub
}
}
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment