コード例 #1
0
ファイル: ComponentArgument.cs プロジェクト: Octanum/Corvus
 // TODO: IMPORTANT: Make this be able to parse itself, so we can adjust instances within tiled by setting object properties.
 // Example: Name: PathComponent.Nodes Value: Collection(Vector2(50, 50), Vector2(100, 50))
 /// <summary>
 /// Returns a ComponentArgument that returns the results of the specified arguments transformed by the specified ValueGenerator.
 /// </summary>
 public ComponentArgument(PropertyValueGenerator ValueGenerator, IEnumerable<ComponentArgument> Arguments)
 {
     this._ValueGenerator = ValueGenerator;
     this._Arguments = Arguments.Select(c => (object)c).ToArray();
 }
コード例 #2
0
ファイル: ComponentArgument.cs プロジェクト: Octanum/Corvus
 /// <summary>
 /// Creates a ComponentArgument that simply returns the specified argument without being transformed.
 /// </summary>
 public ComponentArgument(object Argument)
 {
     this._ValueGenerator = null;
     this._Arguments = new object[] { Argument };
 }
コード例 #3
0
ファイル: ComponentArgument.cs プロジェクト: Octanum/Corvus
 private object[] GetArguments(object Instance, PropertyInfo Property)
 {
     if(_ValueGenerator == null)
         _ValueGenerator = PropertyValueGenerator.GetGenerator("Identity");
     if(_ValueGenerator is IdentityValueGenerator)
         return _Arguments;
     else
         return _Arguments.Select(c => ((ComponentArgument)c).GetValue(Instance, Property)).ToArray();
 }