本文整理汇总了C#中Position类的典型用法代码示例。如果您正苦于以下问题:C# Position类的具体用法?C# Position怎么用?C# Position使用的例子?那么, 这里精选的类代码示例或许可以为您提供帮助。
Position类属于命名空间,在下文中一共展示了Position类的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: Swapped
public void Swapped()
{
if (checknum != 0)
{
Position[] send = new Position[2];
send[0] = my_number;
send[1] = checkicon[0].GetComponent<CIcon>().my_number;
PM.ChangePosition(send);
Position temp = my_number;
my_number = checkicon[0].GetComponent<CIcon>().my_number;
checkicon[0].GetComponent<CIcon>().my_number = temp;
Vector3 temp_pos = saved_position;
saved_position = checkicon[0].GetComponent<CIcon>().saved_position;
checkicon[0].GetComponent<CIcon>().saved_position = temp_pos;
temp_pos = disappear_pos;
disappear_pos = checkicon[0].GetComponent<CIcon>().disappear_pos;
checkicon[0].GetComponent<CIcon>().disappear_pos = temp_pos;
SlowReturn();
checkicon[0].GetComponent<CIcon>().SlowReturn();
}
}
示例2: ClosePosition
private void ClosePosition()
{
if (_position == null)
return;
Trade.Close(_position);
_position = null;
}
示例3: TickCore
protected override void TickCore(Entity host, RealmTime time, ref object state)
{
int cool = (int) state;
if (cool <= 0)
{
if (host.HasConditionEffect(ConditionEffectIndex.Stunned)) return;
Position target = new Position
{
X = host.X + (float) (range*Math.Cos(angle.Value)),
Y = host.Y + (float) (range*Math.Sin(angle.Value)),
};
host.Owner.Timers.Add(new WorldTimer(0, (world, t) =>
{
Entity entity = Entity.Resolve(world.Manager, child);
entity.Move(target.X, target.Y);
(entity as Enemy).Terrain = (host as Enemy).Terrain;
world.EnterWorld(entity);
}));
cool = coolDown.Next(Random);
}
else
cool -= time.thisTickTimes;
state = cool;
}
示例4: SamePositionsAreEqualWithOperator
public void SamePositionsAreEqualWithOperator()
{
var sut = new Position(1, 1, 1);
var sut2 = new Position(1, 1, 1);
Assert.That(sut == sut2);
}
示例5: CreateSkillAoE
public uint CreateSkillAoE(Skills skill, Vector2 direction, Position position)
{
SkillAoE skillAoE;
Movement movement;
Sprite sprite;
Collideable collideable;
uint eid = Entity.NextEntity();
position.EntityID = eid;
position.Center += direction * 70;
switch (skill)
{
default:
throw new Exception("Not a AoE skill");
}
collideable = new Collideable()
{
EntityID = eid,
Bounds = new CircleBounds(position.Center, position.Radius),
};
game.SkillAoEComponent.Add(eid, skillAoE);
game.MovementComponent.Add(eid, movement);
game.PositionComponent.Add(eid, position);
game.SpriteComponent.Add(eid, sprite);
game.CollisionComponent.Add(eid, collideable);
return eid;
}
示例6: TickCore
protected override bool TickCore(RealmTime time)
{
var dist = range;
var player = GetNearestEntity(ref dist, null);
if (player != null)
{
var chr = Host as Character;
var target = new Position
{
X = player.X,
Y = player.Y
};
chr.Owner.BroadcastPacket(new ShowEffectPacket
{
EffectType = EffectType.Throw,
Color = new ARGB(0xffffbf00),
TargetId = Host.Self.Id,
PosA = target
}, null);
chr.Owner.Timers.Add(new WorldTimer(1500, (world, t) =>
{
var entity = Entity.Resolve(objType);
entity.Move(target.X, target.Y);
(entity as Enemy).Terrain = (chr as Enemy).Terrain;
world.EnterWorld(entity);
}));
}
return true;
}
示例7: DifferentPositionsAreNotEqualWithOperator
public void DifferentPositionsAreNotEqualWithOperator()
{
var sut = new Position(1, 1, 1);
var sut2 = new Position(1, 1, 0);
Assert.That(sut != sut2);
}
示例8: GetChunks
public override IList<Chunk> GetChunks(VisitorContext context, string path)
{
context.SyntaxProvider = this;
context.ViewPath = path;
var sourceContext = CreateSourceContext(context.ViewPath, context.ViewFolder);
var position = new Position(sourceContext);
var result = _grammar.Nodes(position);
if (result.Rest.PotentialLength() != 0)
{
ThrowParseException(context.ViewPath, position, result.Rest);
}
context.Paint = result.Rest.GetPaint();
var nodes = result.Value;
foreach (var visitor in BuildNodeVisitors(context))
{
visitor.Accept(nodes);
nodes = visitor.Nodes;
}
var chunkBuilder = new ChunkBuilderVisitor(context);
chunkBuilder.Accept(nodes);
return chunkBuilder.Chunks;
}
示例9: CheckValidBeginAndEndDrawPositions
void CheckValidBeginAndEndDrawPositions(Position beginDrawPos, Position endDrawPos)
{
// We draw from upper left to lower right
Assert.IsTrue(beginDrawPos.Row <= endDrawPos.Row);
if (beginDrawPos.Row == endDrawPos.Row)
Assert.IsTrue(beginDrawPos.Column < endDrawPos.Column);
}
开发者ID:transformersprimeabcxyz,项目名称:_TO-DO-CodeEditor-Unity-Technologies,代码行数:7,代码来源:SelectionTest.cs
示例10: TestPopup_Click_1
private void TestPopup_Click_1(object sender, EventArgs e)
{
Position arg = new Position(111,2,DateTime.Now);
ShowWindowIfNewPosition(arg,
(decision) => label1.Text = "Handling user decision fired!");
}
示例11: Interpolator2D
/// <summary>
/// Creates a new instance using the specified start and end points.
/// </summary>
/// <param name="minimum">The starting point of the interpolated series.</param>
/// <param name="maximum">The ending point of the interpolated series.</param>
/// <param name="count">The number of points to calculate between the start and end.</param>
/// <remarks>This constructor provides a way to define the bounds of the interpolator,
/// as well as its number of points. A higher level of points yield a smoother
/// result but take longer to iterate through.</remarks>
////[CLSCompliant(false)]
public Interpolator2D(Position minimum, Position maximum, int count)
{
Count = count;
_Minimum = minimum;
_Maximum = maximum;
Recalculate();
}
示例12: FunctionCall
public FunctionCall(Position position, List<ActualParam>/*!*/ parameters, List<TypeRef>/*!*/ genericParams)
: base(position)
{
Debug.Assert(parameters != null);
this.callSignature = new CallSignature(parameters, genericParams);
}
示例13: GenerateLink
private string GenerateLink(ISmartContent smartContent, IPublishingContext publishingContext, out Position position)
{
position = Position.Footer;
string culture = Thread.CurrentThread.CurrentCulture.Name;
if (culture.Contains("-"))
culture = culture.Replace("-", "_");
var stringWriter = new StringWriter();
stringWriter.WriteLine("<script type=\"text/javascript\">");
stringWriter.WriteLine("var flattr_uid = '{0}';", _settings.FlattrId);
stringWriter.WriteLine("var flattr_tle = '{0}';", publishingContext.PostInfo.Title);
stringWriter.WriteLine("var flattr_dsc = '{0}';", publishingContext.PostInfo.Contents);
stringWriter.WriteLine("var flattr_cat = 'text';");
stringWriter.WriteLine("var flattr_lng = '{0}';", culture);
stringWriter.WriteLine("var flattr_tag = '';");
stringWriter.WriteLine("var flattr_url = '{0}';", publishingContext.PostInfo.Permalink);
stringWriter.WriteLine("var flattr_hide = 'false';");
if (_settings.CompactMode)
stringWriter.WriteLine("var flattr_btn = 'compact';");
stringWriter.WriteLine("</script>");
stringWriter.WriteLine("<script type=\"text/javascript\" src=\"http://api.flattr.com/button/load.js\"></script>");
return stringWriter.ToString();
}
示例14: DeserializeTest
public void DeserializeTest()
{
Position position = new Position
{
Title = Constants.Position_Title
};
Company company = new Company
{
Name = Constants.Company_Name
};
Job expected = new Job
{
Id = Constants.Job_Id,
Position = position,
Company = company
};
Job actual = LinkedIn.Utility.Utilities.DeserializeXml<Job>(this.jobRequest);
Assert.AreEqual(expected.Id, actual.Id);
Assert.AreEqual(expected.Position.Title, actual.Position.Title);
Assert.AreEqual(expected.Company.Name, actual.Company.Name);
}
示例15: TickCore
protected override bool TickCore(RealmTime time)
{
var chr = Host as Character;
Position target = new Position()
{
X = Host.Self.X,
Y = Host.Self.Y
};
target.X += (float)Math.Cos(angle) * range;
target.Y += (float)Math.Sin(angle) * range;
chr.Owner.BroadcastPacket(new ShowEffectPacket()
{
EffectType = EffectType.Throw,
Color = new ARGB(0xffffbf00),
TargetId = Host.Self.Id,
PosA = target
}, null);
chr.Owner.Timers.Add(new WorldTimer(1500, (world, t) =>
{
Entity entity = Entity.Resolve(objType);
entity.Move(target.X, target.Y);
(entity as Enemy).Terrain = (chr as Enemy).Terrain;
world.EnterWorld(entity);
}));
return true;
}