I'm looking for a way to check the value of another actor that is in range. How would i do that??
Person person = getOneObjectAtOffset(x, y, Person.class); int mySex = person.getSex();
public int getSex() { return sex; }
Person person = getOneObjectAtOffset(x, y, Person.class); int mySex = person.sex;
List<Person>persons = getObjectsInRange(2, Person.class); int maleCt = 0; int femaleCt = 0; for (Person person: persons) { if (person.infectionStage < 5) { if (person.sex == 0) { femaleCt++; } else { maleCt++; } } }
private int sex;