Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- 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);
- }
- }
- }
Add Comment
Please, Sign In to add comment