本文整理汇总了C#中Menu.Equals方法的典型用法代码示例。如果您正苦于以下问题:C# Menu.Equals方法的具体用法?C# Menu.Equals怎么用?C# Menu.Equals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Menu
的用法示例。
在下文中一共展示了Menu.Equals方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Menu_compare_dishes_test
public void Menu_compare_dishes_test()
{
Ingredient ing = new Ingredient()
{
Name = "ing1",
Price = 200
};
Ingredient ing2 = new Ingredient()
{
Name = "ing2",
Price = 200
};
Dish dish = new Dish()
{
Description = "asd",
Ingredients = new List<Ingredient>() { ing, ing2 },
Name = "dish1",
Status = 0
}; Dish dish2 = new Dish()
{
Description = "asd",
Ingredients = new List<Ingredient>() { ing, ing2 },
Name = "dish1",
Status = 0
};
Menu menu1 = new Menu()
{
Dishes = new List<Dish>() { dish, dish2 },
Name = "menu1"
};
Menu menu2 = new Menu()
{
Dishes = new List<Dish>() { dish, dish2 },
Name = "menu1"
};
Assert.IsTrue(menu1.Equals(menu2));
menu1.Dishes.Add(new Dish() { Name = "changed" });
Assert.IsFalse(menu1.Equals(menu2));
Assert.IsFalse(menu1.Equals(null));
}
示例2: getMenu
private static GameObject getMenu(Menu menu)
{
if (menu.Equals (Menu.MainMenu)) {
return mainMenuO;
}else if(menu.Equals(Menu.IntroScene)){
return introSceneO;
}else if(menu.Equals(Menu.ControlsMenu)){
return controlsO;
}else if(menu.Equals(Menu.CreditsMenu)){
return creditsO;
}else if(menu.Equals(Menu.YouWonMenu)){
return youWonO;
}else if(menu.Equals(Menu.YouLostMenu)){
return youLostO;
}else if(menu.Equals(Menu.StartingSplashScreen)){
return startingSplashScreenO;
}else if(menu.Equals(Menu.CraftingMenu)){
return craftingMenuO;
}else if(menu.Equals(Menu.InteractuablePopup)){
return interactuablePopupO;
}else if(menu.Equals(Menu.OnPauseMenu)){
return onPauseMenuO;
}else if(menu.Equals(Menu.BlackMenu)){
return blackMenuO;
}else if(menu.Equals(Menu.OptionsMenu)){
return optionsMenuO;
}
return null;
}