예제 #1
0
        /// <summary>
        ///     Returns number of controllers that have certain state type.
        /// </summary>
        /// <param name="type">Nodes state type</param>
        /// <returns>Number of controllers that have certain state type</returns>
        public int Count(FinchNodesStateType type)
        {
            int count = 0;

            for (FinchNodeType i = 0; i < FinchNodeType.Last; ++i)
            {
                count += GetState(i, type) ? 1 : 0;
            }
            return(count);
        }
예제 #2
0
 /// <summary>
 ///     Get certain type node state.
 /// </summary>
 /// <param name="node">Type of the node (physical device)</param>
 /// <param name="type"></param>
 /// <returns></returns>
 public bool GetState(FinchNodeType node, FinchNodesStateType type)
 {
     return((Flag & (0x1 << ((int)type + (int)node * (int)FinchNodesStateType.Last))) != 0);
 }