public Hivand EndunelHivandin() { _qanak--; Hivand mtav = _arachinHertum; _arachinHertum = _arachinHertum.Teghekutyun.Hajord; return(mtav); }
public void KangnacnelHivandinHertiMech(string anun, string azganun, string gangat) { _qanak++; Hivand hivand = new Hivand(anun, azganun, gangat); if (_verchin == null) { _verchin = hivand; _arachinHertum = hivand; } else { _verchin.Teghekutyun.Hajord = hivand; hivand.Teghekutyun.Naxord = _verchin; _verchin = hivand; } }
static void StugelHivandanociHerte() { BjishkiHert hert = new BjishkiHert(); hert.KangnacnelHivandinHertiMech("Suro", "Gonzales", "Xelar"); hert.KangnacnelHivandinHertiMech("Karen", "xhazaryan", "poshkek"); hert.KangnacnelHivandinHertiMech("Aram", "xhazaryan", "poshkek"); Hivand arajinEndunvacHivand = hert.EndunelHivandin(); Hivand erkrordEndunvacHivand = hert.EndunelHivandin(); Hivand errordEndunvacHivand = hert.EndunelHivandin(); if (arajinEndunvacHivand.Name == "Suro" && hert.Qanak == 0) { Console.WriteLine("Cragire chisht ashxatec!"); } else { Console.WriteLine("Cragire sxal ashxatec!"); } }