protected override void Execute() { var unit = (UnitEntity)this.Source; TilePosition p = (TilePosition)this.World.GetEntityPosition(this.Source); Point currentPos = p.Point; if (usePoint) { v = new Vector(currentPos, toward); } Point newPos = currentPos + v; var preMove = new PreMoveEvent(unit, currentPos, newPos); this.Source.Raise(preMove); if (preMove.MoveStopped) { this.moveStopped = true; return; } this.Source.Raise(new BeginMoveEvent(unit, currentPos, newPos, this.duration)); if (duration != 0) { TimedAction t = this.Factory.CreateTimer(delegate { MoveUnit(currentPos, newPos); }); t.SetSingle(duration); this.RunAction(t); } else { MoveUnit(currentPos, newPos); } }