예제 #1
0
        // Create start disks and put them in start pole
        void MakeStartDisks()
        {
            Pole startPole = polesList[StartPoleNumber];

            // add disks in start pole and draw them
            foreach (var disk in model.GetStartDisks(startPole))
            {
                view.DrawDisk(disk);
                startPole.AddDisk(disk);
            }
        }
예제 #2
0
        // Method that move the highest disk from oldPole, and put if to another
        void MoveDisk(Pole oldPole, Pole newPole)
        {
            // remove disk from old pole
            Disk d = oldPole.PopDisk();

            view.ClearDisk(d);
            view.DrawPole(oldPole);     // update empty space where was disk

            // add disk to new pole
            model.CalculateCoordinates(newPole, d);
            newPole.AddDisk(d);
            view.DrawDisk(d);
        }