I'm looking for a way to check the value of another actor that is in range. How would i do that??


1 2 | Person person = getOneObjectAtOffset(x, y, Person. class ); int mySex = person.getSex(); |
1 2 3 4 | public int getSex() { return sex; } |
1 2 | Person person = getOneObjectAtOffset(x, y, Person. class ); int mySex = person.sex; |
1 2 3 4 5 6 7 8 9 10 | 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++; } } } |
1 | private int sex; |