From 3436647f08feb2966a978cdb1925d3e10c59638c Mon Sep 17 00:00:00 2001 From: Karim Naaji Date: Wed, 1 Nov 2017 17:28:59 -0400 Subject: [PATCH] Remove shadowing from scene groupe type --- Assets/Editor/MapzenMapEditor.cs | 10 +++++----- Assets/Mapzen/SceneGroup.cs | 12 ++++++------ Assets/Mapzen/Unity/TileTask.cs | 14 +++++++------- Assets/MapzenMap.cs | 6 +++--- 4 files changed, 21 insertions(+), 21 deletions(-) diff --git a/Assets/Editor/MapzenMapEditor.cs b/Assets/Editor/MapzenMapEditor.cs index 55fedeb2..ba0d63f1 100644 --- a/Assets/Editor/MapzenMapEditor.cs +++ b/Assets/Editor/MapzenMapEditor.cs @@ -51,7 +51,7 @@ public override void OnInspectorGUI() SavePreferences(); } - private void SceneGroupToggle(MapzenMap mapzenMap, SceneGroup.Type type) + private void SceneGroupToggle(MapzenMap mapzenMap, SceneGroup.GroupType type) { bool isSet = SceneGroup.Test(type, mapzenMap.GroupOptions); isSet = EditorGUILayout.Toggle(type.ToString(), isSet); @@ -74,13 +74,13 @@ private void TileDataFoldout() EditorGUI.indentLevel++; EditorGUILayout.BeginHorizontal(); - SceneGroupToggle(mapzenMap, SceneGroup.Type.Feature); - SceneGroupToggle(mapzenMap, SceneGroup.Type.Filter); + SceneGroupToggle(mapzenMap, SceneGroup.GroupType.Feature); + SceneGroupToggle(mapzenMap, SceneGroup.GroupType.Filter); EditorGUILayout.EndHorizontal(); EditorGUILayout.BeginHorizontal(); - SceneGroupToggle(mapzenMap, SceneGroup.Type.Layer); - SceneGroupToggle(mapzenMap, SceneGroup.Type.Tile); + SceneGroupToggle(mapzenMap, SceneGroup.GroupType.Layer); + SceneGroupToggle(mapzenMap, SceneGroup.GroupType.Tile); EditorGUILayout.EndHorizontal(); EditorGUI.indentLevel--; diff --git a/Assets/Mapzen/SceneGroup.cs b/Assets/Mapzen/SceneGroup.cs index 4066fe8f..877fa1c8 100644 --- a/Assets/Mapzen/SceneGroup.cs +++ b/Assets/Mapzen/SceneGroup.cs @@ -7,7 +7,7 @@ namespace Mapzen public class SceneGroup { [Flags] - public enum Type + public enum GroupType { None = 0, Tile = 1 << 0, @@ -24,9 +24,9 @@ public enum Type // The mesh data, may be empty public MeshData meshData; - public Type type; + public GroupType type; - public SceneGroup(Type type, string name) + public SceneGroup(GroupType type, string name) { this.childs = new Dictionary(); this.type = type; @@ -39,7 +39,7 @@ public SceneGroup(Type type, string name) /// /// The type to check. /// The group type options. - public static bool Test(Type type, Type options) + public static bool Test(GroupType type, GroupType options) { return ((int)type & (int)options) == (int)type; } @@ -49,14 +49,14 @@ public static bool Test(Type type, Type options) /// /// The type to check. /// The group type options. - public static bool IsLeaf(Type type, Type options) + public static bool IsLeaf(GroupType type, GroupType options) { return ((int)type ^ (int)options) < (int)type; } public override string ToString() { - if (type == Type.None || type == Type.All) + if (type == GroupType.None || type == GroupType.All) { return name; } diff --git a/Assets/Mapzen/Unity/TileTask.cs b/Assets/Mapzen/Unity/TileTask.cs index d8e5e2a1..b22db13b 100644 --- a/Assets/Mapzen/Unity/TileTask.cs +++ b/Assets/Mapzen/Unity/TileTask.cs @@ -13,11 +13,11 @@ public class TileTask private TileAddress address; private byte[] response; private bool ready; - private SceneGroup.Type groupOptions; + private SceneGroup.GroupType groupOptions; private float inverseTileScale; private Matrix4x4 transform; - public TileTask(TileAddress address, SceneGroup.Type groupOptions, byte[] response, float offsetX, float offsetY, float regionScaleRatio) + public TileTask(TileAddress address, SceneGroup.GroupType groupOptions, byte[] response, float offsetX, float offsetY, float regionScaleRatio) { this.address = address; this.response = response; @@ -40,7 +40,7 @@ public void Start(List featureStyling, SceneGroup root) // The leaf currently used (will hold the mesh data for the currently matched group) SceneGroup leaf = root; - var tileGroup = OnSceneGroupData(SceneGroup.Type.Tile, address.ToString(), root, ref leaf); + var tileGroup = OnSceneGroupData(SceneGroup.GroupType.Tile, address.ToString(), root, ref leaf); foreach (var style in featureStyling) { @@ -51,11 +51,11 @@ public void Start(List featureStyling, SceneGroup root) foreach (var filterStyle in style.FilterStyles) { - var filterGroup = OnSceneGroupData(SceneGroup.Type.Filter, filterStyle.Name, tileGroup, ref leaf); + var filterGroup = OnSceneGroupData(SceneGroup.GroupType.Filter, filterStyle.Name, tileGroup, ref leaf); foreach (var layer in tileData.FeatureCollections) { - var layerGroup = OnSceneGroupData(SceneGroup.Type.Layer, layer.Name, filterGroup, ref leaf); + var layerGroup = OnSceneGroupData(SceneGroup.GroupType.Layer, layer.Name, filterGroup, ref leaf); foreach (var feature in filterStyle.GetFilter().Filter(layer)) { @@ -69,7 +69,7 @@ public void Start(List featureStyling, SceneGroup root) featureName += identifier.ToString(); } - OnSceneGroupData(SceneGroup.Type.Feature, featureName, layerGroup, ref leaf); + OnSceneGroupData(SceneGroup.GroupType.Feature, featureName, layerGroup, ref leaf); if (feature.Type == GeometryType.Polygon || feature.Type == GeometryType.MultiPolygon) { @@ -100,7 +100,7 @@ public void Start(List featureStyling, SceneGroup root) ready = true; } - private SceneGroup OnSceneGroupData(SceneGroup.Type type, string name, SceneGroup parent, ref SceneGroup leaf) + private SceneGroup OnSceneGroupData(SceneGroup.GroupType type, string name, SceneGroup parent, ref SceneGroup leaf) { SceneGroup group = null; diff --git a/Assets/MapzenMap.cs b/Assets/MapzenMap.cs index c62b8ec7..39bd0c43 100644 --- a/Assets/MapzenMap.cs +++ b/Assets/MapzenMap.cs @@ -33,7 +33,7 @@ public class MapzenMap : MonoBehaviour [HideInInspector] [SerializeField] - private SceneGroup.Type groupOptions; + private SceneGroup.GroupType groupOptions; [HideInInspector] [SerializeField] @@ -52,7 +52,7 @@ public void DownloadTiles() tasks.Clear(); nTasksForArea = 0; - regionMap = new SceneGroup(SceneGroup.Type.None, RegionName); + regionMap = new SceneGroup(SceneGroup.GroupType.None, RegionName); foreach (var tileAddress in bounds.TileAddressRange) { @@ -142,7 +142,7 @@ public float RegionScaleRatio { set { regionScaleRatio = value; } } - public SceneGroup.Type GroupOptions + public SceneGroup.GroupType GroupOptions { get { return groupOptions; } set { groupOptions = value; }