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

advertisement »

ambientSounds »

bitser »

contentPoints »

eventBoxText »

factValidity »

frameBuffer »

officeBuildingInserter »

priorityRenderer »

randomEvents »

scaling »

spritesheetParser »

statusIcons »

test3 »

util »

Objects

removeDirectReceiver

Description

Removes an event receiver added previously via :addDirectReceiver(). Must pass on the exact same object that was added.

Arguments

1 table object

the object that was previously added.

2 table eventList

the list of events that this object was bound to handling.

3 string handlerName (optional)

the handler method name that it was bound to handling through, if it was provided.

Example

-- specify the events it should be handling

local eventsToHandle = {"someEvent"}

-- init the object

local object = {handleEvent = function(self, event, data)
  print("received event", event, "with data", data)
end}

-- register the receiver

events:addDirectReceiver(object, eventsToHandle)

-- fire the event

events:fire("someEvent", {id = "someID", data = 123})

-- remove the receiver

events:removeDirectReceiver(object, eventsToHandle)