Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
VirtualButtonConfigSet.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.Collections.ObjectModel;
4 
5 namespace SiliconStudio.Paradox.Input
6 {
7  /// <summary>
8  /// A collection of <see cref="VirtualButtonConfig"/>.
9  /// </summary>
10  /// <remarks>
11  /// Several virtual button configurations can be stored in this instance.
12  /// For example, User0 config could be stored on index 0, User1 on index 1...etc.
13  /// </remarks>
14  public class VirtualButtonConfigSet : Collection<VirtualButtonConfig>
15  {
16  /// <summary>
17  /// Initializes a new instance of the <see cref="VirtualButtonConfigSet" /> class.
18  /// </summary>
20  {
21  }
22 
23  public virtual float GetValue(InputManager inputManager, int configIndex, object name)
24  {
25  if (configIndex < 0 || configIndex >= Count)
26  {
27  return 0.0f;
28  }
29 
30  var config = this[configIndex];
31  return config != null ? config.GetValue(inputManager, name) : 0.0f;
32  }
33  }
34 }
virtual float GetValue(InputManager inputManager, int configIndex, object name)
VirtualButtonConfigSet()
Initializes a new instance of the VirtualButtonConfigSet class.