Ejemplo n.º 1
0
 public static LandRole GetLandOwnershipType(LandWithAccess land)
 {
     if (land != null)
     {
         return(land.role);
     }
     return(LandRole.OWNER);
 }
    private static LandWithAccess[] GetLands(List <Land> lands, DeployedScene[] scenes)
    {
        LandWithAccess[] result = new LandWithAccess[lands.Count];

        for (int i = 0; i < lands.Count; i++)
        {
            result[i] = ProcessLand(lands[i], scenes);
        }

        return(result);
    }
Ejemplo n.º 3
0
    private string GetLandThumbnailUrl(LandWithAccess land, bool isEstate)
    {
        if (land == null)
        {
            return(null);
        }

        const int width            = 100;
        const int height           = 100;
        const int sizeFactorParcel = 15;
        const int sizeFactorEstate = 35;

        if (!isEstate)
        {
            return(MapUtils.GetMarketPlaceThumbnailUrl(new[] { land.baseCoords }, width, height, sizeFactorParcel));
        }

        return(MapUtils.GetMarketPlaceThumbnailUrl(land.parcels, width, height, sizeFactorEstate));
    }
    private static LandWithAccess ProcessLand(Land land, DeployedScene[] scenes)
    {
        List <DeployedScene> scenesInLand = new List <DeployedScene>();

        LandWithAccess result = new LandWithAccess(land);

        for (int i = 0; i < result.parcels.Length; i++)
        {
            DeployedScene sceneInParcel = scenes.FirstOrDefault(scene => scene.parcels.Contains(result.parcels[i]) && !scenesInLand.Contains(scene));
            if (sceneInParcel != null)
            {
                sceneInParcel.sceneLand = result;
                scenesInLand.Add(sceneInParcel);
            }
        }

        result.scenes = scenesInLand;

        return(result);
    }
Ejemplo n.º 5
0
    public void Setup(LandWithAccess land)
    {
        currentLand = land;
        bool estate = land.type == LandType.ESTATE;

        SetId(land.id);
        SetName(land.name);
        SetCoords(land.baseCoords.x, land.baseCoords.y);
        SetSize(land.size);
        SetRole(land.role == LandRole.OWNER);
        SetEditable(!estate);

        if (estate)
        {
            editorLocked.SetShowHideAnimator(editorLockedTooltipEstate);
        }
        else if (land.scenes != null && land.scenes.Count > 0 && land.scenes[0].source == DeployedScene.Source.SDK)
        {
            editorLocked.SetShowHideAnimator(editorLockedTooltipSdkScene);
            SetEditable(false);
        }
    }
Ejemplo n.º 6
0
    public static LandRole GetLandOwnershipType(List <LandWithAccess> lands, ParcelScene scene)
    {
        LandWithAccess filteredLand = lands.FirstOrDefault(land => scene.sceneData.basePosition == land.baseCoords);

        return(GetLandOwnershipType(filteredLand));
    }