예제 #1
0
        /// <summary>
        /// Request residential object from designation.
        /// </summary>
        /// <param name="bagObject">Entity to extend.</param>
        /// <param name="bag">BAG registrar.</param>
        /// <returns><see cref="BagObject{ResidentialObject}"/>.</returns>
        public static BagObject <ResidentialObject> ResidentialObject(this BagObject <Designation> bagObject, KadasterBag bag)
        {
            if (bagObject == null)
            {
                throw new ArgumentNullException(nameof(bagObject));
            }

            if (bag == null)
            {
                throw new ArgumentNullException(nameof(bag));
            }

            var residentialObjectService = bag.ResidentialObjectService();
            var uri = bagObject.Value.Links.AddressObject.Href;

            switch (uri.Segments[3].Replace("/", null).Trim().ToLower())
            {
            case "verblijfsobjecten":
                var id = uri.Segments[4];     // TODO: This may not always be true;
                return(residentialObjectService.GetById(new BagId(id)));

            default:
                break;
            }

            return(null);
        }
예제 #2
0
        /// <summary>
        /// Request residential object from premise.
        /// </summary>
        /// <param name="bagObject">Entity to extend.</param>
        /// <param name="bag">BAG registrar.</param>
        /// <returns><see cref="BagObject{ResidentialObject}"/>.</returns>
        public static BagObject <ResidentialObject> ResidentialObject(this BagObject <Premise> bagObject, KadasterBag bag)
        {
            if (bagObject == null)
            {
                throw new ArgumentNullException(nameof(bagObject));
            }

            if (bag == null)
            {
                throw new ArgumentNullException(nameof(bag));
            }

            var residentialObjectService = bag.ResidentialObjectService();
            var uri = bagObject.Value.Links.ResidentialObject.Href;
            var id  = uri.Segments[4]; // TODO: This may not always be true;

            return(residentialObjectService.GetById(new BagId(id)));
        }
예제 #3
0
        /// <summary>
        /// Request city from designation.
        /// </summary>
        /// <param name="bagObject">Entity to extend.</param>
        /// <param name="bag">BAG registrar.</param>
        /// <returns><see cref="BagObject{City}"/>.</returns>
        public static BagObject <City> City(this BagObject <PublicSpace> bagObject, KadasterBag bag)
        {
            if (bagObject == null)
            {
                throw new ArgumentNullException(nameof(bagObject));
            }

            if (bag == null)
            {
                throw new ArgumentNullException(nameof(bag));
            }

            var cityService = bag.CityService();
            var uri         = bagObject.Value.Links.City.Href;
            var id          = uri.Segments[4]; // TODO: This may not always be true;

            return(cityService.GetById(new BagId(id)));
        }
예제 #4
0
    void GenerateBagPixels(float padding)
    {
        BagPixels = new List <BagObject>();

        int numX = (int)(bagCircumfernce / padding);

        float bagHeight = 2;

        int numY = (int)(bagHeight / padding);

        Debug.Log(bagCircumfernce / padding);

        for (int x = 0; x < numX; x++)
        {
            for (int y = 0; y < numY; y++)
            {
                Vector2 position = new Vector2(x * padding, y * padding - bagHeight / 2);

                BagObject b = new BagObject(position, PadPrefab, this);

                BagPixels.Add(b);
            }
        }
    }