Пример #1
0
 public void GiveToy(Toy t)
 {
     this.CurrentToy = t; //replcedcurrent toy
     this.Toys.Add(t);    //Add the toy to the list
 }
Пример #2
0
 public DuckToy(Duck duck = default, Toy toy = default)
 {
     Duck = duck;
     Toy  = toy;
 }
Пример #3
0
 public Pet()
 {
     this.CurrentToy = new Ball();       //Sets the deault toy
     this.Toys       = new List <Toy>(); //initialize the list of toys
     this.Toys.Add(CurrentToy);          //add default to to list
 }