示例#1
0
 public bool KiemTraThang()
 {
     foreach (Oco oco in DanhsachCoDaDanh)
     {
         if (DuyetDoc(oco.Dong, oco.Cot, oco.Sohuu))
         {
             kt = oco.Sohuu == 1 ? KT.playes1 : KT.playes2;
             return(true);
         }
         if (DuyetNgang(oco.Dong, oco.Cot, oco.Sohuu))
         {
             kt = oco.Sohuu == 1 ? KT.playes1 : KT.playes2;
             return(true);
         }
         if (DuyetDuongCheoChinh(oco.Dong, oco.Cot, oco.Sohuu))
         {
             kt = oco.Sohuu == 1 ? KT.playes1 : KT.playes2;
             return(true);
         }
         if (DuyetDuongCheoPhu(oco.Dong, oco.Cot, oco.Sohuu))
         {
             kt = oco.Sohuu == 1 ? KT.playes1 : KT.playes2;
             return(true);
         }
     }
     if (DanhsachCoDaDanh.Count == 9)
     {
         kt = KT.Hoa;
         return(true);
     }
     return(false);
 }
示例#2
0
 /// <summary>
 /// 查找节点
 /// </summary>
 /// <param name="node"></param>
 /// <param name="value"></param>
 internal SearchNode(ref Node node, out VT value)
 {
     HashCode = node.HashCode;
     Key      = node.Key;
     Index    = int.MaxValue;
     value    = node.Value;
 }
示例#3
0
 /// <summary>
 /// 设置数据
 /// </summary>
 /// <param name="node"></param>
 /// <param name="value"></param>
 /// <param name="source"></param>
 /// <param name="next"></param>
 internal void Set(ref SearchNode node, VT value, uint source, int next)
 {
     HashCode = node.HashCode;
     Key      = node.Key;
     Value    = value;
     Source   = source;
     Next     = next;
 }
示例#4
0
 /// <summary>
 /// 设置数据
 /// </summary>
 /// <param name="node"></param>
 /// <param name="value"></param>
 /// <param name="source"></param>
 internal void Set(ref SearchNode node, VT value, uint source)
 {
     HashCode = node.HashCode;
     Key      = node.Key;
     Value    = value;
     Source   = source;
     Next     = int.MaxValue;
 }
示例#5
0
        public Token(string identifier, byte column, int line)
        {
            Column = column;
            Line   = line;

            if (Keyword.Find(identifier, out KT keywordType))
            {
                Type        = TT.Keyword;
                KeywordType = keywordType;
            }
            else
            {
                Type = TT.Identifier;
                IdentifierStringId = strings.Count;
                strings.Add(identifier);
            }
        }
示例#6
0
        public Token(TT type, string identifier, byte column, int line)
        {
            HIDebug.Assert(type == TT.Identifier || type == TT.String);
            Type   = type;
            Column = column;
            Line   = line;

            if (type == TT.Identifier && Keyword.Find(identifier, out KT keywordType))
            {
                Type        = TT.Keyword;
                KeywordType = keywordType;
            }
            else
            {
                StringId = strings.Count;
                strings.Add(identifier);
            }
        }
示例#7
0
 public static bool Find(string identifier, out KT keywordType) =>
 keywords.TryGetValue(identifier, out keywordType);
示例#8
0
 public KT(KT kt)
 {
     _kt = kt;
 }
示例#9
0
 public F(KT kt)
 {
 }
示例#10
0
 /// <summary>
 /// 查找节点
 /// </summary>
 /// <param name="key"></param>
 internal SearchNode(ref KT key)
 {
     HashCode = key.GetHashCode() & int.MaxValue;
     Key      = key;
     Index    = int.MaxValue;
 }
示例#11
0
 internal void Clear()
 {
     Key   = AutoCSer.Common.GetDefault <KT>();
     Value = AutoCSer.Common.GetDefault <VT>();
 }
示例#12
0
 public CacheItem(KT key, DateTime sign, VT data)
 {
     this.key  = key;
     this.sign = sign;
     this.data = data;
 }