当前位置: 首页>>代码示例>>C#>>正文


C# World.CancelInputMode方法代码示例

本文整理汇总了C#中World.CancelInputMode方法的典型用法代码示例。如果您正苦于以下问题:C# World.CancelInputMode方法的具体用法?C# World.CancelInputMode怎么用?C# World.CancelInputMode使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在World的用法示例。


在下文中一共展示了World.CancelInputMode方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。

示例1: Order

		public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
		{
			if (mi.Button != MouseButton.Left)
				world.CancelInputMode();
			else if (!world.ShroudObscures(xy))
			{
				world.CancelInputMode();
				yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = xy, SuppressVisualFeedback = true };
			}
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:10,代码来源:BeaconOrderGenerator.cs

示例2: Order

        public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
        {
            if (mi.Button == MouseButton.Right)
                world.CancelInputMode();

            var ret = InnerOrder(world, xy, mi).ToList();
            if (ret.Count > 0)
                world.CancelInputMode();

            return ret;
        }
开发者ID:Generalcamo,项目名称:OpenRA,代码行数:11,代码来源:PlaceBuildingOrderGenerator.cs

示例3: Order

        public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
        {
            if (mi.Button == MouseButton.Right)
                world.CancelInputMode();

            var ret = InnerOrder( world, xy, mi ).ToList();
            foreach( var order in ret )
            {
                world.CancelInputMode();
                break;
            }
            return ret;
        }
开发者ID:pdovy,项目名称:OpenRA,代码行数:13,代码来源:PlaceBuildingOrderGenerator.cs

示例4: Order

		public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
		{
			if (mi.Button == MouseButton.Right)
				world.CancelInputMode();

			var ret = InnerOrder(world, xy, mi).ToArray();

			// If there was a successful placement order
			if (ret.Any(o => o.OrderString == "PlaceBuilding"
				|| o.OrderString == "LineBuild"
				|| o.OrderString == "PlacePlug"))
				world.CancelInputMode();

			return ret;
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:15,代码来源:PlaceBuildingOrderGenerator.cs

示例5: Order

        public IEnumerable<Order> Order(World world, CPos cell, int2 worldPixel, MouseInput mi)
        {
            world.CancelInputMode();

            if (mi.Button == MouseButton.Left)
                yield return new Order("PlaceBeacon", world.LocalPlayer.PlayerActor, false) { TargetLocation = cell, SuppressVisualFeedback = true };
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:7,代码来源:BeaconOrderGenerator.cs

示例6: Order

        public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
        {
            if (mi.Button == MouseButton.Right)
                world.CancelInputMode();

            return OrderInner(world, xy, mi);
        }
开发者ID:pdovy,项目名称:OpenRA,代码行数:7,代码来源:RepairOrderGenerator.cs

示例7: OrderInner

		protected virtual IEnumerable<Order> OrderInner(World world, CPos xy, MouseInput mi)
		{
			if (mi.Button == ExpectedButton && world.Map.Contains(xy))
			{
				world.CancelInputMode();
				foreach (var subject in Subjects)
					yield return new Order(OrderName, subject, false) { TargetLocation = xy };
			}
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:9,代码来源:GenericSelectTarget.cs

示例8: Order

        public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
        {
            if (mi.Button == MouseButton.Left)
            {
                world.CancelInputMode();
                yield break;
            }

            if (world.LocalPlayer.Shroud.IsExplored(xy))
                yield return new Order("ChronoshiftSelf", self, xy);
        }
开发者ID:pdovy,项目名称:OpenRA,代码行数:11,代码来源:SetChronoTankDestination.cs

示例9: Order

        public IEnumerable<Order> Order(World world, int2 xy, MouseInput mi)
        {
            if (mi.Button == MouseButton.Left)
            {
                world.CancelInputMode();
                yield break;
            }

            var queued =  mi.Modifiers.HasModifier(Modifiers.Shift);
            if (world.LocalPlayer.Shroud.IsExplored(xy))
                yield return new Order("ChronoshiftSelf", self, queued) { TargetLocation = xy };
        }
开发者ID:patthoyts,项目名称:OpenRA,代码行数:12,代码来源:SetChronoTankDestination.cs

示例10: Tick

        public void Tick( World world )
        {
            // Find the queue with the target actor
            var queue = Producer.TraitsImplementing<ProductionQueue>()
                .Where(p => p.CurrentItem() != null &&
                         	p.CurrentItem().Item == Building &&
                         	p.CurrentItem().RemainingTime == 0)
                .FirstOrDefault();

            if (queue == null)
                world.CancelInputMode();
        }
开发者ID:subspace,项目名称:OpenRA,代码行数:12,代码来源:PlaceBuildingOrderGenerator.cs

示例11: OrderInner

        protected override IEnumerable<Order> OrderInner(World world, CPos xy, MouseInput mi)
        {
            if (mi.Button != ExpectedButton)
                yield break;

            var target = FriendlyGuardableUnits(world, mi).FirstOrDefault();
            if (target == null || Subjects.All(s => s.IsDead))
                yield break;

            world.CancelInputMode();
            foreach (var subject in Subjects)
                if (subject != target)
                    yield return new Order(OrderName, subject, false) { TargetActor = target };
        }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:14,代码来源:GuardOrderGenerator.cs

示例12: Order

            public IEnumerable<Order> Order(World world, CPos cell, int2 worldPixel, MouseInput mi)
            {
                if (mi.Button == Game.Settings.Game.MouseButtonPreference.Cancel)
                {
                    world.CancelInputMode();
                    yield break;
                }

                var underCursor = world.ScreenMap.ActorsAt(mi)
                    .Where(a => !world.FogObscures(a))
                    .MaxByOrDefault(a => a.Info.HasTraitInfo<SelectableInfo>()
                        ? a.Info.TraitInfo<SelectableInfo>().Priority : int.MinValue);

                if (mi.Button == Game.Settings.Game.MouseButtonPreference.Action && underCursor == null)
                {
                    minelayer.World.CancelInputMode();
                    yield return new Order("PlaceMinefield", minelayer, false) { TargetLocation = cell };
                }
            }
开发者ID:CH4Code,项目名称:OpenRA,代码行数:19,代码来源:Minelayer.cs

示例13: Order

			public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
			{
				world.CancelInputMode();
				if (mi.Button == MouseButton.Left && power.UnitsInRange(xy).Any())
					yield return new Order(order, manager.Self, false) { TargetLocation = xy, SuppressVisualFeedback = true };
			}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:6,代码来源:GrantUpgradePower.cs

示例14: Tick

 public void Tick(World world)
 {
     if (world.LocalPlayer != null &&
         world.LocalPlayer.WinState != WinState.Undefined)
         world.CancelInputMode();
 }
开发者ID:Generalcamo,项目名称:OpenRA,代码行数:6,代码来源:RepairOrderGenerator.cs

示例15: Order

        public IEnumerable<Order> Order(World world, CPos xy, MouseInput mi)
        {
            if (mi.Button == Game.mouseButtonPreference.Cancel)
            {
                world.CancelInputMode();
                yield break;
            }

            var queued = mi.Modifiers.HasModifier(Modifiers.Shift);

            var cinfo = self.Trait<ChronoshiftDeploy>();
            if (cinfo.CanJumpTo(xy, false))
            {
                self.World.CancelInputMode();
                yield return new Order("ChronoshiftJump", self, queued) { TargetLocation = xy };
            }
        }
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:17,代码来源:ChronoshiftDeploy.cs


注:本文中的World.CancelInputMode方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。