本文整理汇总了C#中Recipe.DoesLotHaveRightTech方法的典型用法代码示例。如果您正苦于以下问题:C# Recipe.DoesLotHaveRightTech方法的具体用法?C# Recipe.DoesLotHaveRightTech怎么用?C# Recipe.DoesLotHaveRightTech使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Recipe
的用法示例。
在下文中一共展示了Recipe.DoesLotHaveRightTech方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: PrepareTestResultCheckAndGrayedOutPieMenuSet
public static bool PrepareTestResultCheckAndGrayedOutPieMenuSet(Recipe recipe, Sim sim, ref GreyedOutTooltipCallback greyedOutTooltipCallback)
{
List<Ingredient> lotIngredients = null;
Lot lotHome = sim.LotHome;
Recipe chosenRecipe = null;
bool isSnack = recipe.IsSnack;
bool lotHasCounter = Food.LotHasUsableCounter(sim.LotCurrent);
bool lotHasStove = Food.LotHasUsableStove(sim.LotCurrent);
bool lotHasMicrowave = Food.LotHasUsableMicrowave(sim.LotCurrent);
bool lotHasGrill = Food.LotHasUsableGrill(sim.LotCurrent);
if (lotHome.Household != null && lotHome.Household.SharedFridgeInventory != null && lotHome.Household.SharedFridgeInventory.Inventory != null)
{
lotIngredients = Recipe.GetCookableIngredients(lotHome.Household.SharedFridgeInventory.Inventory);
}
List<Ingredient> cookableIngredients = Recipe.GetCookableIngredients(sim.Inventory);
//Find the correct recipes
if ((!recipe.CookingProcessData.UsesAMicrowave || !sim.SimDescription.ChildOrBelow) && (!(recipe.Key == "VampireJuice") || sim.SimDescription.IsVampire) && recipe.DoesLotHaveRightTech(lotHasCounter, lotHasStove, lotHasMicrowave, lotHasGrill, Recipe.MealQuantity.Single) == Recipe.CanMakeFoodTestResult.Pass)
{
int cost = 0;
chosenRecipe = AniRecipe.ReturnSnackIngredientRecipe(sim, recipe);
if (chosenRecipe != null)
cost = AniRecipe.CalculateCost(chosenRecipe, cookableIngredients, lotIngredients, isSnack);
}
if (chosenRecipe == null)
return false;
if (chosenRecipe != null && AniRecipe.CalculateCost(chosenRecipe, cookableIngredients, lotIngredients, isSnack) == -2147483648)
{
greyedOutTooltipCallback = delegate
{
return PrepareTestResultCheckAndGrayedOutPieMenuSet(sim, chosenRecipe, recipe.GenericName, isSnack);
};
return false;
}
return true;
}
示例2: ReturnSnackIngredientRecipe
public static Recipe ReturnSnackIngredientRecipe(Sim sim, Recipe recipe)
{
Recipe chosenRecipe = null;
bool lotHasCounter = Food.LotHasUsableCounter(sim.LotCurrent);
bool lotHasStove = Food.LotHasUsableStove(sim.LotCurrent);
bool lotHasMicrowave = Food.LotHasUsableMicrowave(sim.LotCurrent);
bool lotHasGrill = Food.LotHasUsableGrill(sim.LotCurrent);
//Find the correct recipes
Recipe fruitRecipe = Recipe.Recipes.Find(delegate(Recipe r) { return r.Key.Equals(AddMenuItem.FruitRecipe); });
Recipe cheeseRecipe = Recipe.Recipes.Find(delegate(Recipe r) { return r.Key.Equals(AddMenuItem.CheeseRecipe); });
Recipe vegetableRecipe = Recipe.Recipes.Find(delegate(Recipe r) { return r.Key.Equals(AddMenuItem.VegetableRecipe); });
Recipe vampireRecipe = Recipe.Recipes.Find(delegate(Recipe r) { return r.Key.Equals(AddMenuItem.VampireRecipe); });
if ((!recipe.CookingProcessData.UsesAMicrowave || !sim.SimDescription.ChildOrBelow) && (!(recipe.Key == "VampireJuice") || sim.SimDescription.IsVampire) && recipe.DoesLotHaveRightTech(lotHasCounter, lotHasStove, lotHasMicrowave, lotHasGrill, Recipe.MealQuantity.Single) == Recipe.CanMakeFoodTestResult.Pass)
{
if (vegetableRecipe != null && recipe.Key.Equals("CannedSoup"))
{
chosenRecipe = vegetableRecipe;
}
else if (chosenRecipe == null && vampireRecipe != null && recipe.Key.Equals("VampireJuice"))
{
chosenRecipe = vampireRecipe;
}
else if (chosenRecipe == null && fruitRecipe != null && !recipe.CookingProcessData.UsesAMicrowave)
{
chosenRecipe = fruitRecipe;
}
else if (chosenRecipe == null && cheeseRecipe != null && recipe.CookingProcessData.UsesAMicrowave)
{
chosenRecipe = cheeseRecipe;
}
}
return chosenRecipe;
}