示例#1
0
        public static MapAttributesResult FromModel(IMapModel map)
        {
            var attrs = map.Attributes;

            return(new MapAttributesResult
            {
                AiProfile = attrs.AiProfile,
                Description = attrs.Description,
                Gravity = attrs.Gravity,
                ImpassibleWater = attrs.LavaWorld,
                MaxWindSpeed = attrs.MaxWindSpeed,
                Memory = attrs.Memory,
                MeteorDensity = attrs.MeteorDensity,
                MeteorDuration = attrs.MeteorDuration,
                MeteorInterval = attrs.MeteorInterval,
                MeteorRadius = attrs.MeteorRadius,
                MeteorWeapon = attrs.MeteorWeapon,
                MinWindSpeed = attrs.MinWindSpeed,
                MohoMetal = attrs.MohoMetal,
                Name = attrs.Name,
                Planet = attrs.Planet,
                Players = attrs.NumPlayers,
                SeaLevel = map.SeaLevel,
                SolarStrength = attrs.SolarStrength,
                SurfaceMetal = attrs.SurfaceMetal,
                TidalStrength = attrs.TidalStrength,
                WaterDamage = attrs.WaterDamage,
                WaterDoesDamage = attrs.WaterDoesDamage,
            });
        }
示例#2
0
 private bool IsItem(IMapModel item, Marker marker)
 {
     return(item.Name == marker.Title &&
            item.Details == marker.Snippet &&
            item.Location.Latitude == marker.Position.Latitude &&
            item.Location.Longitude == marker.Position.Longitude);
 }
示例#3
0
        public void MergeInto(IMapModel map)
        {
            var attrs = map.Attributes;

            attrs.AiProfile       = this.AiProfile;
            attrs.Description     = this.Description;
            attrs.Gravity         = this.Gravity;
            attrs.LavaWorld       = this.ImpassibleWater;
            attrs.MaxWindSpeed    = this.MaxWindSpeed;
            attrs.Memory          = this.Memory;
            attrs.MeteorDensity   = this.MeteorDensity;
            attrs.MeteorDuration  = this.MeteorDuration;
            attrs.MeteorInterval  = this.MeteorInterval;
            attrs.MeteorRadius    = this.MeteorRadius;
            attrs.MeteorWeapon    = this.MeteorWeapon;
            attrs.MinWindSpeed    = this.MinWindSpeed;
            attrs.MohoMetal       = this.MohoMetal;
            attrs.Name            = this.Name;
            attrs.Planet          = this.Planet;
            attrs.NumPlayers      = this.Players;
            map.SeaLevel          = this.SeaLevel;
            attrs.SolarStrength   = this.SolarStrength;
            attrs.SurfaceMetal    = this.SurfaceMetal;
            attrs.TidalStrength   = this.TidalStrength;
            attrs.WaterDamage     = this.WaterDamage;
            attrs.WaterDoesDamage = this.WaterDoesDamage;
        }
示例#4
0
            public MapViewTreeNode(string text = null, IMapModel mapModel = null, IEnumerable <IMapModel> childItems = null)
            {
                StaticText = text;
                MapModel   = mapModel;
                childItems?.ForEach(item => Nodes.Add(new MapViewTreeNode(mapModel: item)));

                Update();
            }
示例#5
0
            public RenderTarget(DesignerView parent, IMapModel mapModel = null, IEnumerable <IMapModel> childItems = null)
            {
                Debug.Assert(parent != null);

                _parent  = parent;
                MapModel = mapModel;
                childItems?.ForEach(item => Targets.Add(new RenderTarget(parent, item)));
            }
        private async Task <UIImageView> GetImage(IMapModel pet)
        {
            var imageView = new UIImageView(new CGRect(5f, 5f, 75f, 75f));

            imageView.Image = await LoadImage(pet.ImageUrl);

            return(imageView);
        }
示例#7
0
 public MapViewModel(IMapModel model)
 {
     this.model             = model;
     model.PropertyChanged += delegate(object sender, PropertyChangedEventArgs e)
     {
         NotifyPropertyChanged("Vm" + e.PropertyName);
     };
     planePath = new LocationCollection();
 }
示例#8
0
        private void HandleJourneyStart(object sender, BackOneEventArgs e)
        {
            IMapModel iMapModel = transform.GetComponent <MapController>().GETMapModel();
            IMapView  iMapView  = transform.GetComponent <MapController>().GETMapView();

            iMapView.setGameObjectVisibility(false);
            iMapModel.GETPoiCoordinatesObjectsList();
            view.SpatialExploration();
        }
示例#9
0
        public static Pin AsPin(this IMapModel item)
        {
            var location = item.Location;
            var position = location != null ? new Position(location.Latitude, location.Longitude) : Location.DefaultPosition;

            return(new Pin {
                Label = item.Name, Address = item.Details, Position = position
            });
        }
示例#10
0
        public static IReplayableOperation CreateMergeSectionOperation(IMapModel map, int index)
        {
            var tile = map.FloatingTiles[index];

            var mergeOp = CreateClipMergeTileOperation(tile.Item, map.Tile, tile.Location.X, tile.Location.Y);

            var removeOp = new RemoveTileOperation(map.FloatingTiles, index);

            return(new CompositeOperation(mergeOp, removeOp));
        }
		private UIButton GetDetailButton(IMapModel pet)
		{
			var detailButton = UIButton.FromType(UIButtonType.DetailDisclosure);
			detailButton.TouchUpInside += (s,e) => {
				if (_petDetailCommand != null)
					_petDetailCommand.Execute(pet);
			};

			return detailButton;
		}
示例#12
0
        public IProjectModelsContainer CreateProjectModelContainer(IMapModel mapModel,
                                                                   ICoordinatesConverter coordinatesConverter)
        {
            var projectsJson = _assetProvider.GetProjectsData();
            IProjectsModelGenerator modelGenerator = new ProjectsModelGenerator(coordinatesConverter);

            var projectsModelContainer = modelGenerator.ParseProjectsData(projectsJson.Projects, mapModel.MapInfo);

            return(projectsModelContainer);
        }
 public BatchMoveFeatureOperation(
     IMapModel map,
     IEnumerable <Guid> ids,
     int x,
     int y)
 {
     this.map = map;
     this.ids = new HashSet <Guid>(ids);
     this.x   = x;
     this.y   = y;
 }
示例#14
0
        /// <summary>
        /// Gets or sets the public Place ViewModel.
        /// </summary>
        /// <summary>
        /// Handles navigation inwards and sets up the place model parameter.
        /// </summary>
        public override void HandleViewDataLoadEvent()
        {
            HLinkPlaceModel HLinkObject = CommonRoutines.GetHLinkParameter <HLinkPlaceModel>(BaseParamsHLink);

            PlaceObject = HLinkObject.DeRef;

            if (PlaceObject != null)
            {
                BaseModelBase = PlaceObject;
                BaseTitleIcon = Constants.IconPlace;

                // TODO Display all details

                BaseDetail.Add(new CardListLineCollection("Place Detail")
                {
                    new CardListLine("Title:", PlaceObject.GPTitle),
                    new CardListLine("Type:", PlaceObject.GType),
                    new CardListLine("Code:", PlaceObject.GCode),
                });

                foreach (HLinkPlaceLocationModel thePlaceLocation in PlaceObject.GLocation)
                {
                    BaseDetail.Add(new CardListLineCollection("Location")
                    {
                        new CardListLine("Street:", thePlaceLocation.DeRef.GStreet),
                        new CardListLine("City:", thePlaceLocation.DeRef.GCity),
                        new CardListLine("County:", thePlaceLocation.DeRef.GCounty),
                        new CardListLine("Locality:", thePlaceLocation.DeRef.GLocality),
                        new CardListLine("Parish:", thePlaceLocation.DeRef.GParish),
                        new CardListLine("State:", thePlaceLocation.DeRef.GState),
                        new CardListLine("Country:", thePlaceLocation.DeRef.GCountry),
                        new CardListLine("Phone:", thePlaceLocation.DeRef.GPhone),
                        new CardListLine("City:", thePlaceLocation.DeRef.GPostal),
                    });
                }

                BaseDetail.Add(new CardListLineCollection("Coordinates")
                {
                    new CardListLine("Lat:", PlaceObject.GCoordLat),
                    new CardListLine("Long:", PlaceObject.GCoordLong),
                });

                BaseDetail.Add(new CardListLineCollection("Place Date Ref")
                {
                    new CardListLine("Date:", HLinkObject.Date.ShortDate),
                });

                // Add Map card
                IMapModel t = PlaceObject.ToMapModel();
                BaseDetail.Add(t.HLink);

                BaseDetail.Add(DV.PlaceDV.GetModelInfoFormatted(PlaceObject));
            }
        }
示例#15
0
        public IMapView CreateMapView(IMapModel mapModel, IMeshGenerator meshGenerator, IOutlineDrawer outlineDrawer)
        {
            var outlineMaterial = _assetProvider.GetOutlineMaterial();
            var mapZonePrefab   = _assetProvider.GetMapZonePrefab();

            outlineDrawer.OutlineMaterial = outlineMaterial;

            IMapViewGenerator mapViewGenerator = new MapViewGenerator(meshGenerator, outlineDrawer, _monoProvider);
            var mapView = mapViewGenerator.CreateMapView(mapZonePrefab, mapModel);

            return(mapView);
        }
示例#16
0
        public static IReplayableOperation CreateClippedLiftAreaOperation(
            IMapModel map,
            int x,
            int y,
            int width,
            int height)
        {
            var rect = new Rectangle(x, y, width, height);

            rect.Intersect(new Rectangle(0, 0, map.Tile.TileGrid.Width, map.Tile.TileGrid.Height));

            return(CreateLiftAreaOperation(map, rect.X, rect.Y, rect.Width, rect.Height));
        }
        private UIButton GetDetailButton(IMapModel pet)
        {
            var detailButton = UIButton.FromType(UIButtonType.DetailDisclosure);

            detailButton.TouchUpInside += (s, e) => {
                if (_petDetailCommand != null)
                {
                    _petDetailCommand.Execute(pet);
                }
            };

            return(detailButton);
        }
示例#18
0
 private ModelFactory()
 {
     _tcApi               = new TCApi();
     _logInModel          = new LogInModel(_tcApi);
     _homeModel           = new HomeModel(_tcApi);
     _userPreference      = new UserPreference(_tcApi);
     _settingsModel       = new SettingsModel();
     _createUserModel     = new CreateUserModel(_tcApi);
     _createCaseModel     = new CreateCaseModel(_tcApi);
     _caseModel           = new CaseModel(_tcApi);
     _changePasswordModel = new ChangePasswordModel(_tcApi);
     _mapModel            = new MapModel(_tcApi);
     _trafficLightModel   = new TrafficLightOverviewModel(_tcApi);
 }
		private string GetPetAnnotationType (IMapModel pet) 
		{
			return PetAnnotationIdDog;
//			switch (pet.MissingType) 
//			{
//				case MissingType.Dog:
//					return PetAnnotationIdDog;
//				case MissingType.Cat:
//					return PetAnnotationIdCat;
//				case MissingType.Family:
//					return PetAnnotationIdFamily;
//				default:
//					return PetAnnotationIdDog;
//			}
		}
示例#20
0
        public void Spawn(Transform parent, IMapModel mapModel)
        {
            var cell = mapModel.GetRandomBombSpawnPont();

            var bomb = Components.Bomb.Instantiate(bombPrefab);

            bomb.transform.SetParent(parent);
            bomb.transform.localPosition = cell;

            GameObject.Instantiate(parameterFactory.View, bomb.transform);

            bomb.Initialize(parameterFactory.Explosion);

            Logger.Debug($"Spawned bomb at cell {cell}");
        }
        private string GetPetAnnotationType(IMapModel pet)
        {
            return(PetAnnotationIdDog);
//			switch (pet.MissingType)
//			{
//				case MissingType.Dog:
//					return PetAnnotationIdDog;
//				case MissingType.Cat:
//					return PetAnnotationIdCat;
//				case MissingType.Family:
//					return PetAnnotationIdFamily;
//				default:
//					return PetAnnotationIdDog;
//			}
        }
示例#22
0
        public static IReplayableOperation CreateFlattenOperation(IMapModel model)
        {
            var arr = new IReplayableOperation[model.FloatingTiles.Count + 1];

            var i = 0;

            foreach (var t in model.FloatingTiles)
            {
                arr[i++] = CreateClipMergeTileOperation(t.Item, model.Tile, t.Location.X, t.Location.Y);
            }

            arr[i] = new ClearTilesOperation(model);

            return(new CompositeOperation(arr));
        }
示例#23
0
        private void HandleBack(object sender, BackOneEventArgs e)
        {
            IMainMenuModel mainMenuModel = transform.GetComponent <MainMenuController>().GETMainMenuModel();

            model.ChangeVisibility(false);
            mainMenuModel.ChangeVisibility(true);
            IMapModel mapModel = transform.GetComponent <MapController>().GETMapModel();

            mapModel.ChangeVisibility(false);

            IQueryMenuController IqueryMenuController = transform.GetComponent <QueryMenuController>();
            Vector3 pos = IqueryMenuController.getview().getInitQueryMenuPosition();

            IqueryMenuController.getview().setQueryMenuRadialPosition(pos, true);
        }
示例#24
0
        public static IReplayableOperation CreateLiftAreaOperation(IMapModel map, int x, int y, int width, int height)
        {
            // copy the target area to a new tile
            var tile = new MapTile(width, height);

            GridMethods.Copy(map.Tile.TileGrid, tile.TileGrid, x, y, 0, 0, width, height);
            GridMethods.Copy(map.Tile.HeightGrid, tile.HeightGrid, x * 2, y * 2, 0, 0, width * 2, height * 2);

            var positionedTile = new Positioned <IMapTile>(tile, new Point(x, y));

            var addOp         = new AddFloatingTileOperation(map, positionedTile);
            var clearBitmapOp = new FillAreaOperation <Bitmap>(map.Tile.TileGrid, x, y, width, height, Globals.DefaultTile);
            var clearHeightOp = new FillAreaOperation <int>(map.Tile.HeightGrid, x * 2, y * 2, width * 2, height * 2, 0);

            return(new CompositeOperation(addOp, clearBitmapOp, clearHeightOp));
        }
        public void Initialize(IMapModel mapModel)
        {
            StartCoroutine(RepeativeSpawn());

            IEnumerator RepeativeSpawn()
            {
                var charactersParent = new GameObject($"{_core.GetType()}.Spawned");
                var cachedDelay      = new WaitForSeconds(spawnDelay);

                while (true)
                {
                    yield return(cachedDelay);

                    _core.Spawn(charactersParent.transform, mapModel);
                }
            }
        }
示例#26
0
        //Initialize Model, view and Listeners
        private void Start()
        {
            model = new MapModel();
            view  = transform.GetChild(5).GetComponent <MapView>();



            // Listen to input from the view
            ZoomToMapPin.OnMapObject += HandlePOIInput;
            view.OnPOI += POItoQuery;


            // Listen to changes in the model
            model.GeneratePinMap += GeneratePinMaps;
            model.MapVisibility  += MainMenuStatusVisibility;
            model.OnPOIGetter    += SendPOIListToMapMenu;
        }
示例#27
0
    protected GameControllerBase(IMapView mapView, IUiView uiView, IMapModel mapModel, IMapSaver mapSaver)
    {
        this.mapView  = mapView;
        this.uiView   = uiView;
        this.mapModel = mapModel;
        this.mapSaver = mapSaver;

        mapModel.OnPathChanged += OnPathChanged;

        uiView.OnFindPathPressed        += OnFindPathPressed;
        uiView.OnAddObstaclesPressed    += OnAddObstaclesPressed;
        uiView.OnRemoveObstaclesPressed += OnRemoveObstaclesPressed;
        uiView.OnEditStartPointPressed  += OnEditStartPointPressed;
        uiView.OnEditGoalPointPressed   += OnEditGoalPointPressed;
        uiView.OnClearPathPressed       += OnClearPathPressed;
        uiView.OnClearMapPressed        += OnClearMapPressed;
        uiView.OnSaveMapPressed         += OnSaveMapPressed;

        mapView.onStart += LoadMap;
    }
示例#28
0
        public void Spawn(Transform parent, IMapModel mapModel)
        {
            var freeCell = mapModel.GetRandomCharacterSpawnPoint();

            if (!freeCell.HasValue)
            {
                return;
            }

            var character = Character.Instantiate(characterPrefab);

            character.transform.SetParent(parent);
            character.transform.localPosition = freeCell.Value;

            GameObject.Instantiate(_parameterFactory.View, character.transform);

            character.Initialize(_parameterFactory.CharacterHealth);

            Logger.Debug($"Spawned character at cell {freeCell}");
        }
示例#29
0
    // Called when GPSdata is received
    public void HandleGPSReceived(object sender, GPSDataReceivedEventArgs e)
    {
        // Updating the model
        model.SetGPSCoordinates(e.latitude, e.longitude, e.heading);

        IMapModel mapModel = transform.GetComponent <MapController>().GETMapModel();

        mapModel.setCurrentLocation(e.latitude, e.longitude, e.heading);

        IMapView mapView = transform.GetComponent <MapController>().GETMapView();

        mapView.setCurrentPositionPin(e.latitude, e.longitude, e.heading);

        IMapMenuView mapMenuView = transform.GetComponent <MapMenuController>().GETMapMenuView();

        mapMenuView.setCurrentPositionPin(e.latitude, e.longitude, e.heading);
        mapMenuView.MiniMapRender();

        IResultPanelModel resultPanelModel = transform.GetComponent <ResultPanelController>().GETResultPanelModel();

        resultPanelModel.setLatLon(e.latitude, e.longitude);
    }
示例#30
0
        private void HandleSpatialSelect(object sender, SpatialEventArgs e)
        {
            IMapMenuModel mapMenuModel = transform.GetComponent <MapMenuController>().GETMapMenuModel();

            model.ChangeVisibility(false);
            mapMenuModel.ChangeVisibility(true);

            IMapView mapView = transform.GetComponent <MapController>().GETMapView();
            Vector3  newpos  = new Vector3(Camera.main.transform.position.x, Camera.main.transform.position.y - 0.6f, Camera.main.transform.position.z);

            mapView.setMapPosition(newpos);

            IMapModel mapModel = transform.GetComponent <MapController>().GETMapModel();

            model.ChangeVisibility(false);
            mapModel.ChangeVisibility(true);

            IQueryMenuController IqueryMenuController = transform.GetComponent <QueryMenuController>();

            IqueryMenuController.getview().setQueryMenuRadialPosition(new Vector3(0.1f, 0, 0), false);
            IqueryMenuController.getview().setQueryMenuPosition(new Vector3(0, 0, 1f));
        }
        public IMapView CreateMapView(GameObject mapZonePrefab, IMapModel mapModel)
        {
            var holeGameObject = new GameObject();
            var zoneViews      = new List <IMapZoneView>();
            var mapRoot        = CreateAndRotateMapRoot(mapModel.MapInfo);

            foreach (var zoneModel in mapModel.MapZones)
            {
                var zoneRepresentation = _monoBehaviourProvider.CreateInstance(mapZonePrefab, mapRoot);
                zoneRepresentation.name = zoneModel.Name;

                DrawZoneOutlines(zoneRepresentation, zoneModel, holeGameObject);

                var mesh       = _meshGenerator.CreateZoneMesh(zoneModel);
                var meshFilter = zoneRepresentation.GetComponent <MeshFilter>();
                meshFilter.mesh = mesh;
                var meshCollider = zoneRepresentation.GetComponent <MeshCollider>();
                meshCollider.sharedMesh = mesh;
                zoneViews.Add(new MapZoneView(zoneModel.Id, zoneRepresentation));
            }

            return(new MapView(zoneViews, mapRoot));
        }
示例#32
0
 public object Convert(object value, Type targetType, object parameter, CultureInfo culture)
 {
     if (value == null)
     {
         return(null);
     }
     else if (value.GetType() == typeof(DisplayTuple <int, IMapModel>))
     {
         IMapModel model = ((DisplayTuple <int, IMapModel>)value).Value;
         if (model.EntryMode == MapEntryType.Map)
         {
             return((MapHeaderModel)model);
         }
         else
         {
             return(null);
         }
     }
     else
     {
         return(null);
     }
 }
 private bool IsItem(IMapModel item, Marker marker)
 {
     return item.Name == marker.Title &&
     item.Details == marker.Snippet &&
     item.Location.Latitude == marker.Position.Latitude &&
     item.Location.Longitude == marker.Position.Longitude;
 }
示例#34
0
		private void ShowDetail(IMapModel selectedItem)
		{

		}
		private async Task<UIImageView> GetImage (IMapModel pet)
		{
			var imageView = new UIImageView(new RectangleF(5f,5f,75f,75f));
			imageView.Image = await LoadImage(pet.ImageUrl);
			return imageView;
		}
示例#36
0
		private async Task ShowDetail (IMapModel selectedItem)
		{
			POIs p = Global.K_POIs.First (x => x.NameOfThePOI == selectedItem.Name);
			List<Categories_POIs> cp = Global.K_Categories_POIs.Where (x => x.IDPOI == p.IDPOI).ToList ();
			Categories c = Global.K_Categories.First (x => x.IDCategory == cp [0].IDCategory); //take the first category
			Int32 kkkk;
			if (Int32.TryParse (c.NameOfTheCategory.Substring (0, 2), out kkkk))
				c.NameOfTheCategory = c.NameOfTheCategory.Substring (3).ToUpper ();
			else
				c.NameOfTheCategory = c.NameOfTheCategory.ToUpper ();
			
			PosDetail d = new PosDetail (p, c.NameOfTheCategory, c.IDCategory);
			await Navigation.PushAsync (d, true);


			Debug.WriteLine ("...");
		}