本文整理汇总了C#中Animal.GetMeatFromKillQuantity方法的典型用法代码示例。如果您正苦于以下问题:C# Animal.GetMeatFromKillQuantity方法的具体用法?C# Animal.GetMeatFromKillQuantity怎么用?C# Animal.GetMeatFromKillQuantity使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Animal
的用法示例。
在下文中一共展示了Animal.GetMeatFromKillQuantity方法的10个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryEatAnimal
// Method
public int TryEatAnimal(Animal animal)
{
if (animal != null && (animal.Size <= this.Size || animal.State == AnimalState.Sleeping))
{
return animal.GetMeatFromKillQuantity();
}
return 0;
}
示例2: TryEatAnimal
// Methods
public int TryEatAnimal(Animal animal)
{
if (animal != null && animal.Size <= this.Size)
{
return animal.GetMeatFromKillQuantity();
}
return 0;
}
示例3: TryEatAnimal
public int TryEatAnimal(Animal animal)
{
if (animal != null && (animal.Size <= BoarDefaultSize))
{
return animal.GetMeatFromKillQuantity();
}
return 0;
}
示例4: TryEatAnimal
public int TryEatAnimal(Animal animal)
{
if (this.Size >= animal.Size || animal.State == AnimalState.Sleeping ||)
{
return animal.GetMeatFromKillQuantity();
}
return 0;
}
示例5: TryEatAnimal
public int TryEatAnimal(Animal animal)
{
int meatEaten = 0;
if (animal != null && animal.Size <= base.Size)
{
meatEaten = animal.GetMeatFromKillQuantity();
}
return meatEaten;
}
示例6: TryEatAnimal
public int TryEatAnimal(Animal animal)
{
if (animal != null && (animal.Size <= (this.Size * 2)))
{
this.Size += 1;
return animal.GetMeatFromKillQuantity();
}
return 0;
}
示例7: TryEatAnimal
public int TryEatAnimal(Animal animal)
{
if(animal != null)
{
if(animal.Size <= this.Size * 2)
{
this.Size++;
return animal.GetMeatFromKillQuantity();
}
}
return 0;
}
示例8: TryEatAnimal
public int TryEatAnimal(Animal animal)
{
if (animal != null)
{
if (this.Size >= 2 * animal.Size || animal.State == AnimalState.Sleeping)
{
this.Size += 1;
return animal.GetMeatFromKillQuantity();
}
}
return 0;
}
示例9: TryEatAnimal
public int TryEatAnimal(Animal animal)
{
if (animal != null)
{
var meatEaten = 0;
if (this.Size >= animal.Size || animal.State == AnimalState.Sleeping)
{
meatEaten = animal.GetMeatFromKillQuantity();
}
return meatEaten;
}
return 0;
}
示例10: TryEatAnimal
public int TryEatAnimal(Animal animal)
{
if (animal != null)
{
if (this.Size >= animal.Size || animal.State.Equals(AnimalState.Sleeping))
{
return animal.GetMeatFromKillQuantity();
}
}
return 0;
}