Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
OverrideType.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.Core.Reflection
6 {
7  /// <summary>
8  /// A Type of override used on a member value.
9  /// </summary>
10  [Flags]
11  public enum OverrideType
12  {
13  /// <summary>
14  /// The value is taken from a base value or this instance if no base (default).
15  /// </summary>
16  Base,
17 
18  /// <summary>
19  /// The value is new and overriden locally. Base value is ignored.
20  /// </summary>
21  New = 1,
22 
23  /// <summary>
24  /// The value is sealed and cannot be changed by
25  /// </summary>
26  Sealed = 2,
27  }
28 
29  /// <summary>
30  /// Extensions for <see cref="OverrideType"/>.
31  /// </summary>
32  public static class OverrideTypeExtensions
33  {
34  /// <summary>
35  /// Determines whether the specified type is sealed.
36  /// </summary>
37  /// <param name="type">The type.</param>
38  /// <returns><c>true</c> if the specified type is sealed; otherwise, <c>false</c>.</returns>
39  public static bool IsSealed(this OverrideType type)
40  {
41  return (type & OverrideType.Sealed) != 0;
42  }
43 
44  /// <summary>
45  /// Determines whether the specified type is base.
46  /// </summary>
47  /// <param name="type">The type.</param>
48  /// <returns><c>true</c> if the specified type is base; otherwise, <c>false</c>.</returns>
49  public static bool IsBase(this OverrideType type)
50  {
51  return (type & OverrideType.Base) != 0;
52  }
53 
54  /// <summary>
55  /// Determines whether the specified type is new.
56  /// </summary>
57  /// <param name="type">The type.</param>
58  /// <returns><c>true</c> if the specified type is new; otherwise, <c>false</c>.</returns>
59  public static bool IsNew(this OverrideType type)
60  {
61  return (type & OverrideType.New) != 0;
62  }
63  }
64 }
static bool IsNew(this OverrideType type)
Determines whether the specified type is new.
Definition: OverrideType.cs:59
The value is taken from a base value or this instance if no base (default).
static bool IsBase(this OverrideType type)
Determines whether the specified type is base.
Definition: OverrideType.cs:49
Flags
Enumeration of the new Assimp's flags.
The value is sealed and cannot be changed by
OverrideType
A Type of override used on a member value.
Definition: OverrideType.cs:11
static bool IsSealed(this OverrideType type)
Determines whether the specified type is sealed.
Definition: OverrideType.cs:39