本文整理汇总了C#中World.FindTilesInCircle方法的典型用法代码示例。如果您正苦于以下问题:C# World.FindTilesInCircle方法的具体用法?C# World.FindTilesInCircle怎么用?C# World.FindTilesInCircle使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类World
的用法示例。
在下文中一共展示了World.FindTilesInCircle方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Render
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)
{
var xy = wr.Position(wr.Viewport.ViewToWorldPx(Viewport.LastMousePos)).ToCPos();
var pal = wr.Palette("terrain");
foreach (var t in world.FindTilesInCircle(xy, range))
yield return new SpriteRenderable(tile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true);
}
示例2: Render
public IEnumerable<IRenderable> Render(WorldRenderer wr, World world)
{
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos);
var pal = wr.Palette("terrain");
// Source tiles
foreach (var t in world.FindTilesInCircle(sourceLocation, range))
yield return new SpriteRenderable(sourceTile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true);
// Destination tiles
foreach (var t in world.FindTilesInCircle(xy, range))
yield return new SpriteRenderable(sourceTile, t.CenterPosition, WVec.Zero, -511, pal, 1f, true);
// Unit previews
foreach (var unit in power.UnitsInRange(sourceLocation))
{
var offset = (xy - sourceLocation).ToWVec();
if (manager.self.Owner.Shroud.IsTargetable(unit))
foreach (var r in unit.Render(wr))
yield return r.OffsetBy(offset);
}
// Unit tiles
foreach (var unit in power.UnitsInRange(sourceLocation))
{
if (manager.self.Owner.Shroud.IsTargetable(unit))
{
var targetCell = unit.Location + (xy - sourceLocation);
var canEnter = ((manager.self.Owner.Shroud.IsExplored(targetCell) || manager.self.Owner.HasFogVisibility()) &&
unit.Trait<Chronoshiftable>().CanChronoshiftTo(unit,targetCell));
var tile = canEnter ? validTile : invalidTile;
yield return new SpriteRenderable(tile, targetCell.CenterPosition, WVec.Zero, -511, pal, 1f, true);
}
}
}
示例3: RenderBeforeWorld
public void RenderBeforeWorld(WorldRenderer wr, World world)
{
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos);
foreach (var t in world.FindTilesInCircle(xy, range))
tile.DrawAt( wr, t.ToPPos().ToFloat2(), "terrain" );
}
示例4: RenderBeforeWorld
public void RenderBeforeWorld(WorldRenderer wr, World world)
{
var xy = Game.viewport.ViewToWorld(Viewport.LastMousePos);
// Source tiles
foreach (var t in world.FindTilesInCircle(sourceLocation, range))
sourceTile.DrawAt( wr, t.ToPPos().ToFloat2(), "terrain" );
// Destination tiles
foreach (var t in world.FindTilesInCircle(xy, range))
sourceTile.DrawAt( wr, t.ToPPos().ToFloat2(), "terrain" );
// Unit previews
foreach (var unit in power.UnitsInRange(sourceLocation))
{
if (manager.self.Owner.Shroud.IsTargetable(unit)) {
var targetCell = unit.Location + (xy - sourceLocation);
foreach (var r in unit.Render(wr))
r.Sprite.DrawAt(r.Pos - Traits.Util.CenterOfCell(unit.Location).ToFloat2() + Traits.Util.CenterOfCell(targetCell).ToFloat2(),
r.Palette.Index,
r.Scale*r.Sprite.size);
}
}
// Unit tiles
foreach (var unit in power.UnitsInRange(sourceLocation))
{
if (manager.self.Owner.Shroud.IsTargetable(unit)) {
var targetCell = unit.Location + (xy - sourceLocation);
var canEnter = ((manager.self.Owner.Shroud.IsExplored(targetCell) || manager.self.Owner.HasFogVisibility())&& unit.Trait<Chronoshiftable>().CanChronoshiftTo(unit,targetCell));
var tile = canEnter ? validTile : invalidTile;
tile.DrawAt( wr, targetCell.ToPPos().ToFloat2(), "terrain" );
}
}
}