Skip to content

Commit

Permalink
Remove shadowing from scene groupe type
Browse files Browse the repository at this point in the history
  • Loading branch information
karimnaaji committed Nov 1, 2017
1 parent bb62aeb commit 3436647
Show file tree
Hide file tree
Showing 4 changed files with 21 additions and 21 deletions.
10 changes: 5 additions & 5 deletions Assets/Editor/MapzenMapEditor.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand All @@ -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--;
Expand Down
12 changes: 6 additions & 6 deletions Assets/Mapzen/SceneGroup.cs
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ namespace Mapzen
public class SceneGroup
{
[Flags]
public enum Type
public enum GroupType
{
None = 0,
Tile = 1 << 0,
Expand All @@ -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<string, SceneGroup>();
this.type = type;
Expand All @@ -39,7 +39,7 @@ public SceneGroup(Type type, string name)
/// </summary>
/// <param name="type">The type to check.</param>
/// <param name="options">The group type options.</param>
public static bool Test(Type type, Type options)
public static bool Test(GroupType type, GroupType options)
{
return ((int)type & (int)options) == (int)type;
}
Expand All @@ -49,14 +49,14 @@ public static bool Test(Type type, Type options)
/// </summary>
/// <param name="type">The type to check.</param>
/// <param name="options">The group type options.</param>
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;
}
Expand Down
14 changes: 7 additions & 7 deletions Assets/Mapzen/Unity/TileTask.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -40,7 +40,7 @@ public void Start(List<FeatureStyle> 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)
{
Expand All @@ -51,11 +51,11 @@ public void Start(List<FeatureStyle> 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))
{
Expand All @@ -69,7 +69,7 @@ public void Start(List<FeatureStyle> 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)
{
Expand Down Expand Up @@ -100,7 +100,7 @@ public void Start(List<FeatureStyle> 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;

Expand Down
6 changes: 3 additions & 3 deletions Assets/MapzenMap.cs
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ public class MapzenMap : MonoBehaviour

[HideInInspector]
[SerializeField]
private SceneGroup.Type groupOptions;
private SceneGroup.GroupType groupOptions;

[HideInInspector]
[SerializeField]
Expand All @@ -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)
{
Expand Down Expand Up @@ -142,7 +142,7 @@ public float RegionScaleRatio {
set { regionScaleRatio = value; }
}

public SceneGroup.Type GroupOptions
public SceneGroup.GroupType GroupOptions
{
get { return groupOptions; }
set { groupOptions = value; }
Expand Down

0 comments on commit 3436647

Please sign in to comment.