You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
32 lines
947 B
32 lines
947 B
|
2 years ago
|
namespace ClassLibrary1
|
||
|
|
{
|
||
|
|
/// <summary>
|
||
|
|
/// Доска
|
||
|
|
/// Крючок[]
|
||
|
|
/// </summary>
|
||
|
|
public class CBoard
|
||
|
|
{
|
||
|
|
public CBoard() { HookList = new List<CHook>(); }
|
||
|
|
public List<CHook> HookList { get; set; }
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Получить количество ключей с заданного этажа, которые есть в наличии
|
||
|
|
/// </summary>
|
||
|
|
/// <param name="iFloor"></param>
|
||
|
|
/// <returns></returns>
|
||
|
|
public int GetFloorKeyCount(int iFloor)
|
||
|
|
{
|
||
|
|
return HookList.Count(p => p.X == iFloor && p.Key != null);
|
||
|
|
}
|
||
|
|
|
||
|
|
/// <summary>
|
||
|
|
/// Получить количество ключей, которые есть в наличии
|
||
|
|
/// </summary>
|
||
|
|
/// <returns></returns>
|
||
|
|
public int GetKeyCount()
|
||
|
|
{
|
||
|
|
return HookList.Count(p => p.Key != null);
|
||
|
|
}
|
||
|
|
|
||
|
|
}
|
||
|
|
}
|