本文整理汇总了C#中GameObjects.Troop.IncreaseFood方法的典型用法代码示例。如果您正苦于以下问题:C# Troop.IncreaseFood方法的具体用法?C# Troop.IncreaseFood怎么用?C# Troop.IncreaseFood使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类GameObjects.Troop
的用法示例。
在下文中一共展示了Troop.IncreaseFood方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Refill
public int Refill(Troop troop, float rate)
{
if (this.InefficiencyDays > 0)
{
rate *= 2f;
}
if (rate < 1f)
{
rate = 1f - rate;
int increment = troop.FoodMax - troop.Food;
if (increment > 0)
{
int num2 = (int) (this.StartArchitecture.Food * rate);
if ((num2 + troop.Food) >= troop.FoodCostPerDay)
{
if (num2 >= increment)
{
troop.IncreaseFood(increment);
this.StartArchitecture.DecreaseFood((int) (((float) increment) / rate));
this.BelongedFaction.IncreaseTechniquePoint(increment / 200);
this.BelongedFaction.IncreaseReputation(increment / 0x2710);
return (int) (increment * rate);
}
int num3 = (((num2 + troop.Food) / troop.FoodCostPerDay) * troop.FoodCostPerDay) - troop.Food;
troop.IncreaseFood(num3);
this.StartArchitecture.DecreaseFood((int) (((float) num3) / rate));
this.BelongedFaction.IncreaseTechniquePoint(num3 / 200);
this.BelongedFaction.IncreaseReputation(num3 / 0x2710);
return (int) (num3 * rate);
}
}
}
return 0;
}