Hello, I need a hand with a getState method. I have it publicly declared in one class and want to use it in another but it keeps throwing an error message saying that a nonstatic method getState() cannot be referenced from a static concept. I've pretty much run out of ideas on what to to do with that. I'm gonna add bits of the code from Guest class and Waiter class (both descending from Actor class) where I'm most certain an error could have happened. Also if you can find some more errors in the code, please give me a hint on how to fix them. The goal is to make a Waiter to change the number of Guest (+1) if their numbers match and if the Waiter is in vicinity.
Waiter class List <Guest> guests = getObjectsInRange(1,Guest.class); for (int o = 0; o < guests.size(); o++){ Guest guest = guests.get(o); Guest.getState(); if (h == waiter.getState) Guest.setState = h+1; World.removeObject(waiter); } Guest class public Guest() { guestCount++; } public Integer getState() { return this.state; }