示例#1
0
        private void SetupOrders(Game instance)
        {
            var improvements = instance.TerrainImprovements.Values;

            var orderText = MenuLoader.For("ORDERS");

            Orders = improvements.Select(i =>
                                         new ImprovementOrder(i, this, instance, orderText.FirstOrDefault(mi => string.Equals(mi.Shortcut, i.Shortcut, StringComparison.InvariantCultureIgnoreCase)))).Cast <Order>()
                     .ToList();

            Orders.Add(new BuildCity(this, orderText.First(mi => mi.Shortcut == "b").MenuText, instance));
            Orders.Add(new PillageOrder(this, orderText.First(mi => mi.Shortcut == "Shift+P").MenuText, instance));
            Orders.Add(new FortifyOrder(this, orderText.Last(mi => mi.Shortcut == "f").MenuText, instance));
            Orders.Add(new SkipOrder(this, orderText.First(mi => mi.Shortcut == "SPACE").MenuText, instance));
            Orders.Add(new WaitOrder(this, orderText.First(mi => mi.Shortcut == "w").MenuText, instance));
            Orders.Add(new UnloadOrder(this, orderText.First(mi => mi.Shortcut == "u").MenuText));
            Orders.Add(new SleepOrder(this, orderText.First(mi => mi.Shortcut == "s").MenuText, instance));
            Orders.Add(new GotoOrder(this, orderText.First(mi => mi.Shortcut == "g").MenuText, instance));

            UpdateOrders(CurrentPlayer.ActiveTile, CurrentPlayer.ActiveUnit);
        }