--[[#######################################################################
#  File     :  /hook/units/UEA0001/UEA0001_script.lua
#  Author(s):  John Comes
#  Summary  :  UEF CDR Pod Script
#  -----------------------------
#  Modif.by :  Manimal
#  Mod.Date :  11 mars 2011
#  -----------------------------
#  Revis.by :  xxxxxxx
#  Rev.Date :  jj mmmmm aaa
#  ----------------------------------------------------------
#  Copyright © 2005 Gas Powered Games, Inc.  All rights reserved.
#######################################################################]]--

local TConstructionUnit = import( '/lua/terranunits.lua' ).TConstructionUnit

UEA0001 = Class( TConstructionUnit ) {
    Parent = nil,

    SetParent = function( self, parent, podName )
        self.Parent = parent
        self.Pod = podName
    end,

	# ~~~~~~~~~~~~~~~~~~~~~
	# AJOUT PAR MANIMAL :
	# ~~~~~~~~~~~~~~~~~~~~~
    OnCreate = function( self )
        TConstructionUnit.OnCreate( self )
        --# RESTRICTIONS CONCERNANT LES UNITÉS UNIQUES
		self:AddBuildRestriction( categories.UNIQUE + categories.LABO + categories.HEROPORTAL )
		self:RequestRefreshUI()
    end,
	# ~~~~~~~~~~~~~~~~~~~~~

    OnKilled = function( self, instigator, type, overkillRatio )
        self.Parent:NotifyOfPodDeath( self.Pod )
        self.Parent = nil
        TConstructionUnit.OnKilled( self, instigator, type, overkillRatio )
    end,

}

TypeClass = UEA0001
