首先,我今天第一次开始使用 UWP。
\n\n我可以\xc2\xb4t 似乎找到“ApplicationView”设置,我试图将以下代码片段添加到我的 MainPage 构造函数中:
\n\npublic MainPage()\n{\n this.InitializeComponent();\n\n ApplicationView.PreferredLaunchViewSize = new Size(480, 800);\n ApplicationView.PreferredLaunchWindowingMode = ApplicationViewWindowingMode.PreferredLaunchViewSize;\n\n // if you want not to have any window smaller than this size...\n ApplicationView.GetForCurrentView().SetPreferredMinSize(new Size(480, 800));\n}\nRun Code Online (Sandbox Code Playgroud)\n\n\n 我有一个带有Flags的枚举:
[Flags]
public enum ItemType
{
Shop,
Farm,
Weapon,
Process,
Sale
}
Run Code Online (Sandbox Code Playgroud)
然后,我在列表中有几个对象有一些标志设置和一些标志未设置。看起来像这样:
public static List<ItemInfo> AllItems = new List<ItemInfo>
{
new ItemInfo{ID = 1, ItemType = ItemType.Shop, Name = "Wasserflasche", usable = true, Thirst = 50, Hunger = 0, Weight = 0.50m, SalesPrice = 2.50m, PurchasePrice = 5, ItemUseAnimation = new Animation("Trinken", "amb@world_human_drinking@coffee@female@idle_a", "idle_a", (AnimationFlags.OnlyAnimateUpperBody | AnimationFlags.AllowPlayerControl)) },
new ItemInfo{ID = 2, ItemType = ItemType.Sale, Name = "Sandwich", usable = true, Thirst = 0, Hunger = 50, Weight = …Run Code Online (Sandbox Code Playgroud)