Created
December 15, 2017 18:54
-
-
Save rorpage/dc3909f1b9d913ff20cba70e931df244 to your computer and use it in GitHub Desktop.
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
import java.util.ArrayList; | |
import com.claus.Santa; | |
import com.world.Person; | |
import com.world.PersonHelper; | |
public class SantasList { | |
private Santa mSanta; | |
private ArrayList<Person> mList; | |
public SantasList(Santa santa) { | |
mSanta = santa; | |
MakeList(); | |
CheckList(); | |
CheckList(); | |
FindOutWhosNaughtyAndNice(); | |
mSanta.isComingToTown = true; | |
} | |
public void MakeList() { | |
mList = new ArrayList<>(); | |
} | |
public void CheckList() { | |
for (Person person : PersonHelper.GetAllThePeopleOfTheWorld()) { | |
if (!mList.contains(person)) { | |
mList.add(person); | |
} | |
} | |
} | |
public void FindOutWhosNaughtyAndNice() { | |
for (Person person : mList) { | |
person.Naughty = PersonHelper.IsNaughty(person); | |
person.Nice = !PersonHelper.IsNaughty(person); | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment