using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
namespace vyhodnoceni
{
// vstup, vystup nebo hradlo
public abstract class Node
{
protected bool? value = null;
public virtual bool HasValue()
{
return value != null;
}
public virtual bool GetValue()
{
return this.value.Value;
}
public void Reset()
{
value = null;
}
}
// vstup nebo vystup
public class ConnectionPoint : Node
{
protected string id;
protected void init(string id)
{
this.id = id;
}
}
public class Input : ConnectionPoint
{
protected Output output = null;
public Input(string id)
{
init(id);
}
// nastavi prislusny vystup, ze ktereho se ziskaji data
public void SetOutput(Output output)
{
this.output = output;
}
public override bool HasValue()
{
return this.output.HasValue();
}
public override bool GetValue()
{
return this.output.GetValue();
}
public string GetId()
{
return this.id;
}
}
public class Output : ConnectionPoint
{
public Output(string id)
{
init(id);
}
public void SetValue(bool value)
{
this.value = value;
}
}
public abstract class Gate : Node
{
protected List inputs = new List { };
protected List