コード例 #1
0
ファイル: BearAdapter.cs プロジェクト: MizuRyujin/LP2Aula
 public void Fetch(object objectToFetch)
 {
     bear.LookAt(objectToFetch);
     bear.GoTowards(objectToFetch);
     if (bear.TryEat(objectToFetch))
     {
         Console.WriteLine("Yeeeey, I ate the " + objectToFetch);
     }
     else
     {
         Console.WriteLine("Shit" + objectToFetch + "got away...");
     }
 }
コード例 #2
0
        public void Fetch(object objectToFetch)
        {
            bear.GoTowards(objectToFetch);
            bear.LookAt(objectToFetch);
            if (bear.TryEat(objectToFetch))
            {
                Console.WriteLine("Yay i ate the " + objectToFetch);
            }

            else
            {
                Console.WriteLine("oops i will not eat this");
            }
        }
コード例 #3
0
 public void Fetch(object objectToFetch)
 {
     bear.LookAt(objectToFetch);
     bear.GoTowards(objectToFetch);
     bear.TryEat(objectToFetch);
 }