         satisfier.satisfy()
       else
         child.satisfy field  for child in @children
-      return this
-
-    getSatisfier: -> switch @brand
-      when 'any'  then @satisfier ?= @createSatisfier()
-      when 'all'  then @createSatisfier()
-
-    report: ->
-      @emit if @isSatisfied() then 'Satisfied' else 'Dissatisfied'
+
       return this
 
     createSatisfier: ->


      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

