Deprecated: str_replace(): Passing null to parameter #1 ($search) of type array|string is deprecated in /var/www/vhosts/gamedevstudiogame.com/httpdocs/classes/client.php on line 124

Deprecated: str_replace(): Passing null to parameter #2 ($replace) of type array|string is deprecated in /var/www/vhosts/gamedevstudiogame.com/httpdocs/classes/client.php on line 124
Game dev studio

Classes

Concepts

Libraries

Objects

contractor »

conversationAnswerData »

engineStatData »

issueData »

playerPlatformSpecialistData »

projectReviewConclusion »

projectReviewRemark »

randomEventData »

statusIcon »

isEligible

Description

Returns whether the action is eligible in general.

Arguments

1 entity object

some kind of object in the office.

Returns

1 bool

should return true or false.

Example

-- 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