bitworks/hwo.bitworks/AND.cs

31 lines
457 B
C#

using System;
using hwo.bitworks.identity;
namespace hwo.bitworks
{
public class AND : LogicBase
{
public AND(params LogicBase[] sources)
:base(sources){
}
public override bool value()
{
foreach (LogicBase source in this.sources){
if (!source.value()){
return false;
}
}
return true;
}
public override BitIdentity identity()
{
return new BitIdentity(BitOperation.AND,identities(this.sources));
}
}
}