Guest User

Untitled

a guest
Dec 18th, 2017
70
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.89 KB | None | 0 0
  1. import java.util.ArrayList;
  2. import com.claus.Santa;
  3. import com.world.Person;
  4. import com.world.PersonHelper;
  5.  
  6. public class SantasList {
  7. private Santa mSanta;
  8. private ArrayList<Person> mList;
  9.  
  10. public SantasList(Santa santa) {
  11. mSanta = santa;
  12.  
  13. MakeList();
  14.  
  15. CheckList();
  16. CheckList();
  17.  
  18. FindOutWhosNaughtyAndNice();
  19.  
  20. mSanta.isComingToTown = true;
  21. }
  22.  
  23. public void MakeList() {
  24. mList = new ArrayList<>();
  25. }
  26.  
  27. public void CheckList() {
  28. for (Person person : PersonHelper.GetAllThePeopleOfTheWorld()) {
  29. if (!mList.contains(person)) {
  30. mList.add(person);
  31. }
  32. }
  33. }
  34.  
  35. public void FindOutWhosNaughtyAndNice() {
  36. for (Person person : mList) {
  37. person.Naughty = PersonHelper.IsNaughty(person);
  38. person.Nice = !PersonHelper.IsNaughty(person);
  39. }
  40. }
  41. }
Add Comment
Please, Sign In to add comment