本文整理汇总了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;未经允许,请勿转载。 |
请发表评论