示例#1
0
        static void Main(string[] args)
        {
            var listOfSharpies = new SharpieSet();
            var first          = new Sharpie("red", 55);
            var second         = new Sharpie("green", 50);
            var third          = new Sharpie("blue", 15);
            var fourth         = new Sharpie("black", 15);

            listOfSharpies.AddSharpie(first);
            listOfSharpies.AddSharpie(second);
            listOfSharpies.AddSharpie(third);
            listOfSharpies.AddSharpie(fourth);


            first.Use();
            first.Use();

            listOfSharpies.HowMany();



            Console.WriteLine(listOfSharpies.CountUsable());

            Console.ReadLine();
        }
示例#2
0
        static void Main(string[] args)
        {
            Sharpie pencil = new Sharpie("red", 5);
            Sharpie tuzka  = new Sharpie("blue", 5);
            Sharpie pero   = new Sharpie("black", 5);

            SharpieSet psaciSouprava = new SharpieSet();

            psaciSouprava.Add(pencil);
            psaciSouprava.Add(tuzka);
            psaciSouprava.Add(pero);

            pero.Use();
            tuzka.Use();
            psaciSouprava.RemoveTrash();

            psaciSouprava.CountUsable();
            Console.WriteLine(psaciSouprava.GetCount());
        }
示例#3
0
 public void Add(Sharpie name)
 {
     SetOfSharpies.Add(name);
 }
示例#4
0
 public void UseSharpie(Sharpie sharpie)
 {
     sharpie.Use();
 }
示例#5
0
 public void AddSharpie(Sharpie sharpie)
 {
     SharpieList.Add(sharpie);
 }