Created
January 3, 2017 16:01
-
-
Save RossignolVincent/d2cf1e0d3b63a8da2de1e4e799454e1b to your computer and use it in GitHub Desktop.
EvilCorp Vincent Rossignol
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ESGI; | |
/** | |
* Created by Vincent on 03/01/2017. | |
*/ | |
public class Affectation { | |
Worker worker; | |
String date; | |
String task; | |
public Affectation(Worker worker, String date, String task) { | |
this.worker = worker; | |
this.date = date; | |
this.task = task; | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ESGI; | |
import java.util.ArrayList; | |
import java.util.List; | |
/** | |
* Created by Vincent on 03/01/2017. | |
*/ | |
public class Factory { | |
public List<Affectation> list; | |
public Factory () { | |
list = new ArrayList<Affectation>(); | |
} | |
private void affect(Worker worker, String date, String task){ | |
for(Affectation a : list){ | |
if(worker.name.equals(a.worker.name)){ | |
a.date = date; | |
a.task = task; | |
return; | |
} | |
} | |
list.add(new Affectation(worker, date, task)); | |
} | |
public void task1(Worker worker, String date){ | |
affect(worker, date, "task1"); | |
} | |
public void task2(Worker worker, String date){ | |
affect(worker, date, "task2"); | |
} | |
public void task3(Worker worker, String date){ | |
affect(worker, date, "task3"); | |
} | |
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package ESGI; | |
/** | |
* Created by Vincent on 03/01/2017. | |
*/ | |
public class Worker { | |
String name; | |
public Worker() { | |
} | |
public void work(){} | |
public void eat(){} | |
public void sleep(){} | |
public void other(){} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment