public WSStart(RectangleZone start) { left = start.Left; right = start.Right; up = start.Up; down = start.Down; }
public override bool RunQuest(Host host) { if (!base.RunQuest(host)) { return(false); } if (getQuest() == null) { if (!host.movementModule.GpsMove("Headlands_Shatam")) { return(false); } Thread.Sleep(1000); host.StartQuest(id); Thread.Sleep(1000); } ArcheBuddy.Bot.Classes.Quest quest = getQuest(); if (!checkQuestCompletedOrAccepted(3661)) { return(false); } if (quest != null && quest.status == QuestStatus.Accepted) { Zone zone = new RectangleZone(16751.24, 8470.07, 16608.87, 8527.43); if (!host.movementModule.GpsMove("Quest_3663_1")) { return(false); } host.farmModule.SetFarmMobs(zone, new uint[] { 2916 }); while (host.farmModule.farmState == Modules.FarmState.Enabled && quest.status == QuestStatus.Accepted) { Thread.Sleep(100); } host.farmModule.StopFarm(); Thread.Sleep(1000); } if (!checkQuestCompletedOrPerfomed(3661)) { return(false); } if (quest != null && quest.status == QuestStatus.Performed) { if (!host.movementModule.GpsMove("Headlands_Shatam")) { return(false); } Thread.Sleep(1000); host.CompleteQuest(id); Thread.Sleep(1000); } return(true); }
public void RectangleZoneSizeTest() { RectangleZone zone = new RectangleZone(4, 2, 1, 4); Assert.AreEqual(zone.AreaSize(), 12); zone = new RectangleZone(3, 5, 6, 1); Assert.AreEqual(zone.AreaSize(), 18); }
public void ZoneTest() { DiscreteCoordinates coords = new DiscreteCoordinates(1, 2); Zone z1 = new RectangleZone(4, 5, 5, 6); Zone z2 = new RectangleZone(-1, 7, -3, 8); Assert.IsFalse(z1.IsInZone(coords)); Assert.IsTrue(z2.IsInZone(coords)); }
/// <summary> /// 在物理世界创建一个矩形区域作用力 /// </summary> /// <param name="world">物理世界</param> /// <param name="particleForceGenerator">作用力发生器</param> /// <param name="x1"></param> /// <param name="y1"></param> /// <param name="x2"></param> /// <param name="y2"></param> /// <returns></returns> public static RectangleZone CreateRectangleZone( this World world, ParticleForceGenerator particleForceGenerator, double x1, double y1, double x2, double y2) { var zone = new RectangleZone(x1, y1, x2, y2); return(world.CreateZone(zone, particleForceGenerator)); }
public override bool RunQuest(Host host) { if (!base.RunQuest(host)) return false; if (getQuest() == null) { if (!host.movementModule.GpsMove("Headlands_Shatam")) return false; Thread.Sleep(1000); host.StartQuest(id); Thread.Sleep(1000); } ArcheBuddy.Bot.Classes.Quest quest = getQuest(); if (!checkQuestCompletedOrAccepted(3661)) return false; if (quest != null && quest.status == QuestStatus.Accepted) { Zone zone = new RectangleZone(16751.24, 8470.07, 16608.87, 8527.43); if (!host.movementModule.GpsMove("Quest_3663_1")) return false; host.farmModule.SetFarmMobs(zone, new uint[] { 2916 }); while (host.farmModule.farmState == Modules.FarmState.Enabled && quest.status == QuestStatus.Accepted) Thread.Sleep(100); host.farmModule.StopFarm(); Thread.Sleep(1000); } if (!checkQuestCompletedOrPerfomed(3661)) return false; if (quest != null && quest.status == QuestStatus.Performed) { if (!host.movementModule.GpsMove("Headlands_Shatam")) return false; Thread.Sleep(1000); host.CompleteQuest(id); Thread.Sleep(1000); } return true; }
public WSStartGame(Field f) { characters = new List <WSCharacter>(); traps = new List <WSTrap>(); field = new WSField(f); List <Character> chars = f.CharacterList; Dictionary <Modificator, int> trapList = f.TrapList; RectangleZone start = (RectangleZone)f.StartZone; RectangleZone finish = (RectangleZone)f.FinishZone; for (int i = 0; i < chars.Count; i++) { characters.Add(new WSCharacter(chars[i])); } foreach (var trap in trapList) { traps.Add(new WSTrap(trap.Key, trap.Value)); } this.start = new WSStart(start); this.finish = new WSFinish(finish); }
public static Field GenerateSimpleField(INotifier notifier) { Field field = new Field(notifier); //field.CreateEmptyField(10, 10); field.CreateTestField(); Zone start = new RectangleZone(3, 1, 1, 6); Zone finish = new RectangleZone(7, 7, 4, 4); field.SetStartFinish(start, finish); Random r = new Random(); int bombCount = r.Next(1, 3); int pitfallCount = r.Next(2, 3); field.InitializeNewTrap(Modificator.Ice, bombCount); field.InitializeNewTrap(Modificator.Pitfall, pitfallCount); return(field); }
public void TestTryApplyTo() { var pIn = new Particle { Position = new Vector2D(2, 3), Mass = 1 }; var pOut = new Particle { Position = new Vector2D(6, 6), Mass = 1 }; var zone = new RectangleZone(0, 0, 5, 5); zone.Add(new ParticleConstantForce(new Vector2D(5, 0))); zone.TryApplyTo(pIn, 1 / 60.0); zone.TryApplyTo(pOut, 1 / 60.0); pIn.Update(1 / 60.0); pOut.Update(1 / 60.0); Assert.AreEqual(new Vector2D(5, 0), pIn.Acceleration); Assert.AreEqual(new Vector2D(0, 0), pOut.Acceleration); }
public void IsNotInZoneTest() { RectangleZone zone = new RectangleZone(1, 4, 1, 4); Assert.IsFalse(zone.IsInZone(10, 12)); }
public void IsInZoneTest() { RectangleZone zone = new RectangleZone(1, 4, 1, 4); Assert.IsTrue(zone.IsInZone(3, 2)); }
public ViewportControl( ) : base() { Camera = new CameraEd( this ); _selectionBox = new RectangleZone( Color.White, 0, 0, 1, 1 ); _selectionBox.BorderColor = Consts.Viewport.ACTOR_SELECTION_BORDER_COLOR; _selectionBox.FillColor = Consts.Viewport.ACTOR_SELECTION_COLOR; _selectionBlueprint = new RectangleZone( Color.White, 0, 0, 1, 1 ); _selectionBlueprint.BorderColor = Consts.Viewport.ACTOR_SELECTION_BLUEPRINT_BORDER_COLOR; _selectionBlueprint.FillColor = Consts.Viewport.ACTOR_SELECTION_BLUEPRINT_COLOR; MouseDown += new MouseEventHandler( ViewportMouseDown ); MouseMove += new MouseEventHandler( ViewportMouseMove ); MouseUp += new MouseEventHandler( ViewportMouseUp ); //KeyPress += new KeyPressEventHandler( ViewportKeyPress ); }
public WSFinish(RectangleZone finish) { xpos = finish.Left; ypos = finish.Up; }