Returns whether the action is eligible in general.
Returns whether the action is eligible in general.
1 entity object
some kind of object in the office.
1 bool
should return true or false.
-- taken from game/developer/actions.lua
function useWaterDispenser:isEligible(officeObject)
table.clearArray(self.validObjects)
local list = officeObject:getObjectsByClass(self.targetObjectClass)
if list then
for key, object in ipairs(list) do
if object:isPartOfValidRoom() and object:isValidForInteraction() and not object:getInteractionTarget() then
self.validObjects[#self.validObjects + 1] = object
end
end
end
return #self.validObjects > 0
end