public string AddArea(string id, string areaId, AreaType areaType, string areaName, string parentId, string zip, string createUserId) { string areaTypeId = string.Empty; switch (areaType) { case AreaType.Country: areaTypeId = "1"; break; case AreaType.Province: areaTypeId = "2"; break; case AreaType.City: areaTypeId = "3"; break; case AreaType.Distrct: areaTypeId = "4"; break; case AreaType.Abroad: areaTypeId = "abroad"; break; default: throw new FacadeException("不能添加此类型的区域 - " + areaType.ToString()); } return AddArea(id, areaId, areaTypeId, areaName, parentId, zip, createUserId); }
public string AddArea(string id, string areaId, AreaType areaType, string areaName, string parentId, string zip, string createUserId) { string areaTypeId = string.Empty; switch (areaType) { case AreaType.Country: areaTypeId = "1"; break; case AreaType.Province: areaTypeId = "2"; break; case AreaType.City: areaTypeId = "3"; break; case AreaType.Distrct: areaTypeId = "4"; break; case AreaType.Abroad: areaTypeId = "abroad"; break; default: throw new FacadeException("不能添加此类型的区域 - " + areaType.ToString()); } return(AddArea(id, areaId, areaTypeId, areaName, parentId, zip, createUserId)); }
// 保存mesh public void SaveMesh(string outputFilePath, AreaType type, Mesh mesh) { if (mesh == null) { return; } mesh.RecalculateNormals(); string dataPath = outputFilePath + type.ToString() + m_Index.ToString() + ".asset"; AssetDatabase.CreateAsset(mesh, dataPath); m_Index++; }
/// <summary> /// Return the list of allow furniture type from a area type /// </summary> /// <param name="areaType">type of the area</param> /// <returns>Return the list of furniture names that may appear in this area</returns> public List <string> GetFurnitureTypeListByAreaType(AreaType areaType) { List <string> furnitureType = new List <string>(); foreach (AreaRules rule in areaRules) { if (rule.type == areaType.ToString()) { furnitureType = rule.furnitureType; break; } } return(furnitureType); }
public void Spawn(AreaType _type, Vector3 _pos) { type = _type; this.transform.position = _pos; this.gameObject.name = "Area " + type.ToString(); SetSize(); SetColor(); SetRestrictedEvents(); //CheckPointsInside(); }
public static string GetJSONDescription(this AreaType area) { //Using reflection to get the field info FieldInfo info = area.GetType().GetField(area.ToString()); //Get the Description Attributes JSONDescriptionAttribute[] attributes = (JSONDescriptionAttribute[])info.GetCustomAttributes(typeof(JSONDescriptionAttribute), false); //Only capture the description attribute if it is a concrete result (i.e. 1 entry) if (attributes.Length == 1) { return(attributes[0].Description); } else //Use the value for display if not concrete result { throw (new CustomAttributeFormatException("Missing JSON Description")); } }
public object GetJSON() { return(new { Id, AreaType = AreaType.ToString(), ItemId, SearchTerm, Referer, Url, LinkType, PreviousId, UserAgent, UserLanguages, BrowserVersion, BrowserName, IpAddress, DateTime }); }
private void CreateGolfTerrian(float xSize, float zSize, int w, int h, Vector3 gridStart, AreaType Type) { GameObject obj = new GameObject("Terrian_" + Type.ToString()); obj.transform.parent = GameObject.Find("GolfMap").transform; obj.layer = 16; MeshFilter mf = obj.AddComponent <MeshFilter>(); MeshRenderer mr = obj.AddComponent <MeshRenderer>(); if (Type == AreaType.Fairway) { mr.sharedMaterial = AssetDatabase.LoadAssetAtPath <Material>("Assets/Art/Model/Sketchups/Materials/GolfTerrain1.mat"); } else if (Type == AreaType.Rough) { mr.sharedMaterial = AssetDatabase.LoadAssetAtPath <Material>("Assets/Art/Model/Sketchups/Materials/GolfTerrain2.mat"); } else if (Type == AreaType.SandBunker) { mr.sharedMaterial = AssetDatabase.LoadAssetAtPath <Material>("Assets/Art/Model/Sketchups/Materials/GolfTerrain3.mat"); } else if (Type == AreaType.PuttingGreen) { mr.sharedMaterial = AssetDatabase.LoadAssetAtPath <Material>("Assets/Art/Model/Sketchups/Materials/GolfTerrain4.mat"); } GolfMeshCreate _creator = new GolfMeshCreate(); Mesh mesh = _creator.CreateMesh(w, h, xSize, zSize, gridStart, Type); mf.mesh = mesh; SaveMesh("Assets/Mesh/", Type, mesh); SubMapData sm = new SubMapData(Type, _creator.Listpt, _creator.ListTriangle); m_map.AddSubMap(sm); }
public GridSummaryItem(AreaType areaType) { GridType = areaType.ToString(); GridDescription = GetDescription(areaType); GridLayers = new Collection <GridLayerSummaryItem>(); }
/// <summary> /// Polluntant Release Comparision /// </summary> /// <param name="swfFile">Use the public CONST from this class</param> /// <param name="data">AreaComparison</param> /// <param name="updatePanel"></param> /// <param name="uniqueId">Recommended use: this.UniqueId.ToString()</param> /// <param name="type">EPRTR.Charts.AreaType</param> /// public static void ChartClientScript(string swfFile, string chartLabel, List <PollutantReleases.AreaComparison> data, Panel updatePanel, string uniqueId, AreaType type, int count) { string Encoded = MakeJSONData(PopulateChartDataContract(data)); string script = String.Format("BarChart(\"{0}\",\"{1}\", \"{2}\", \"{3}\", \"{4}\", \"{5}\");", chartLabel, Encoded, SwfFileLocation(swfFile), "barchart", type.ToString().ToLower(), ChartHeight(count)); ScriptManager.RegisterClientScriptBlock(updatePanel, typeof(string), swfFile + uniqueId, script, true); }
public override void FinalizeRun() { if (!string.IsNullOrEmpty(_field)) { if (string.Compare(_field, "Country", true) == 0 || string.Compare(_field, "State", true) == 0 || string.Compare(_field, "County", true) == 0) { UpdateCachesFromInputTable(string.Format("{0}=AREANAME(Latitude, Longitude, '{1}', '{2}')", _field, _level.ToString(), _prefix.Replace("'", "''"))); } else { TotalProcessTime.Start(); DatabaseConnection.ExecuteNonQuery(string.Format("update Custom set {1} = (select AREANAME(Latitude, Longitude, '{2}', '{3}') as {1} from Caches where Caches.Code=Custom.cCode) where exists (select 1 from {0} where {0}.gccode=Custom.cCode)", ActionInputTableName, _field, _level.ToString(), _prefix.Replace("'", "''"))); TotalProcessTime.Stop(); } } base.FinalizeRun(); }
public ScenesData nextDB; //mostly for gameplay /* * Levels */ //Load a scene with a given index public void LoadLevelWithIndex(int index) { if (index <= 4) { AsyncOperation l = SceneManager.LoadSceneAsync("Loader"); //Load Gameplay scene for the level var q = SceneManager.LoadSceneAsync("PlayerControllerScene", LoadSceneMode.Additive); //Load first part of the level in additive mode var p = SceneManager.LoadSceneAsync("Base" + CurrentLevelIndex.ToString() + _AreaType.ToString(), LoadSceneMode.Additive); } //reset the index if we have no more levels else { CurrentLevelIndex = 1; NewGame(); } }
public static IHtmlString ApprovalTypeLink(this HtmlHelper helper, AreaType areaType, string displayName, Guid headerKey, DateTime viewDate, object htmlAttributes) { if (viewDate.Date != DateTime.Today) { return(helper.ActionLink(displayName ?? headerKey.ToString(), "Index", "Details", new { @area = areaType.ToString(), hk = headerKey.ToShortGuid(), dt = viewDate.ToUrlString() }, htmlAttributes)); } else { return(helper.ActionLink(displayName ?? headerKey.ToString(), "Index", "Details", new { @area = areaType.ToString(), hk = headerKey.ToShortGuid() }, htmlAttributes)); } }
public void initialize(int givenWidth, int givenHeight, Vector2 givenCenter, AreaPosition pos, AreaType type, ref List <Block> sidewalks) { areaSetIndex = -1; areaPosition = pos; center = givenCenter; width = givenWidth; height = givenHeight; transform.name = type.ToString(); int prefixWidth = width / 2; int prefixHeight = height / 2; setRegion(prefixWidth, prefixHeight, pos); blocks = new List <List <Block> >(); for (int i = 0; i < width; i++) { blocks.Add(new List <Block>()); for (int k = 0; k < height; k++) { if (putSidewalkBlock(i, k, width, height, prefixWidth, prefixHeight, ref sidewalks)) { continue; } float idxX = i - prefixWidth + (int)center.x; float idxY = k - prefixHeight + (int)center.y; if (type == AreaType.Intersection) { blocks[i].Add(Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyRoadBlock") as GameObject).GetComponent <RoadBlock>(), Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.RoadBlock); blocks[i][blocks[i].Count - 1].initialize(idxX, idxY, ModelType.RoadIntersection); } else if (type == AreaType.AreaBlock) { blocks[i].Add(Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyAreaBlock") as GameObject).GetComponent <AreaBlock>(), Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.AreaBlock); blocks[i][blocks[i].Count - 1].initialize(idxX, idxY, ModelType.AreaBuilding); } /* * else if (type == AreaType.Grass) * { * blocks[i].Add(Object.Instantiate(model, Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.AreaBlock); * blocks[i][blocks[i].Count - 1].initialize(idxX, idxY, ModelType.AreaGrass); * } * else if (type == AreaType.Building) * { * blocks[i].Add(Object.Instantiate(model, Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.AreaBlock); * blocks[i][blocks[i].Count - 1].initialize(idxX, idxY, ModelType.AreaBuilding); * } * else if (type == AreaType.Forest) * { * blocks[i].Add(Object.Instantiate(model, Vector3.zero, Quaternion.identity) as SCPAR.SIM.PVATestbed.AreaBlock); * blocks[i][blocks[i].Count - 1].initialize(idxX, idxY, ModelType.AreaForest); * } */ blocks[i][blocks[i].Count - 1].transform.parent = transform; } } // create more roadblock for four corners of an intersection if (type == AreaType.Intersection) { RoadBlock temp = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyRoadBlock") as GameObject).GetComponent <RoadBlock>(), Vector3.zero, Quaternion.identity, transform) as SCPAR.SIM.PVATestbed.RoadBlock; temp.initialize(-1 - prefixWidth + (int)center.x, -1 - prefixHeight + (int)center.y, ModelType.RoadNormal); temp = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyRoadBlock") as GameObject).GetComponent <RoadBlock>(), Vector3.zero, Quaternion.identity, transform) as SCPAR.SIM.PVATestbed.RoadBlock; temp.initialize(width - prefixWidth + (int)center.x, height - prefixHeight + (int)center.y, ModelType.RoadNormal); temp = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyRoadBlock") as GameObject).GetComponent <RoadBlock>(), Vector3.zero, Quaternion.identity, transform) as SCPAR.SIM.PVATestbed.RoadBlock; temp.initialize(width - prefixWidth + (int)center.x, -1 - prefixHeight + (int)center.y, ModelType.RoadNormal); temp = Object.Instantiate((Resources.Load("Prefab/DummyObjects/DummyRoadBlock") as GameObject).GetComponent <RoadBlock>(), Vector3.zero, Quaternion.identity, transform) as SCPAR.SIM.PVATestbed.RoadBlock; temp.initialize(-1 - prefixWidth + (int)center.x, height - prefixHeight + (int)center.y, ModelType.RoadNormal); } }