using System.Collections;
using System.Collections.Generic;
using UnityEngine;

public class LNodeGate : LNode
{
    LNode parent;
    LNode gate;
    LNode failValue;

    public LNodeGate(LNode gate, LNode parent) 
    {
        this.gate = gate;
        this.parent = parent;

    }
    public LNodeGate(LNode gate, LNode parent, LNode failValue)
    {
        this.gate = gate;
        this.parent = parent;
        this.failValue = failValue;

    }
    public override float getOutput()
    {
        if (failValue != null)
            if (gate.getOutput() == 0)
                return failValue.getOutput();

        return gate.getOutput() * parent.getOutput();
    }
}
