Пример #1
0
    private bool CheckWinCondition()
    {
        //check if all disks are not moving and stacked on one rod
        bool middleRodWinCondition = (middleRod.GetDiskCount() == numberOfDisks) && !middleRod.AreDisksMoving();
        bool lastRodWinCondition   = (lastRod.GetDiskCount() == numberOfDisks) && !lastRod.AreDisksMoving();

        if (middleRodWinCondition || lastRodWinCondition)
        {
            return(true);
        }

        return(false);
    }
Пример #2
0
 private bool firstRodHasAllDisks()
 {
     return(firstRod.GetDiskCount() == numberOfDisks ? true : false);
 }