38 lines
781 B
C#
38 lines
781 B
C#
using System;
|
|
using System.Collections.Generic;
|
|
using System.Linq;
|
|
using System.Text;
|
|
|
|
namespace Project.Device
|
|
{
|
|
public class CFlag : COMM.Flag
|
|
{
|
|
public CFlag() : base(64)
|
|
{
|
|
|
|
}
|
|
public bool get(EFlag flag)
|
|
{
|
|
return Get((int)flag);
|
|
}
|
|
public void set(EFlag flag, bool value)
|
|
{
|
|
var idx = (int)flag;
|
|
Set(idx, value);
|
|
}
|
|
public void Toggle(EFlag flag)
|
|
{
|
|
int idx = (int)flag;
|
|
var curValue = Get(idx);
|
|
Set(idx, !curValue);
|
|
}
|
|
|
|
public void Toggle(int idx)
|
|
{
|
|
var curValue = Get(idx);
|
|
Set(idx, !curValue);
|
|
}
|
|
|
|
}
|
|
}
|