예제 #1
0
        public void UndersDoCarryPeople()
        {
            Under under = new Under();

            under.CarriesPeople = true;

            Assert.True(under.CarriesPeople);
        }
예제 #2
0
        public void UndersHave4Doors()
        {
            Under under = new Under();

            under.NumberOfDoors = 4;

            Assert.Equal(4, under.NumberOfDoors);
        }
예제 #3
0
        public void UndersHave10Wheeles()
        {
            Under under = new Under();

            under.NumberOfWheeles = 10;

            Assert.Equal(10, under.NumberOfWheeles);
        }
예제 #4
0
        public void UndersDontRequireALiscense()
        {
            Under under = new Under();

            under.RequiresLiscense = false;

            Assert.False(under.RequiresLiscense);
        }
예제 #5
0
 public void CentralSignal(GameObject other)
 {
     if (other.tag == "Under")
     {
         Under other_script = other.gameObject.GetComponent <Under>();
         int   other_type   = other_script.type;
         if (other_type == 0)
         {
             HappyFinishing();
         }
         else if (other_type == 11)
         {
             if (type == 11)
             {
                 //Lay egg
                 if (store != null && other_script.full == false)
                 {
                     GameObject instance = Instantiate(store, new Vector3(Mathf.Round(other.transform.position.x), Mathf.Round(other.transform.position.y), -2), Quaternion.identity) as GameObject;
                     store = null;
                     instance.transform.parent = GameObject.Find("CoinMaker").transform;
                     other_script.full         = true;
                 }
             }
             else if (type == 10)
             {
                 if (store == null && other_script.full == true)
                 {
                     other_script.full = false;
                 }
             }
         }
         else if (other_type > 100)
         {
             //do nothing;
         }
         else
         {
             transform.position = new Vector3(Mathf.Round(transform.position.x), Mathf.Round(transform.position.y), -2);
             direction          = other_type - 1;
         }
     }
     else if (other.tag == "Item")
     {
         if (type == 10)
         {
             if (store == null)
             {
                 store = other.gameObject;
                 store.transform.parent        = transform;
                 store.transform.localPosition = new Vector3(0, 1, 0);
                 store.transform.tag           = "Ignore";
             }
         }
     }
 }
예제 #6
0
        public void UndersHave2Doors()
        {
            Under under = new Under();

            Assert.Equal(2, under.NumberOfDoors);
        }
예제 #7
0
        public void UndersHave20Wheeles()
        {
            Under under = new Under();

            Assert.Equal(20, under.NumberOfWheeles);
        }
예제 #8
0
        public void UndersDontCarryPeople()
        {
            Under under = new Under();

            Assert.False(under.CarriesPeople);
        }
예제 #9
0
        public void UndersRequireALiscense()
        {
            Under under = new Under();

            Assert.True(under.RequiresLiscense);
        }
예제 #10
0
        static void Main(string[] args)
        {
            Under under = new Under();

            under.Honks();
        }