require "TimedActions/ISBaseTimedAction"

local DelayCodeAction = ISBaseTimedAction:derive("DelayCodeAction")

function DelayCodeAction:isValid()
	return true
end

function DelayCodeAction:start()
	if self.code then
		self.code()
	end
end

function DelayCodeAction:new(character, code)
	local o = {}
	setmetatable(o, self)
	self.__index = self
	o.stopOnRun = false
	o.character = character
	o.code = code
	o.maxTime = 1
	return o
end

function DelayCode(character, code)
	ISTimedActionQueue.add(DelayCodeAction:new(character, code))
end
