Skip to content

Instantly share code, notes, and snippets.

@rorpage
Created December 15, 2017 18:54
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save rorpage/dc3909f1b9d913ff20cba70e931df244 to your computer and use it in GitHub Desktop.
Save rorpage/dc3909f1b9d913ff20cba70e931df244 to your computer and use it in GitHub Desktop.
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