Пример #1
0
        /// <summary>
        /// STUB 需求调研
        /// </summary>
        public void LocateByProject()
        {
            // 地图定位
            IEnvelope envelope = new EnvelopeClass();

            envelope       = MapUtils.GetActiveView().Extent.Envelope;
            envelope.XMax += 1000;
            MapUtils.GetActiveView().Extent = envelope;
        }
Пример #2
0
        /// <summary>
        /// Updates this missile if it is in Launched state.
        /// </summary>
        private bool UpdateLaunchedState()
        {
            /// Update the target entity position and height if it is still on the map.
            if (this.targetEntity.Read().HasMapObject(MapObjectLayerEnum.GroundObjects, MapObjectLayerEnum.AirObjects))
            {
                this.lastKnownTargetEntityPos.Write(this.targetEntity.Read().MotionControl.PositionVector.Read());
                this.lastKnownTargetEntityIsFlying.Write(this.targetEntity.Read().MotionControl.IsFlying ? (byte)0x01 : (byte)0x00);
            }

            /// Move immediately to the Impacted state if this is an instant missile.
            /// Note: a missile is instant if it has no speed defined.
            if (this.missileData.MissileType.Speed == null)
            {
                if (this.Impact != null)
                {
                    this.Impact(this);
                }
                this.currentStatus.Write((byte)Status.Impacted);
                if (this.missileIndicator != null && !this.missileIndicator.IsDestroyed)
                {
                    this.DestroyMapObject(this.missileIndicator);
                }
                return(true);
            }

            /// Calculate the new position and velocity of the missile.
            this.UpdateVelocity();
            this.missilePosition.Write(this.missilePosition.Read() + this.missileVelocity.Read());

            /// Check if the missile impacts.
            if (MapUtils.ComputeDistance(this.missilePosition.Read(), this.lastKnownTargetEntityPos.Read()) <= this.missileData.MissileType.Speed.Read())
            {
                if (this.Impact != null)
                {
                    this.Impact(this);
                }
                this.currentStatus.Write((byte)Status.Impacted);
                if (this.missileIndicator != null && !this.missileIndicator.IsDestroyed)
                {
                    this.DestroyMapObject(this.missileIndicator);
                }
                return(true);
            }

            /// Create a missile indicator map object if it has not yet been created and the missile type defines a flying animation...
            if (this.missileIndicator == null && this.missileData.MissileType.FlyingAnimation != null)
            {
                this.missileIndicator = this.CreateMapObject(this.CalculateArea(this.missilePosition.Read()), this.lastKnownTargetEntityIsFlying.Read() == 0x01 ? MapObjectLayerEnum.AirMissiles : MapObjectLayerEnum.GroundMissiles);
                this.missileIndicator.StartAnimation(this.missileData.MissileType.FlyingAnimation, this.missileVelocity);
            }
            else if (this.missileIndicator != null && !this.missileIndicator.IsDestroyed)
            {
                /// ... or update its position if already exists.
                this.missileIndicator.SetLocation(this.CalculateArea(this.missilePosition.Read()));
            }
            return(true);
        }
Пример #3
0
        private void RuntimeStart()
        {
            NodeNameText.text = name;

            foreach (var node in NeighbourNodes)
            {
                MapUtils.DrawLine(transform.position, node.transform.position);
            }
        }
Пример #4
0
 private void ParkedCarLocation_PropertyChanged(object sender, System.ComponentModel.PropertyChangedEventArgs e)
 {
     switch (e.PropertyName)
     {
     case "IsCompleted":
         MapUtils.MoveMapToLocation(map, viewModel.ParkedCarLocation.Result);
         break;
     }
 }
Пример #5
0
        public void GetObstacleCoordinates_ShouldReturnEmptyArray_GivenNoObstacles()
        {
            var map = CreateMap(100, 100);
            var sut = new MapUtils(map);

            var result = sut.GetObstacleCoordinates();

            Assert.Empty(result);
        }
Пример #6
0
    private static bool CheckForCollider(int x, int y, GameObject tilemap)
    {
        if (mapCollider.OverlapPoint(MapUtils.GetGridWorldPos(x, y)))
        {
            return(true);
        }

        return(false);
    }
Пример #7
0
        public void MapUtils_ContainsKey1()
        {
            Dictionary <object, object> dictionary = new Dictionary <object, object>();
            bool result = MapUtils.ContainsKey(dictionary, null);

            Assert.IsNotNull(result);
            Assert.AreEqual(false, result);
            Assert.AreEqual("False", result.ToString());
        }
Пример #8
0
        public void IsMovementPossibleToPosition_ShouldReturnFalse_GivenPositionIsOutOfBounds()
        {
            var map = CreateMap(100, 100);
            var sut = new MapUtils(map);

            var result = sut.IsMovementPossibleTo(10001);

            Assert.False(result);
        }
Пример #9
0
        public void IsMovementPossibleToCoordinate_ShouldReturnTrue_GivenTileIsFree()
        {
            var map = CreateMap(100, 100);
            var sut = new MapUtils(map);

            var result = sut.IsMovementPossibleTo(new MapCoordinate(1, 1));

            Assert.True(result);
        }
Пример #10
0
 public ArcIndex(IList <CoordPoint> points)
 {
     this.points        = points;
     this.hashTableSize = points.Count / 4 + 1;
     this.hashTable     = new int[hashTableSize];
     MapUtils.FillArraySameValue(this.hashTable, -1);
     this.chainIds = new List <int>();
     this.arcs     = new List <IList <CoordPoint> >();
 }
Пример #11
0
        public void IsMovementPossibleToCoordinate_ShouldReturnFalse_GivenCoordinateOutOfBounds()
        {
            var map = CreateMap(100, 100);
            var sut = new MapUtils(map);

            var result = sut.IsMovementPossibleTo(new MapCoordinate(100, 101));

            Assert.False(result);
        }
Пример #12
0
        protected override IWorkItemRepository CreateItemRepositoryCore(IEnumerable <BasicFeatureLayer> featureLayers, IRepository stateRepository)
        {
            List <BasicFeatureLayer> layers = featureLayers.ToList();

            Dictionary <Geodatabase, List <Table> > tables    = MapUtils.GetDistinctTables(layers);
            Dictionary <Table, List <long> >        selection = MapUtils.GetDistinctSelectionByTable(layers);

            return(new SelectionItemRepository(tables, selection, stateRepository));
        }
Пример #13
0
    private void updateFlashMap(FacilitySearchFilter filter)
    {
        // update flash map
        MapFilter mapfilter = QueryLayer.Facility.GetMapFilter(filter);
        string    header    = MapPrintDetails.Build(SheetHeaderBuilder.GetFacilitySearchHeader(filter, false));

        MapUtils.UpdateSmallMap(MasterSearchPageEPER.MAPID, Page, this.UniqueID, mapfilter, header, Request.ApplicationPath);
        ((MasterSearchPageEPER)this.Master).UpdateExpandedScript(mapfilter, header);
    }
Пример #14
0
        void GetLocationss()
        {
            WebService webService = new WebService();
            var        Donus      = webService.OkuGetir("locations");

            if (Donus != null)
            {
                var aa = Donus.ToString();
                Locationss = Newtonsoft.Json.JsonConvert.DeserializeObject <List <HaritaListeDataModel> >(Donus.ToString());
                if (Locationss.Count > 0)
                {
                    //Locationss.ForEach(item => item.coordinateX = 40.9932879);
                    //Locationss.ForEach(item => item.coordinateY = 29.1506936);
                    this.Activity.RunOnUiThread(() => {
                        for (int i = 0; i < Locationss.Count; i++)
                        {
                            MapUtils mapUtils = new MapUtils();
                            Android.Graphics.Bitmap bitmap = mapUtils.createStoreMarker(this.Activity, false);

                            BitmapDescriptor image = BitmapDescriptorFactory.FromBitmap(bitmap);

                            if (_map != null)
                            {
                                MarkerOptions markerOpt1 = new MarkerOptions();
                                markerOpt1.SetPosition(new LatLng(Locationss[i].coordinateX, Locationss[i].coordinateY));
                                markerOpt1.SetTitle(i.ToString());
                                markerOpt1.SetIcon(image);
                                //markerOpt1.Visible(MapDataModel1[i].IsShow);
                                var EklenenMarker = _map.AddMarker(markerOpt1);
                                //MapDataModel1[i].IlgiliMarker = EklenenMarker;
                            }
                        }

                        if (Locationss.Count > 0)
                        {
                            ListeyiFragmentCagir();
                            CameraUpdate cameraUpdate = CameraUpdateFactory.NewLatLngZoom(new LatLng(StartLocationCall.UserLastLocation.Latitude, StartLocationCall.UserLastLocation.Longitude), 20);
                            _map.MoveCamera(cameraUpdate);
                        }
                        ShowLoading.Hide();
                    });
                }
                else
                {
                    AlertHelper.AlertGoster("Popüler lokasyon bulunamadı...", this.Activity);
                    ShowLoading.Hide();
                }
            }
            else
            {
                ShowLoading.Hide();
            }
            this.Activity.RunOnUiThread(delegate()
            {
                GelenBase1.ButonKullanimDuzenle(true);
            });
        }
Пример #15
0
    static int HandlePriority(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 1);
        MapUtils obj = (MapUtils)LuaScriptMgr.GetUnityObjectSelf(L, 1, "MapUtils");
        int      o   = obj.HandlePriority();

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Пример #16
0
 public override bool vmethod_18(GClass892 gclass892_0)
 {
     if (!base.Context.Map.Gates.Any <KeyValuePair <int, Gate> >())
     {
         GClass900 gclass = gclass892_0 as GClass900;
         return(gclass != null && gclass.GalaxyGateType == MapUtils.smethod_10(base.C.Map.MapId));
     }
     return(true);
 }
Пример #17
0
    IEnumerator Loop()
    {
        while (true)
        {
            yield return(new WaitForSeconds(0.1f));

            MapUtils.ShuffleBoard(map, mapFloat);
        }
    }
Пример #18
0
    static int BuildMapHierachyOfMapName(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MapUtils obj  = (MapUtils)LuaScriptMgr.GetUnityObjectSelf(L, 1, "MapUtils");
        string   arg0 = LuaScriptMgr.GetLuaString(L, 2);

        obj.BuildMapHierachyOfMapName(arg0);
        return(0);
    }
Пример #19
0
 public override bool TrySwitchMap(out int int_2)
 {
     int_2 = 431;
     if (MapUtils.smethod_2(base.C.Map.MapId) == MapGroup.PayloadEscort)
     {
         int_2 = MapUtils.smethod_12(1, base.C.Hero.FactionId);
     }
     return(true);
 }
Пример #20
0
        public void GetCoordinateOf_ShouldReturnPositionOfPlayer_GivenPlayerIsInGame()
        {
            var map          = CreateMap(100, 100);
            var sut          = new MapUtils(map);
            var playerInGame = map.CharacterInfos.First();

            var result = sut.GetCoordinateOf(playerInGame.Id);

            Assert.Equal(playerInGame.Position, sut.GetPositionFrom(result));
        }
Пример #21
0
    static int NewMapElement(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 2);
        MapUtils   obj  = (MapUtils)LuaScriptMgr.GetUnityObjectSelf(L, 1, "MapUtils");
        Object     arg0 = (Object)LuaScriptMgr.GetUnityObject(L, 2, typeof(Object));
        GameObject o    = obj.NewMapElement(arg0);

        LuaScriptMgr.Push(L, o);
        return(1);
    }
Пример #22
0
    static int LoadMapElement(IntPtr L)
    {
        LuaScriptMgr.CheckArgsCount(L, 3);
        MapUtils obj  = (MapUtils)LuaScriptMgr.GetUnityObjectSelf(L, 1, "MapUtils");
        string   arg0 = LuaScriptMgr.GetLuaString(L, 2);
        string   arg1 = LuaScriptMgr.GetLuaString(L, 3);

        obj.LoadMapElement(arg0, arg1);
        return(0);
    }
Пример #23
0
 private TileTypeReference[,] TwodifyTiles(TileTypeReference[] walls)
 {
     TileTypeReference[,] twodi = new TileTypeReference[Width, Height];
     for (int i = 0; i < walls.Length; i++)
     {
         (int x, int y) = MapUtils.IndexToCoords(i, Width);
         twodi[x, y]    = walls[i];
     }
     return(twodi);
 }
Пример #24
0
        public void CanPerformPlayerAction_ShouldReturnFalse_GivenPlayerNotInGame()
        {
            var map          = CreateMap(100, 100);
            var sut          = new MapUtils(map);
            var randomAction = _fixture.Create <Action>();

            var result = sut.CanPlayerPerformAction("player-not-in-game", randomAction);

            Assert.False(result);
        }
Пример #25
0
    public override void OnEnter()
    {
        base.OnEnter();
        renderer       = Machine.Actor.GetComponent <SpriteRenderer>();
        renderer.color = Color.grey;
        GameManager.CurrentlySelectedUnit = null;

        unitDetails.CurrentGridX = MapUtils.GetGridX(unitDetails.transform.position);
        unitDetails.CurrentGridY = MapUtils.GetGridY(unitDetails.transform.position);
    }
        private RectangleShape GetRectangleShape(PointShape center, double scale)
        {
            double resolution = MapUtils.GetResolutionFromScale(scale, GisEditor.ActiveMap.MapUnit);
            double left       = center.X - resolution * GisEditor.ActiveMap.ActualWidth * .5;
            double top        = center.Y + resolution * GisEditor.ActiveMap.ActualHeight * .5;
            double right      = center.X + resolution * GisEditor.ActiveMap.ActualWidth * .5;
            double bottom     = center.Y - resolution * GisEditor.ActiveMap.ActualHeight * .5;

            return(new RectangleShape(left, top, right, bottom));
        }
Пример #27
0
        private static Geometry BufferGeometryByPixels(Geometry sketchGeometry,
                                                       int pixelBufferDistance)
        {
            double bufferDistance = MapUtils.ConvertScreenPixelToMapLength(pixelBufferDistance);

            Geometry selectionGeometry =
                GeometryEngine.Instance.Buffer(sketchGeometry, bufferDistance);

            return(selectionGeometry);
        }
    /// <summary>
    /// 範囲の描画
    /// </summary>
    /// <param name="skill"></param>
    /// <param name="monster"></param>
    private void DrawRange(MonsterSkill skill, BattleMapMonster monster)
    {
        BattleMapTile bmt = holder.BattleMap.GetByMonster(monster);

        // 範囲の取得
        List <BattleMapTile> list = MapUtils.GetRangeTileList(bmt, skill.Range);

        // 描画
        MapUtils.DrawRangeTile(new HashSet <BattleMapTile>(list), iconGenerator.InstallFrameAque);
    }
Пример #29
0
        protected SafeBlockWrapper FrontBlock()
        {
            return(SequentialSensor(() =>
            {
                var location = MapUtils.GetFrontLocation(PlayerController.getInstance().CurrentLocation, PlayerController.getInstance().CurrentDirection);
                var mapBlock = MapGenerator.getInstance().GetBlockAtLocation(location);

                return SafeBlockWrapper.GetData(mapBlock);
            }));
        }
Пример #30
0
        /// <see cref="Weapon.IsInRange"/>
        protected override bool IsInRange(RCNumber distance)
        {
            if (this.weaponData.RangeMax.Read() == 0)
            {
                return(distance <= Weapon.NEARBY_DISTANCE);
            }
            RCNumber quadDistance = MapUtils.CellToQuadDistance(distance);

            return(quadDistance >= this.weaponData.RangeMin.Read() && quadDistance <= this.weaponData.RangeMax.Read());
        }