Exemple #1
0
 /// <summary>
 /// 设置物品标识
 /// </summary>
 /// <param name="mask">标识码</param>
 /// <param name="itemMaskType">物品标识类型</param>
 /// <param name="status">标识状态</param>
 public static void SetItemMask(ref uint mask, ItemMaskType itemMaskType, bool status = true)
 {
     if (status)
     {
         mask |= (uint)(1 << ((int)itemMaskType - 1));
     }
     else
     {
         mask &= (uint)(~(1 << ((int)itemMaskType - 1)));
     }
 }
Exemple #2
0
 /// <summary>
 /// 是否当前物品标识位为true
 /// </summary>
 /// <param name="mask">标识码</param>
 /// <param name="itemMaskType">物品标识类型</param>
 /// <returns></returns>
 public static bool IsItemMaskEnable(uint mask, ItemMaskType itemMaskType)
 {
     return((mask & (1 << ((int)itemMaskType - 1))) != 0 ? true : false);
 }