コード例 #1
0
 public void addHealthPotion(HealthPotion potion)
 {
     if (healthPotions.Count() < 5)
     {
         healthPotions.Add(potion);
     }
 }
コード例 #2
0
 public int useHealthPotion()
 {
     if (healthPotions.Count() > 0)
     {
         HealthPotion hp = healthPotions.Last();
         healthPotions.RemoveAt(healthPotions.Count() - 1);
         return(hp.Use());
     }
     else
     {
         return(0);
     }
 }