Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
IReference.cs
Go to the documentation of this file.
1 // Copyright (c) 2014 Silicon Studio Corp. (http://siliconstudio.co.jp)
2 // This file is distributed under GPL v3. See LICENSE.md for details.
3 using System;
4 
5 namespace SiliconStudio.Quantum.References
6 {
7  public interface IReference : IEquatable<IReference>
8  {
9  /// <summary>
10  /// Gets the data object targeted by this reference, if available.
11  /// </summary>
12  object ObjectValue { get; }
13 
14  /// <summary>
15  /// Gets the type of object targeted by this reference, if available.
16  /// </summary>
17  Type Type { get; }
18 
19  /// <summary>
20  /// Gets the index of this reference in its parent collection. If the reference is not in a collection, this will return <see cref="Reference.NotInCollection"/>.
21  /// </summary>
22  object Index { get; }
23 
24  /// <summary>
25  /// Clear the reference, making it represent a null or empty object.
26  /// </summary>
27  void Clear();
28 
29  /// <summary>
30  /// Refresh this reference and its nested references.
31  /// </summary>
32  void Refresh(object newObjectValue);
33 
34  /// <summary>
35  /// Updates the target node of this reference or its nested references from a <see cref="ModelContainer"/>.
36  /// </summary>
37  /// <param name="modelContainer">A <see cref="ModelContainer"/> in which the corresponding model node may have been registered.</param>
38  /// <returns><c>true</c> if the model node was found in the <see cref="ModelContainer"/> and the target nodes has been updated, <c>false</c> otherwise.</returns>
39  bool UpdateTarget(ModelContainer modelContainer);
40  }
41 }
A container used to store models and resolve references between them.