//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 18JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * Copy constructor. * @param mapCollection map object copy from. */ public MapCollection(MapCollection mapCollection) : base(mapCollection) { SetMapObjectType(COLLECTION); MultiPline = null; MultiPoint = null; MultiRegion = null; if (mapCollection.MultiPline != null) { MultiPline = new MapMultiPline(mapCollection.MultiPline); } if (mapCollection.MultiPoint != null) { MultiPoint = new MapMultiPoint(mapCollection.MultiPoint); } if (mapCollection.MultiRegion != null) { MultiRegion = new MapMultiRegion(mapCollection.MultiRegion); } }
static OdbcTypeConverter () { OdbcTypeMap = new MapCollection (); OdbcTypeMap.Add (new TypeMap (OdbcType.BigInt, SQL_C_TYPE.SBIGINT, SQL_TYPE.BIGINT )); OdbcTypeMap.Add (new TypeMap (OdbcType.Binary, SQL_C_TYPE.BINARY, SQL_TYPE.BINARY )); OdbcTypeMap.Add (new TypeMap (OdbcType.Bit, SQL_C_TYPE.BIT, SQL_TYPE.BIT )); OdbcTypeMap.Add (new TypeMap (OdbcType.Char, SQL_C_TYPE.CHAR, SQL_TYPE.CHAR )); OdbcTypeMap.Add (new TypeMap (OdbcType.Date, SQL_C_TYPE.TYPE_DATE, SQL_TYPE.TYPE_DATE )); OdbcTypeMap.Add (new TypeMap (OdbcType.DateTime, SQL_C_TYPE.TIMESTAMP, SQL_TYPE.TIMESTAMP )); OdbcTypeMap.Add (new TypeMap (OdbcType.Decimal, SQL_C_TYPE.NUMERIC, SQL_TYPE.NUMERIC , TypeMap.DefaultAll & (~TypeMap.DefaultForSQLType))); OdbcTypeMap.Add (new TypeMap (OdbcType.Double, SQL_C_TYPE.DOUBLE, SQL_TYPE.DOUBLE )); OdbcTypeMap.Add (new TypeMap (OdbcType.Image, SQL_C_TYPE.BINARY, SQL_TYPE.BINARY , TypeMap.DefaultAll & (~TypeMap.DefaultForSQLType))); OdbcTypeMap.Add (new TypeMap (OdbcType.Int, SQL_C_TYPE.LONG, SQL_TYPE.INTEGER )); OdbcTypeMap.Add (new TypeMap (OdbcType.NChar, SQL_C_TYPE.WCHAR, SQL_TYPE.WCHAR )); OdbcTypeMap.Add (new TypeMap (OdbcType.NText, SQL_C_TYPE.WCHAR, SQL_TYPE.WLONGVARCHAR)); // Currently, NUMERIC types works only with NUMERIC SQL Type to CHAR C Type mapping (pgsql). Other databases return // SQL_TYPE.DECIMAL in place of numeric types. OdbcTypeMap.Add (new TypeMap (OdbcType.Numeric, SQL_C_TYPE.CHAR, SQL_TYPE.NUMERIC )); OdbcTypeMap.Add (new TypeMap (OdbcType.NVarChar, SQL_C_TYPE.WCHAR, SQL_TYPE.WVARCHAR )); OdbcTypeMap.Add (new TypeMap (OdbcType.Real, SQL_C_TYPE.FLOAT, SQL_TYPE.REAL )); OdbcTypeMap.Add (new TypeMap (OdbcType.SmallDateTime, SQL_C_TYPE.TIMESTAMP, SQL_TYPE.TIMESTAMP , TypeMap.DefaultAll & (~TypeMap.DefaultForSQLType))); OdbcTypeMap.Add (new TypeMap (OdbcType.SmallInt, SQL_C_TYPE.SHORT, SQL_TYPE.SMALLINT )); OdbcTypeMap.Add (new TypeMap (OdbcType.Text, SQL_C_TYPE.WCHAR, SQL_TYPE.LONGVARCHAR)); OdbcTypeMap.Add (new TypeMap (OdbcType.Time, SQL_C_TYPE.TYPE_TIME, SQL_TYPE.TYPE_TIME )); OdbcTypeMap.Add (new TypeMap (OdbcType.Timestamp, SQL_C_TYPE.BINARY, SQL_TYPE.BINARY , TypeMap.DefaultAll & (~TypeMap.DefaultForSQLType))); OdbcTypeMap.Add (new TypeMap (OdbcType.TinyInt, SQL_C_TYPE.UTINYINT, SQL_TYPE.TINYINT )); OdbcTypeMap.Add (new TypeMap (OdbcType.UniqueIdentifier,SQL_C_TYPE.GUID, SQL_TYPE.GUID )); OdbcTypeMap.Add (new TypeMap (OdbcType.VarBinary, SQL_C_TYPE.BINARY, SQL_TYPE.VARBINARY )); OdbcTypeMap.Add (new TypeMap (OdbcType.VarChar, SQL_C_TYPE.WCHAR, SQL_TYPE.WVARCHAR , TypeMap.DefaultAll & (~TypeMap.DefaultForSQLType))); }
//////////////////////////////////////////////////////////////////////////// //--------------------------------- REVISIONS ------------------------------ // Date Name Tracking # Description // --------- ------------------- ------------- ---------------------- // 21JUN2009 James Shen Initial Creation //////////////////////////////////////////////////////////////////////////// /** * get a map collection object at given index. */ private MapCollection GetMapCollection(RecordIndex recordIndex) { MapCollection mapCollection = new MapCollection(); int regionPart = recordIndex.Param1; int plinePart = recordIndex.Param2; int multiPointPart = recordIndex.Param3; mapCollection.Bounds.X = recordIndex.MinX / DOUBLE_PRECISION; mapCollection.Bounds.Y = recordIndex.MinY / DOUBLE_PRECISION; mapCollection.Bounds.Width = (recordIndex.MaxX - recordIndex.MinX) / DOUBLE_PRECISION; mapCollection.Bounds.Height = (recordIndex.MaxY - recordIndex.MinY) / DOUBLE_PRECISION; if (regionPart > 0) { mapCollection.MultiRegion = new MapMultiRegion(); mapCollection.MultiRegion.BrushStyle.Pattern = DataReader.ReadInt(_reader); mapCollection.MultiRegion.BrushStyle.ForeColor = DataReader.ReadInt(_reader); mapCollection.MultiRegion.BrushStyle.BackColor = DataReader.ReadInt(_reader); mapCollection.MultiRegion.PenStyle.Pattern = DataReader.ReadInt(_reader); mapCollection.MultiRegion.PenStyle.Width = DataReader.ReadInt(_reader); mapCollection.MultiRegion.PenStyle.Color = DataReader.ReadInt(_reader); int centerX = DataReader.ReadInt(_reader); int centerY = DataReader.ReadInt(_reader); mapCollection.MultiRegion.CenterPt.X = centerX / DOUBLE_PRECISION; mapCollection.MultiRegion.CenterPt.Y = centerY / DOUBLE_PRECISION; mapCollection.MultiRegion.Regions = new GeoPolygon[regionPart]; for (int j = 0; j < regionPart; j++) { int numberOfPoints = DataReader.ReadInt(_reader); GeoLatLng[] latLngs = new GeoLatLng[numberOfPoints]; for (int i = 0; i < numberOfPoints; i++) { int x = DataReader.ReadInt(_reader); int y = DataReader.ReadInt(_reader); latLngs[i] = new GeoLatLng(y / DOUBLE_PRECISION, x / DOUBLE_PRECISION); } mapCollection.MultiRegion.Regions[j] = new GeoPolygon(latLngs, 0, 0, 0, 0, 0); } } if (plinePart > 0) { mapCollection.MultiPline = new MapMultiPline(); mapCollection.MultiPline.PenStyle.Pattern = DataReader.ReadInt(_reader); mapCollection.MultiPline.PenStyle.Width = DataReader.ReadInt(_reader); mapCollection.MultiPline.PenStyle.Color = DataReader.ReadInt(_reader); mapCollection.MultiPline.Plines = new GeoPolyline[plinePart]; for (int j = 0; j < plinePart; j++) { int numberOfPoints = DataReader.ReadInt(_reader); GeoLatLng[] latLngs = new GeoLatLng[numberOfPoints]; for (int i = 0; i < numberOfPoints; i++) { int x = DataReader.ReadInt(_reader); int y = DataReader.ReadInt(_reader); latLngs[i] = new GeoLatLng(y / DOUBLE_PRECISION, x / DOUBLE_PRECISION); } mapCollection.MultiPline.Plines[j] = new GeoPolyline(latLngs, 0, 0, 0); } } if (multiPointPart > 0) { mapCollection.MultiPoint = new MapMultiPoint(); mapCollection.MultiPoint.SymbolType.Shape = DataReader.ReadInt(_reader); mapCollection.MultiPoint.SymbolType.Color = DataReader.ReadInt(_reader); mapCollection.MultiPoint.SymbolType.Size = DataReader.ReadInt(_reader); multiPointPart = DataReader.ReadInt(_reader); mapCollection.MultiPoint.Points = new GeoLatLng[multiPointPart]; for (int i = 0; i < multiPointPart; i++) { int x = DataReader.ReadInt(_reader); int y = DataReader.ReadInt(_reader); mapCollection.MultiPoint.Points[i] = new GeoLatLng(y / DOUBLE_PRECISION, x / DOUBLE_PRECISION); } } return mapCollection; }
///////////////////////////////////////////////////// public MapCollector() { maps = new MapCollection(); }
public void SaveMap() { MapSer map = new MapSer(); map.name = saveName.text; map.Scarab2PartNumber = Convert.ToInt32(scarab2part.text); map.Scarab3PartNumber = Convert.ToInt32(scarab3part.text); int plusEdges = boxes.Count + 1; MapElement[,] mapElements = new MapElement[webCreator.RowCount + 2 * plusEdges, webCreator.ColumnCount + 2 * plusEdges]; for (int i = plusEdges; i < webCreator.RowCount + plusEdges; i++) { for (int j = plusEdges; j < webCreator.ColumnCount + plusEdges; j++) { mapElements[i, j] = actMap[i - plusEdges, j - plusEdges]; } } map.startPosition = new Vector3Ser(startPosition.x - plusEdges * SharedData.widhtUnit, startPosition.y, startPosition.z + plusEdges * SharedData.widhtUnit); Vector3 extraDistance = new Vector3(-1, 0, 1) * plusEdges * SharedData.widhtUnit; float charPositionX = startPosition.x + (joeMEB.Column + plusEdges) * SharedData.widhtUnit + extraDistance.x; float charPositionY = startPosition.y + joeMEB.PlaceHeight; float charPositionZ = startPosition.z - (joeMEB.Row + plusEdges) * SharedData.widhtUnit + extraDistance.z; map.charPosition = new Vector3Ser(charPositionX, charPositionY, charPositionZ); map.mapMatrix = mapElements; map.heigth = map.mapMatrix.GetLength(0); map.width = map.mapMatrix.GetLength(1); map.boxNumber = boxes.Count; map.boxLocations = new Vector3Ser[boxes.Count]; for (int i = 0; i < boxes.Count; i++) { MapElementBox boxME = boxes[i].GetComponent <MapElementBox>(); float boxLocationX = startPosition.x + (boxME.Column + plusEdges) * SharedData.widhtUnit + extraDistance.x; float boxLocationY = startPosition.y + boxME.PlaceHeight; float boxLocationZ = startPosition.z - (boxME.Row + plusEdges) * SharedData.widhtUnit + extraDistance.z; map.boxLocations[i] = new Vector3Ser(boxLocationX, boxLocationY, boxLocationZ); } if (itemType == MapElement.Key) { map.itemType = SharedData.KeyType; } else if (itemType == MapElement.Gem) { map.itemType = SharedData.GemType; } else if (itemType == MapElement.Relic) { map.itemType = SharedData.RelicType; } else { map.itemType = SharedData.DefaultType; } MapCollection.CalculateItemsMapSer(map); Save(map); SceneLoader.LoadSceneStatic(GameStructure.extraSceneName); }
/// <summary> /// Should be called the first thing every time the master template executes. /// </summary> /// <param name="tablePrefix">TablePrefix Property</param> /// <param name="namingProperty">NamingContentions Property</param> public static void HelperInit(string tablePrefix, MapCollection systemCSharpAliasMap, MapCollection csharpKeyWordEscapeMap, string[] excludedColumns, string versionRegex, string providerName) //, NamingProperty namingConventions) { _tablePrefix = tablePrefix; SystemCSharpAliasMap = systemCSharpAliasMap; CsharpKeyWordEscapeMap = csharpKeyWordEscapeMap; VersionRegex = new Regex(versionRegex, RegexOptions.Compiled); _excludedColumns = new List <Regex>(); foreach (var s in excludedColumns) { if (!String.IsNullOrEmpty(s) && s.Trim().Length > 0) { _excludedColumns.Add(new Regex(s, RegexOptions.Compiled)); } } SchemaProvider = (SchemaProvider)Enum.Parse(typeof(SchemaProvider), providerName); //_tableNaming = namingConventions.TableNaming; //_entityNaming = namingConventions.EntityNaming; //_associationNaming = namingConventions.AssociationNaming; //_associationSuffix = namingConventions.AssociationSuffix; }
public void InsertarMap(string identificador, MapCollection map) { this.Add(identificador, map); }