bitworks/hwo.bitworks/Constants.cs

49 lines
727 B
C#
Raw 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 static class Constants {
public static readonly LogicBase ZERO = new ZERO();
public static readonly LogicBase ONE = new ONE();
}
class ZERO : LogicBase
{
2017-06-14 15:06:37 +02:00
private BitIdentity biZERO = new BitIdentity("0");
2017-06-14 11:25:16 +02:00
public ZERO():base(new LogicBase[0]){
}
2017-06-14 15:06:37 +02:00
public override BitIdentity identity()
{
return biZERO;
}
2017-06-14 11:25:16 +02:00
public override bool value()
{
return false;
}
}
class ONE : LogicBase
{
2017-06-14 15:06:37 +02:00
private BitIdentity biONE = new BitIdentity("1");
2017-06-14 11:25:16 +02:00
public ONE():base(new LogicBase[0]){
}
2017-06-14 15:06:37 +02:00
public override BitIdentity identity()
{
return biONE;
}
2017-06-14 11:25:16 +02:00
public override bool value()
{
return true;
}
}
}