Skip to content
Permalink
Browse files

[Quantum] Renamed Index into NodeIndex to avoid clash with future Sys…

…tem.Index
  • Loading branch information
xen2 committed Aug 2, 2019
1 parent a726144 commit 593754598191c6bc29995478be98962ad959452a
Showing with 1,552 additions and 1,552 deletions.
  1. +2 −2 sources/assets/Xenko.Core.Assets.Quantum.Tests/Helpers/AssetNodeInternalExtensions.cs
  2. +7 −7 sources/assets/Xenko.Core.Assets.Quantum.Tests/Helpers/Types.cs
  3. +118 −118 sources/assets/Xenko.Core.Assets.Quantum.Tests/TestArchetypesAdvanced.cs
  4. +565 −565 sources/assets/Xenko.Core.Assets.Quantum.Tests/TestArchetypesBasic.cs
  5. +3 −3 sources/assets/Xenko.Core.Assets.Quantum.Tests/TestObjectReferenceGraph.cs
  6. +135 −135 sources/assets/Xenko.Core.Assets.Quantum.Tests/TestOverrideSerialization.cs
  7. +5 −5 sources/assets/Xenko.Core.Assets.Quantum/AssetCompositeHierarchyPropertyGraph.cs
  8. +1 −1 sources/assets/Xenko.Core.Assets.Quantum/AssetCompositeHierarchyPropertyGraphDefinition.cs
  9. +1 −1 sources/assets/Xenko.Core.Assets.Quantum/AssetGraphNodeLinker.cs
  10. +34 −34 sources/assets/Xenko.Core.Assets.Quantum/AssetPropertyGraph.cs
  11. +1 −1 sources/assets/Xenko.Core.Assets.Quantum/AssetPropertyGraphDefinition.cs
  12. +16 −16 sources/assets/Xenko.Core.Assets.Quantum/IAssetObjectNode.cs
  13. +19 −19 sources/assets/Xenko.Core.Assets.Quantum/Internal/AssetBoxedNode.cs
  14. +1 −1 sources/assets/Xenko.Core.Assets.Quantum/Internal/AssetMemberNode.cs
  15. +19 −19 sources/assets/Xenko.Core.Assets.Quantum/Internal/AssetObjectNode.cs
  16. +24 −24 sources/assets/Xenko.Core.Assets.Quantum/Internal/AssetObjectNodeExtended.cs
  17. +2 −2 sources/assets/Xenko.Core.Assets.Quantum/Internal/IAssetObjectNodeInternal.cs
  18. +1 −1 sources/assets/Xenko.Core.Assets.Quantum/Visitors/AssetGraphVisitorBase.cs
  19. +4 −4 sources/assets/Xenko.Core.Assets.Quantum/Visitors/ClearObjectReferenceVisitor.cs
  20. +1 −1 sources/assets/Xenko.Core.Assets.Quantum/Visitors/ExternalReferenceCollector.cs
  21. +2 −2 sources/assets/Xenko.Core.Assets.Quantum/Visitors/IdentifiableObjectVisitorBase.cs
  22. +8 −8 sources/editor/Xenko.Assets.Presentation/AssemblyReloading/GameStudioAssemblyReloader.cs
  23. +1 −1 ...tation/AssetEditors/AssetCompositeGameEditor/ViewModels/AssetCompositeHierarchyEditorViewModel.cs
  24. +3 −3 ...editor/Xenko.Assets.Presentation/AssetEditors/EntityHierarchyEditor/Game/NavigationMeshManager.cs
  25. +2 −2 ...sentation/AssetEditors/EntityHierarchyEditor/ViewModels/EntityHierarchyElementChangePropagator.cs
  26. +1 −1 ...ets.Presentation/AssetEditors/EntityHierarchyEditor/ViewModels/EntityHierarchyElementViewModel.cs
  27. +2 −2 ...Assets.Presentation/AssetEditors/EntityHierarchyEditor/ViewModels/EntityHierarchyItemViewModel.cs
  28. +2 −2 ...editor/Xenko.Assets.Presentation/AssetEditors/EntityHierarchyEditor/ViewModels/EntityViewModel.cs
  29. +6 −6 .../editor/Xenko.Assets.Presentation/AssetEditors/GameEditor/ViewModels/ContentReferenceCollector.cs
  30. +5 −5 ...editor/Xenko.Assets.Presentation/AssetEditors/GameEditor/ViewModels/GameEditorChangePropagator.cs
  31. +1 −1 ...tation/AssetEditors/GraphicsCompositorEditor/ViewModels/GraphicsCompositorCameraSlotsViewModel.cs
  32. +4 −4 ...resentation/AssetEditors/GraphicsCompositorEditor/ViewModels/GraphicsCompositorEditorViewModel.cs
  33. +1 −1 ....Presentation/AssetEditors/GraphicsCompositorEditor/ViewModels/GraphicsCompositorItemViewModel.cs
  34. +1 −1 ...ko.Assets.Presentation/AssetEditors/GraphicsCompositorEditor/ViewModels/RenderFeatureViewModel.cs
  35. +1 −1 ...enko.Assets.Presentation/AssetEditors/GraphicsCompositorEditor/ViewModels/RenderStageViewModel.cs
  36. +4 −4 ...Presentation/AssetEditors/GraphicsCompositorEditor/ViewModels/SharedRendererBlockBaseViewModel.cs
  37. +1 −1 ...ets.Presentation/AssetEditors/GraphicsCompositorEditor/ViewModels/SharedRendererBlockViewModel.cs
  38. +2 −2 ...resentation/AssetEditors/GraphicsCompositorEditor/ViewModels/SharedRendererOutputSlotViewModel.cs
  39. +1 −1 ...ces/editor/Xenko.Assets.Presentation/AssetEditors/PrefabEditor/Services/PrefabEditorController.cs
  40. +1 −1 sources/editor/Xenko.Assets.Presentation/AssetEditors/SceneEditor/Services/SceneEditorController.cs
  41. +2 −2 sources/editor/Xenko.Assets.Presentation/AssetEditors/SpriteEditor/ViewModels/SpriteInfoViewModel.cs
  42. +2 −2 ...itor/Xenko.Assets.Presentation/AssetEditors/SpriteEditor/ViewModels/SpriteSheetEditorViewModel.cs
  43. +1 −1 sources/editor/Xenko.Assets.Presentation/AssetEditors/UIEditor/Services/UIEditorController.cs
  44. +2 −2 sources/editor/Xenko.Assets.Presentation/AssetEditors/UIEditor/ViewModels/PanelViewModel.cs
  45. +5 −5 sources/editor/Xenko.Assets.Presentation/AssetEditors/UIEditor/ViewModels/UIElementViewModel.cs
  46. +1 −1 ...tor/Xenko.Assets.Presentation/AssetEditors/UILibraryEditor/ViewModels/UILibraryEditorViewModel.cs
  47. +1 −1 sources/editor/Xenko.Assets.Presentation/AssetEditors/VisualScriptEditor/SinglePropertyProvider.cs
  48. +3 −3 ...es/editor/Xenko.Assets.Presentation/AssetEditors/VisualScriptEditor/VisualScriptBlockViewModel.cs
  49. +3 −3 ...ces/editor/Xenko.Assets.Presentation/AssetEditors/VisualScriptEditor/VisualScriptLinkViewModel.cs
  50. +3 −3 sources/editor/Xenko.Assets.Presentation/CurveEditor/ViewModels/KeyFrameCurveViewModel.cs
  51. +1 −1 sources/editor/Xenko.Assets.Presentation/NodePresenters/Commands/AddNewScriptComponentCommand.cs
  52. +1 −1 sources/editor/Xenko.Assets.Presentation/NodePresenters/Updaters/SkeletonAssetNodeUpdater.cs
  53. +3 −3 sources/editor/Xenko.Assets.Presentation/NodePresenters/Updaters/UIAssetNodeUpdater.cs
  54. +5 −5 sources/editor/Xenko.Assets.Presentation/Quantum/EntityHierarchyPropertyGraph.cs
  55. +1 −1 sources/editor/Xenko.Assets.Presentation/Quantum/EntityHierarchyPropertyGraphDefinition.cs
  56. +1 −1 sources/editor/Xenko.Assets.Presentation/Quantum/GraphicsCompositorAssetPropertyGraphDefinition.cs
  57. +3 −3 sources/editor/Xenko.Assets.Presentation/Quantum/UIAssetPropertyGraph.cs
  58. +1 −1 sources/editor/Xenko.Assets.Presentation/Templates/ModelAssetTemplateWindow.xaml.cs
  59. +2 −2 sources/editor/Xenko.Assets.Presentation/ViewModel/Commands/MoveItemCommand.cs
  60. +4 −4 ...s/editor/Xenko.Assets.Presentation/ViewModel/CopyPasteProcessors/EntityComponentPasteProcessor.cs
  61. +1 −1 sources/editor/Xenko.Assets.Presentation/ViewModel/GraphicsCompositorViewModel.cs
  62. +5 −5 sources/editor/Xenko.Assets.Presentation/ViewModel/MaterialViewModel.cs
  63. +6 −6 sources/editor/Xenko.Assets.Presentation/ViewModel/ModelComponentViewModel.cs
  64. +2 −2 sources/editor/Xenko.Assets.Presentation/ViewModel/ModelViewModel.cs
  65. +3 −3 sources/editor/Xenko.Assets.Presentation/ViewModel/SceneViewModel.cs
  66. +2 −2 sources/editor/Xenko.Assets.Presentation/ViewModel/SkeletonViewModel.cs
  67. +5 −5 sources/editor/Xenko.Assets.Presentation/ViewModel/VisualScriptMethodViewModel.cs
  68. +2 −2 sources/editor/Xenko.Assets.Presentation/ViewModel/VisualScriptViewModel.cs
  69. +1 −1 sources/editor/Xenko.Core.Assets.Editor.Tests/TestArchetypesBasicUndoRedo.cs
  70. +64 −64 sources/editor/Xenko.Core.Assets.Editor.Tests/TestCopyPasteProperties.cs
  71. +2 −2 ...itor/Xenko.Core.Assets.Editor/Components/FixAssetReferences/AssetReferenceReplacementViewModel.cs
  72. +1 −1 sources/editor/Xenko.Core.Assets.Editor/Components/FixAssetReferences/FixAssetReferencesViewModel.cs
  73. +3 −3 sources/editor/Xenko.Core.Assets.Editor/Quantum/AssetContentValueChangeOperation.cs
  74. +3 −3 sources/editor/Xenko.Core.Assets.Editor/Quantum/ContentValueChangeOperation.cs
  75. +1 −1 sources/editor/Xenko.Core.Assets.Editor/Quantum/NodePresenters/AssetItemNodePresenter.cs
  76. +1 −1 sources/editor/Xenko.Core.Assets.Editor/Quantum/NodePresenters/AssetNodePresenterFactory.cs
  77. +3 −3 sources/editor/Xenko.Core.Assets.Editor/Quantum/NodePresenters/Commands/AddPrimitiveKeyCommand.cs
  78. +2 −2 sources/editor/Xenko.Core.Assets.Editor/Quantum/NodePresenters/Commands/MoveItemCommand.cs
  79. +1 −1 sources/editor/Xenko.Core.Assets.Editor/Settings/ViewModels/SettingsCategoryViewModel.cs
  80. +1 −1 sources/editor/Xenko.Core.Assets.Editor/View/DebugTools/DebugAssetNodesUserControl.xaml
  81. +4 −4 sources/editor/Xenko.Core.Assets.Editor/View/DebugTools/DebugAssetNodesUserControl.xaml.cs
  82. +2 −2 sources/editor/Xenko.Core.Assets.Editor/ViewModel/AssetCompositeHierarchyViewModel.cs
  83. +4 −4 sources/editor/Xenko.Core.Assets.Editor/ViewModel/AssetViewModel.cs
  84. +13 −13 sources/editor/Xenko.Core.Assets.Editor/ViewModel/CopyPasteProcessors/AssetPropertyPasteProcessor.cs
  85. +1 −1 sources/editor/Xenko.Core.Assets.Editor/ViewModel/PackageViewModel.cs
  86. +5 −5 sources/editor/Xenko.Editor/EditorGame/ContentLoader/LoaderReferenceManager.cs
  87. +6 −6 sources/editor/Xenko.GameStudio.Tests/TestCopyPasteComponents.cs
  88. +1 −1 sources/editor/Xenko.GameStudio.Tests/TestCopyPasteWithEntities.cs
  89. +1 −1 sources/presentation/Xenko.Core.Presentation.Quantum.Tests/Helpers/Types.cs
  90. +8 −8 sources/presentation/Xenko.Core.Presentation.Quantum.Tests/TestNodePresenterProperties.cs
  91. +16 −16 sources/presentation/Xenko.Core.Presentation.Quantum.Tests/TestNodePresenterUpdates.cs
  92. +1 −1 sources/presentation/Xenko.Core.Presentation.Quantum/IPropertyProviderViewModel.cs
  93. +1 −1 sources/presentation/Xenko.Core.Presentation.Quantum/ObjectGraphNodeBinding.cs
  94. +3 −3 sources/presentation/Xenko.Core.Presentation.Quantum/Presenters/INodePresenter.cs
  95. +5 −5 sources/presentation/Xenko.Core.Presentation.Quantum/Presenters/ItemNodePresenter.cs
  96. +4 −4 sources/presentation/Xenko.Core.Presentation.Quantum/Presenters/MemberNodePresenter.cs
  97. +3 −3 sources/presentation/Xenko.Core.Presentation.Quantum/Presenters/NodePresenterBase.cs
  98. +2 −2 sources/presentation/Xenko.Core.Presentation.Quantum/Presenters/NodePresenterFactory.cs
  99. +4 −4 sources/presentation/Xenko.Core.Presentation.Quantum/Presenters/RootNodePresenter.cs
  100. +11 −11 sources/presentation/Xenko.Core.Presentation.Quantum/Presenters/VirtualNodePresenter.cs
  101. +1 −1 sources/presentation/Xenko.Core.Presentation.Quantum/ViewModels/NodeViewModel.cs
  102. +14 −14 sources/presentation/Xenko.Core.Quantum.Tests/TestCollections.cs
  103. +20 −20 sources/presentation/Xenko.Core.Quantum.Tests/TestDynamicNode.cs
  104. +107 −107 sources/presentation/Xenko.Core.Quantum.Tests/TestGraphNodeChangeListener.cs
  105. +15 −15 sources/presentation/Xenko.Core.Quantum.Tests/TestGraphNodeLinker.cs
  106. +10 −10 sources/presentation/Xenko.Core.Quantum.Tests/TestGraphNodePath.cs
  107. +16 −16 sources/presentation/Xenko.Core.Quantum.Tests/TestGraphVisitor.cs
  108. +8 −8 sources/presentation/Xenko.Core.Quantum.Tests/TestReferences.cs
  109. +1 −1 sources/presentation/Xenko.Core.Quantum.Tests/TestStructs.cs
  110. +5 −5 sources/presentation/Xenko.Core.Quantum/BoxedNode.cs
  111. +2 −2 sources/presentation/Xenko.Core.Quantum/DefaultNodeBuilder.cs
  112. +11 −11 sources/presentation/Xenko.Core.Quantum/DynamicNode.cs
  113. +6 −6 sources/presentation/Xenko.Core.Quantum/GraphNodeBase.cs
  114. +1 −1 sources/presentation/Xenko.Core.Quantum/GraphNodeChangeListener.cs
  115. +3 −3 sources/presentation/Xenko.Core.Quantum/GraphNodeLinker.cs
  116. +13 −13 sources/presentation/Xenko.Core.Quantum/GraphNodePath.cs
  117. +1 −1 sources/presentation/Xenko.Core.Quantum/GraphVisitorBase.cs
  118. +1 −1 sources/presentation/Xenko.Core.Quantum/IGraphNode.cs
  119. +5 −5 sources/presentation/Xenko.Core.Quantum/IObjectNode.cs
  120. +3 −3 sources/presentation/Xenko.Core.Quantum/Internal/Content.cs
  121. +2 −2 sources/presentation/Xenko.Core.Quantum/ItemChangeEventArgs.cs
  122. +3 −3 sources/presentation/Xenko.Core.Quantum/MemberNode.cs
  123. +4 −4 sources/presentation/Xenko.Core.Quantum/NodeAccessor.cs
  124. +11 −11 sources/presentation/Xenko.Core.Quantum/{Index.cs → NodeIndex.cs}
  125. +13 −13 sources/presentation/Xenko.Core.Quantum/ObjectNode.cs
  126. +7 −7 sources/presentation/Xenko.Core.Quantum/References/ObjectReference.cs
  127. +1 −1 sources/presentation/Xenko.Core.Quantum/References/Reference.cs
  128. +11 −11 sources/presentation/Xenko.Core.Quantum/References/ReferenceEnumerable.cs
@@ -8,12 +8,12 @@ namespace Xenko.Core.Assets.Quantum.Tests.Helpers
{
public static class AssetNodeInternalExtensions
{
public static OverrideType GetItemOverride(this IAssetNode node, Index index)
public static OverrideType GetItemOverride(this IAssetNode node, NodeIndex index)
{
return ((IAssetObjectNodeInternal)node).GetItemOverride(index);
}

public static OverrideType GetKeyOverride(this IAssetNode node, Index index)
public static OverrideType GetKeyOverride(this IAssetNode node, NodeIndex index)
{
return ((IAssetObjectNodeInternal)node).GetKeyOverride(index);
}
@@ -165,14 +165,14 @@ public class SomeObject2 : IMyInterface
[AssetPropertyGraphDefinition(typeof(MyAssetWithRef))]
public class AssetWithRefPropertyGraphDefinition : AssetPropertyGraphDefinition
{
public static Func<IGraphNode, Index, bool> IsObjectReferenceFunc { get; set; }
public static Func<IGraphNode, NodeIndex, bool> IsObjectReferenceFunc { get; set; }

public override bool IsMemberTargetObjectReference(IMemberNode member, object value)
{
return IsObjectReferenceFunc?.Invoke(member, Index.Empty) ?? base.IsMemberTargetObjectReference(member, value);
return IsObjectReferenceFunc?.Invoke(member, NodeIndex.Empty) ?? base.IsMemberTargetObjectReference(member, value);
}

public override bool IsTargetItemObjectReference(IObjectNode collection, Index itemIndex, object value)
public override bool IsTargetItemObjectReference(IObjectNode collection, NodeIndex itemIndex, object value)
{
return IsObjectReferenceFunc?.Invoke(collection, itemIndex) ?? base.IsTargetItemObjectReference(collection, itemIndex, value);
}
@@ -186,7 +186,7 @@ public override bool IsMemberTargetObjectReference(IMemberNode member, object va
return member.Name == nameof(MyAssetWithRef2.Reference);
}

public override bool IsTargetItemObjectReference(IObjectNode collection, Index itemIndex, object value)
public override bool IsTargetItemObjectReference(IObjectNode collection, NodeIndex itemIndex, object value)
{
return collection.Retrieve() is List<MyReferenceable>;
}
@@ -244,16 +244,16 @@ public class MyAssetHierarchy : AssetCompositeHierarchy<MyPartDesign, MyPart>
public class MyAssetHierarchyPropertyGraph : AssetCompositeHierarchyPropertyGraph<MyPartDesign, MyPart>
{
public MyAssetHierarchyPropertyGraph(AssetPropertyGraphContainer container, AssetItem assetItem, ILogger logger) : base(container, assetItem, logger) { }
public override bool IsChildPartReference(IGraphNode node, Index index) => node.Type == typeof(ChildrenList);
public override bool IsChildPartReference(IGraphNode node, NodeIndex index) => node.Type == typeof(ChildrenList);
protected override void AddChildPartToParentPart(MyPart parentPart, MyPart childPart, int index)
{
Container.NodeContainer.GetNode(parentPart)[nameof(MyPart.Children)].Target.Add(childPart, new Index(index));
Container.NodeContainer.GetNode(parentPart)[nameof(MyPart.Children)].Target.Add(childPart, new NodeIndex(index));
Container.NodeContainer.GetNode(childPart)[nameof(MyPart.Parent)].Update(parentPart);
}

protected override void RemoveChildPartFromParentPart(MyPart parentPart, MyPart childPart)
{
Container.NodeContainer.GetNode(parentPart)[nameof(MyPart.Children)].Target.Remove(childPart, new Index(parentPart.Children.IndexOf(childPart)));
Container.NodeContainer.GetNode(parentPart)[nameof(MyPart.Children)].Target.Remove(childPart, new NodeIndex(parentPart.Children.IndexOf(childPart)));
Container.NodeContainer.GetNode(childPart)[nameof(MyPart.Parent)].Update(null);
}

Large diffs are not rendered by default.

Large diffs are not rendered by default.

@@ -59,12 +59,12 @@ public void TestCollectionObjectReferenceGraph()
Assert.True(context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.NonReference)].IsReference);
Assert.Equal(obj, context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.NonReference)].Target.Retrieve());
Assert.True(context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].IsReference);
Assert.Equal(obj, context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].Target.Retrieve(new Index(0)));
Assert.Equal(context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.NonReference)].Target, context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].Target.IndexedTarget(new Index(0)));
Assert.Equal(obj, context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].Target.Retrieve(new NodeIndex(0)));
Assert.Equal(context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.NonReference)].Target, context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].Target.IndexedTarget(new NodeIndex(0)));

Assert.Equal(context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.References)], context.DerivedGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].BaseNode);
Assert.Equal(context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].Target, context.DerivedGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].Target.BaseNode);
Assert.Equal(context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.NonReference)].Target, context.DerivedGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].Target.IndexedTarget(new Index(0)).BaseNode);
Assert.Equal(context.BaseGraph.RootNode[nameof(Types.MyAssetWithRef2.NonReference)].Target, context.DerivedGraph.RootNode[nameof(Types.MyAssetWithRef2.References)].Target.IndexedTarget(new NodeIndex(0)).BaseNode);
}
}
}

0 comments on commit 5937545

Please sign in to comment.
You can’t perform that action at this time.