/// <summary>
        /// Create all the streets for this node
        /// </summary>
        /// <param name="node">The road network node</param>
        public static void CreateAllStreets(RoadNetworkNode node)
        {
            foreach (RoadNetworkNode rnn in node.Details.Roads)
            {
                if (rnn == null)
                {
                    continue;
                }

                if (rnn.RoadUnion == null)
                {
                    continue;
                }

                string[] stringArray = new string[2] {
                    node.name, rnn.name
                };
                Array.Sort(stringArray);

                string     streetFullName = string.Join("-", stringArray);
                StreetData sd             = StreetManager.Instance[streetFullName];
                if (sd != null)
                {
                    if (!sd.Used)
                    {
                        node.AddStreetList(streetFullName);
                        sd.CreateStreetLayout(rnn.Details.Subdivide);
                        sd.Used = true;
                    }
                }
            }
        }
Esempio n. 2
0
    /// <summary>
    /// Apply the strights to the terrain
    /// </summary>
    /// <param name="_roadNetworkNode">The main road network node</param>
    /// <param name="tm">The Terrain modifier</param>
    /// <param name="index">The index of the road to use</param>
    public static void ApplyLeadingStrights(RoadNetworkNode _roadNetworkNode, TerrainModifier tm, int index)
    {
        string[] stringArray = new string[2] {
            _roadNetworkNode.name, _roadNetworkNode.Details.Roads[index].name
        };
        Array.Sort(stringArray);

        string streetFullName = string.Join("-", stringArray);

        StreetData       street = StreetManager.Instance[streetFullName];
        RoadCrossSection rsc    = street.GetFirst;

        if (rsc == null)
        {
            return;
        }

        RoadCrossSection rsca = street.GetSecond;

        if (rsca == null)
        {
            return;
        }

        tm.ApplyToTerrain(rsc, rsca);
    }
Esempio n. 3
0
        // GET: Edit Street
        public ActionResult Edit(string id)
        {
            ViewBag.barangays = BarangayData.ListAll();
            Street model = StreetData.GetById(id);

            return(View(model));
        }
Esempio n. 4
0
        // GET: Street
        public ActionResult Index()
        {
            ViewBag.barangays = BarangayData.ListAll();
            List <Street> model = new List <Street>();

            model = StreetData.ListAll();
            return(View(model));
        }
 /// <summary>
 /// Create the mesh for all of the given streets
 /// </summary>
 /// <param name="_roadNetworkNode">The build object</param>
 /// <param name="_streetNames">The list of streets to add</param>
 public static void MeshStreets(IRoadBuildData roadBuilderObject, List <string> _streetNames)
 {
     foreach (string streetName in _streetNames)
     {
         StreetData sd = StreetManager.Instance[streetName];
         if (sd != null)
         {
             sd.CreateMesh(roadBuilderObject);
         }
     }
 }
Esempio n. 6
0
        public ActionResult Edit(Street model)
        {
            bool result = StreetData.Edit(model);

            if (result)
            {
                return(RedirectToAction("Index"));
            }

            return(View());
        }
Esempio n. 7
0
        public ActionResult Delete(Street model)
        {
            bool result = StreetData.Delete(model.UniqueId.ToString());

            if (result)
            {
                return(RedirectToAction("Index"));
            }

            return(View());
        }
 // GET: Add Business Record
 public ActionResult Add()
 {
     ViewBag.businessowners  = BusinessOwnerData.ListAll();
     ViewBag.businessdetails = BusinessDetailData.ListAll();
     ViewBag.provinces       = ProvincesData.ListAll();
     ViewBag.cities          = CitiesData.ListAll();
     ViewBag.districts       = DistrictData.ListAll();
     ViewBag.barangays       = BarangayData.ListAll();
     ViewBag.streets         = StreetData.ListAll();
     ViewBag.businesstype    = BusinessTypeData.ListAll();
     ViewBag.Requirements    = RequirementData.GetNew();
     return(View());
 }
        // GET: Delete Business Record
        public ActionResult Delete(string id)
        {
            ViewBag.businessowners  = BusinessOwnerData.ListAll();
            ViewBag.businessdetails = BusinessDetailData.ListAll();
            ViewBag.provinces       = ProvincesData.ListAll();
            ViewBag.cities          = CitiesData.ListAll();
            ViewBag.districts       = DistrictData.ListAll();
            ViewBag.barangays       = BarangayData.ListAll();
            ViewBag.streets         = StreetData.ListAll();
            ViewBag.businesstype    = BusinessTypeData.ListAll();
            BusinessRecord model = BusinessRecordData.GetById(id);

            return(View(model));
        }
        // GET: Edit Business Record
        public ActionResult Edit(string id)
        {
            ViewBag.businessowners  = BusinessOwnerData.ListAll();
            ViewBag.businessdetails = BusinessDetailData.ListAll();
            ViewBag.provinces       = ProvincesData.ListAll();
            ViewBag.cities          = CitiesData.ListAll();
            ViewBag.districts       = DistrictData.ListAll();
            ViewBag.barangays       = BarangayData.ListAll();
            ViewBag.streets         = StreetData.ListAll();
            ViewBag.businesstype    = BusinessTypeData.ListAll();
            BusinessRecord model = BusinessRecordData.GetById(id);

            ViewBag.businessRecords = new HashSet <int>(model.Requirements.Select(i => i.Id));
            if (model.BusinessDetail.isNew)
            {
                ViewBag.Requirements = RequirementData.GetNew();
            }
            else
            {
                ViewBag.Requirements = RequirementData.GetRenew();
            }
            return(View(model));
        }
Esempio n. 11
0
        public ActionResult Streets()
        {
            List <Street> sts = StreetData.ListAll();

            return(Json(new { sts, isSuccess = true }, JsonRequestBehavior.AllowGet));
        }