bitworks/hwo.bitworks/Constants.cs

49 lines
727 B
C#

using System;
using hwo.bitworks.identity;
namespace hwo.bitworks
{
public static class Constants {
public static readonly LogicBase ZERO = new ZERO();
public static readonly LogicBase ONE = new ONE();
}
class ZERO : LogicBase
{
private BitIdentity biZERO = new BitIdentity("0");
public ZERO():base(new LogicBase[0]){
}
public override BitIdentity identity()
{
return biZERO;
}
public override bool value()
{
return false;
}
}
class ONE : LogicBase
{
private BitIdentity biONE = new BitIdentity("1");
public ONE():base(new LogicBase[0]){
}
public override BitIdentity identity()
{
return biONE;
}
public override bool value()
{
return true;
}
}
}