/// <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); }
/// <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); }