public void TestCheckWhenFull()
        {
            UnitStorage uStorage = new UnitStorage(10);

            uStorage.Gather(20);

            Assert.True(uStorage.checkFull());
        }
        public void TestCheckWhenNotFull()
        {
            UnitStorage uStorage = new UnitStorage(40);

            uStorage.Gather(20);

            Assert.False(uStorage.checkFull());
        }
Example #3
0
 public void GatherResource(ResourceType resourceType)
 {
     unitStorage.SetResourceType(resourceType);
     unitStorage.Gather(unitGatherAmount);
     animator.SetBool("working", true);
     if (unitStorage.checkFull())
     {
         Debug.Log("unit storage is full");
         animator.SetBool("working", false);
         DepositResource();
     }
 }