bitworks/hwo.bitworks/OR.cs

29 lines
452 B
C#
Raw Permalink Normal View History

2017-06-14 11:25:16 +02:00
using System;
2017-06-14 15:06:37 +02:00
using hwo.bitworks.identity;
2017-06-14 11:25:16 +02:00
namespace hwo.bitworks
{
public class OR : LogicBase
{
public OR(params LogicBase[] sources)
:base(sources)
{
}
public override bool value()
{
foreach (LogicBase source in this.sources){
if (source.value()){
return true;
}
}
return false;
}
2017-06-14 15:06:37 +02:00
public override BitIdentity identity()
{
return new BitIdentity(BitOperation.OR,identities(this.sources));
}
2017-06-14 11:25:16 +02:00
}
}