• 设为首页
  • 点击收藏
  • 手机版
    手机扫一扫访问
    迪恩网络手机版
  • 关注官方公众号
    微信扫一扫关注
    公众号

C# PPos类代码示例

原作者: [db:作者] 来自: [db:来源] 收藏 邀请

本文整理汇总了C#中PPos的典型用法代码示例。如果您正苦于以下问题:C# PPos类的具体用法?C# PPos怎么用?C# PPos使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。



PPos类属于命名空间,在下文中一共展示了PPos类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。

示例1: AddCellsToPlayerShroud

        protected override void AddCellsToPlayerShroud(Actor self, Player p, PPos[] uv)
        {
            if (!info.ValidStances.HasStance(p.Stances[self.Owner]))
                return;

            p.Shroud.AddSource(this, Shroud.SourceType.Shroud, uv);
        }
开发者ID:pchote,项目名称:OpenRA,代码行数:7,代码来源:CreatesShroud.cs


示例2: Smoke

 public Smoke(World world, PPos pos, string trail)
 {
     this.pos = pos;
     anim = new Animation(trail);
     anim.PlayThen("idle",
         () => world.AddFrameEndTask(w => w.Remove(this)));
 }
开发者ID:JamesDunne,项目名称:OpenRA,代码行数:7,代码来源:Smoke.cs


示例3: Explosion

 public Explosion(World world, PPos pixelPos, string style, bool isWater, int altitude)
 {
     this.pos = pixelPos;
     this.altitude = altitude;
     anim = new Animation("explosion");
     anim.PlayThen(style,
         () => world.AddFrameEndTask(w => w.Remove(this)));
 }
开发者ID:Iran,项目名称:ClassicRA,代码行数:8,代码来源:Explosion.cs


示例4: Leap

        public Leap(Actor self, Target target)
        {
            this.target = target;
            initialLocation = (PPos) self.Trait<Mobile>().PxPosition;

            self.Trait<RenderInfantry>().Attacking(self, target);
            Sound.Play("dogg5p.aud", self.CenterLocation);
        }
开发者ID:nevelis,项目名称:OpenRA,代码行数:8,代码来源:Leap.cs


示例5: ActorsInBox

        public IEnumerable<Actor> ActorsInBox(PPos a, PPos b)
        {
            var r = Rectangle.FromLTRB(a.X, a.Y, b.X, b.Y);

            return ActorsInBins(a.X / scale, b.X / scale, a.Y / scale, b.Y / scale)
                .Distinct()
                .Where(u => u.IsInWorld && u.ExtendedBounds.Value.IntersectsWith(r));
        }
开发者ID:TiriliPiitPiit,项目名称:OpenRA,代码行数:8,代码来源:SpatialBins.cs


示例6: ApplyOrders

        public void ApplyOrders(World world, PPos xy, MouseInput mi)
        {
            if (world.OrderGenerator == null) return;

            var orders = world.OrderGenerator.Order(world, xy.ToCPos(), mi).ToArray();
            orders.Do(o => world.IssueOrder(o));

            world.PlayVoiceForOrders(orders);
        }
开发者ID:Tsher,项目名称:OpenRA,代码行数:9,代码来源:WorldInteractionControllerWidget.cs


示例7: CashTick

 public CashTick(string value, int lifetime, int velocity, PPos pos, Color color)
 {
     this.color = color;
     this.velocity = velocity;
     this.pos = pos;
     s = value;
     font = Game.Renderer.Fonts["TinyBold"];
     offset = 0.5f*font.Measure(s).ToFloat2();
     remaining = lifetime;
 }
开发者ID:nevelis,项目名称:OpenRA,代码行数:10,代码来源:CashTick.cs


示例8: Parachute

        public Parachute(Actor cargo, PPos location, int altitude)
        {
            this.location = location;
            this.altitude = altitude;
            this.cargo = cargo;

            var pai = cargo.Info.Traits.GetOrDefault<ParachuteAttachmentInfo>();
            paraAnim = new Animation(pai != null ? pai.ParachuteSprite : "parach");
            paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));

            if (pai != null) offset = pai.Offset;

            cargo.Trait<ITeleportable>().SetPxPosition(cargo, location);
        }
开发者ID:nevelis,项目名称:OpenRA,代码行数:14,代码来源:Parachute.cs


示例9: GenerateRenderables

        public IEnumerable<Renderable> GenerateRenderables(WorldRenderer wr)
        {
            var bright = SequenceProvider.GetSequence(Info.Image, "bright");
            var dim = SequenceProvider.GetSequence(Info.Image, "dim");

            var src = new PPos(Args.src.X, Args.src.Y - Args.srcAltitude);
            var dest = new PPos(Args.dest.X, Args.dest.Y - Args.destAltitude);
            for (var n = 0; n < Info.DimZaps; n++)
                foreach (var z in DrawZapWandering(wr, src, dest, dim))
                    yield return z;
            for (var n = 0; n < Info.BrightZaps; n++)
                foreach (var z in DrawZapWandering(wr, src, dest, bright))
                    yield return z;
        }
开发者ID:Tsher,项目名称:OpenRA,代码行数:14,代码来源:TeslaZap.cs


示例10: FrozenActor

        public FrozenActor(Actor self, PPos[] footprint, Shroud shroud)
        {
            actor = self;
            this.shroud = shroud;

            // Consider all cells inside the map area (ignoring the current map bounds)
            Footprint = footprint
                .Where(m => shroud.Contains(m))
                .ToArray();

            CenterPosition = self.CenterPosition;
            Bounds = self.Bounds;

            UpdateVisibility();
        }
开发者ID:rhamilton1415,项目名称:OpenRA,代码行数:15,代码来源:FrozenActorLayer.cs


示例11: FrozenActor

		public FrozenActor(Actor self, PPos[] footprint, Shroud shroud, bool startsRevealed)
		{
			actor = self;
			this.shroud = shroud;
			NeedRenderables = startsRevealed;
			removeFrozenActors = self.TraitsImplementing<IRemoveFrozenActor>().ToArray();

			// Consider all cells inside the map area (ignoring the current map bounds)
			Footprint = footprint
				.Where(m => shroud.Contains(m))
				.ToArray();

			CenterPosition = self.CenterPosition;
			Bounds = self.Bounds;
			TargetTypes = self.TraitsImplementing<ITargetable>().Where(Exts.IsTraitEnabled).SelectMany(t => t.TargetTypes).ToHashSet();

			UpdateVisibility();
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:18,代码来源:FrozenActorLayer.cs


示例12: DoExplosion

        public static void DoExplosion(Actor attacker, string weapontype, PPos pos, int altitude)
        {
            var args = new ProjectileArgs
            {
                src = pos,
                dest = pos,
                srcAltitude = altitude,
                destAltitude = altitude,
                firedBy = attacker,
                target = Target.FromPos(pos),
                weapon = Rules.Weapons[ weapontype.ToLowerInvariant() ],
                facing = 0
            };

            if (args.weapon.Report != null)
                Sound.Play(args.weapon.Report + ".aud", pos);

            DoImpacts(args);
        }
开发者ID:Iran,项目名称:ClassicRA,代码行数:19,代码来源:Combat.cs


示例13: Render

        public IEnumerable<Renderable> Render(WorldRenderer wr)
        {
            if (explosion != null)
                yield return new Renderable(explosion.Image, args.dest.ToFloat2() - .5f * explosion.Image.size,
                                            wr.Palette("effect"), (int)args.dest.Y);

            if (ticks >= info.BeamDuration)
                yield break;

            var rc = Color.FromArgb((info.BeamDuration - ticks)*255/info.BeamDuration, color);

            var src = new PPos(args.src.X, args.src.Y - args.srcAltitude);
            var dest = new PPos(args.dest.X, args.dest.Y - args.destAltitude);
            var wlr = Game.Renderer.WorldLineRenderer;
            wlr.LineWidth = info.BeamRadius * 2;
            wlr.DrawLine(src.ToFloat2(), dest.ToFloat2(), rc, rc);
            wlr.Flush();
            wlr.LineWidth = 1f;
        }
开发者ID:Tsher,项目名称:OpenRA,代码行数:19,代码来源:LaserZap.cs


示例14: AddProjectedVisibility

		public void AddProjectedVisibility(Actor a, PPos[] visible)
		{
			if (!a.Owner.IsAlliedWith(self.Owner))
				return;

			foreach (var puv in visible)
			{
				// Force cells outside the visible bounds invisible
				if (!map.Contains(puv))
					continue;

				var uv = (MPos)puv;
				visibleCount[uv]++;
				explored[uv] = true;
			}

			if (visibility.ContainsKey(a))
				throw new InvalidOperationException("Attempting to add duplicate actor visibility");

			visibility[a] = visible;
			Invalidate(visible);
		}
开发者ID:Roger-luo,项目名称:OpenRA,代码行数:22,代码来源:Shroud.cs


示例15: Parachute

        public Parachute(Player owner, PPos location, int altitude, Actor cargo)
        {
            this.location = location;
            this.altitude = altitude;
            this.cargo = cargo;

            var rs = cargo.Trait<RenderSimple>();
            var image = rs.anim.Name;
            palette = rs.Palette(owner);

            anim = new Animation(image);
            if (anim.HasSequence("idle"))
                anim.PlayFetchIndex("idle", () => 0);
            else
                anim.PlayFetchIndex("stand", () => 0);
            anim.Tick();

            var pai = cargo.Info.Traits.GetOrDefault<ParachuteAttachmentInfo>();

            paraAnim = new Animation(pai != null ? pai.ParachuteSprite : "parach");
            paraAnim.PlayThen("open", () => paraAnim.PlayRepeating("idle"));

            if (pai != null) offset = pai.Offset;
        }
开发者ID:JamesDunne,项目名称:OpenRA,代码行数:24,代码来源:Parachute.cs


示例16: FindAliveNonCombatantActorsInCircle

 public static IEnumerable<Actor> FindAliveNonCombatantActorsInCircle(this World world, PPos location, int range)
 {
     return world.FindUnitsInCircle(location, Game.CellSize * range)
         .Where(u => u.IsInWorld && u != world.WorldActor && !u.IsDead() && u.Owner.NonCombatant);
 }
开发者ID:VrKomarov,项目名称:OpenRA,代码行数:5,代码来源:MissionUtils.cs


示例17: Fly

 Fly(PPos px)
 {
     Pos = px;
 }
开发者ID:Iran,项目名称:ClassicRA,代码行数:4,代码来源:Fly.cs


示例18: ClosestPlayerUnits

 public static IEnumerable<Actor> ClosestPlayerUnits(World world, Player player, PPos location, int range)
 {
     return world.FindAliveCombatantActorsInCircle(location, range)
         .Where(a => a.Owner == player && a.HasTrait<IMove>())
         .OrderBy(a => (location - a.CenterLocation).LengthSquared);
 }
开发者ID:VrKomarov,项目名称:OpenRA,代码行数:6,代码来源:MissionUtils.cs


示例19: FindAliveCombatantActorsInBox

 public static IEnumerable<Actor> FindAliveCombatantActorsInBox(this World world, PPos a, PPos b)
 {
     return world.FindUnits(a, b).Where(u => u.IsInWorld && u != world.WorldActor && !u.IsDead() && !u.Owner.NonCombatant);
 }
开发者ID:VrKomarov,项目名称:OpenRA,代码行数:4,代码来源:MissionUtils.cs


示例20: AreaSecuredWithUnits

 public static bool AreaSecuredWithUnits(World world, Player player, PPos location, int range)
 {
     var units = world.FindAliveCombatantActorsInCircle(location, range).Where(a => a.HasTrait<IMove>());
     return units.Any() && units.All(a => a.Owner == player);
 }
开发者ID:VrKomarov,项目名称:OpenRA,代码行数:5,代码来源:MissionUtils.cs



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


鲜花

握手

雷人

路过

鸡蛋
该文章已有0人参与评论

请发表评论

全部评论

专题导读
上一篇:
C# PROCESS_INFORMATION类代码示例发布时间:2022-05-24
下一篇:
C# POINTER_INFO类代码示例发布时间:2022-05-24
热门推荐
阅读排行榜

扫描微信二维码

查看手机版网站

随时了解更新最新资讯

139-2527-9053

在线客服(服务时间 9:00~18:00)

在线QQ客服
地址:深圳市南山区西丽大学城创智工业园
电邮:jeky_zhao#qq.com
移动电话:139-2527-9053

Powered by 互联科技 X3.4© 2001-2213 极客世界.|Sitemap