 
     defineKey: (key, value) ->
       @data[key] = value
-      @satisfyRequirement key
+      @gate.satisfy key
 
   class Satisfier extends KDEventEmitter
 


      return satisfier

    hasBrand: (brand) -> brand is @brand

    getSignal: -> @compliment no

    compliment: (value) -> switch @brand
      when 'all' then value
      when 'any' then !value

    isSatisfied: ->
      for own _, field of @fields
        return @getSignal()  unless @compliment field.isSatisfied()

      for child in @children
        return @getSignal()  unless @compliment child.isSatisfied()

      return !@getSignal()

    toString: -> "gate-#{@id}"

  class All extends Gate
    constructor: (fields) -> super 'all', fields

  class Any extends Gate
    constructor: (fields) -> super 'any', fields

      return this

    removeChild: (child) ->
      @children.splice i, 0  while (i = @children.indexOf child) > -1
      return this

    addField: (field) ->
      satisfier = @createSatisfier()
      
      @fields[field] = satisfier

      if field.isGate

        @addChild field
        
        field.on 'report', (state) => switch state
          when 'Satisfied'
            @emit 'RequirementSatisfied', field
            satisfier.satisfy()
          when 'Canceled'
            satisfier.cancel()

      return this

