Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
ITimedValue.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 using System.Collections.Generic;
5 using System.Linq;
6 using System.Text;
7 
8 namespace SiliconStudio.Paradox.Games.Time
9 {
10  public interface ITimedValue<out T>
11  {
12  double Time { get; }
13  T Value { get; }
14  }
15 
16  public class ReadOnlyTimedValue<T> : ITimedValue<T>
17  {
18  public ReadOnlyTimedValue(double time, T value)
19  {
20  Time = time;
21  Value = value;
22  }
23 
24  public ReadOnlyTimedValue(ITimedValue<T> timedValue)
25  {
26  Time = timedValue.Time;
27  Value = timedValue.Value;
28  }
29 
30  public double Time { get; private set; }
31  public T Value { get; private set; }
32  }
33 
34  public class TimedValue<T> : ITimedValue<T>
35  {
36  public TimedValue(double time, T value)
37  {
38  Time = time;
39  Value = value;
40  }
41 
42  public double Time { get; set; }
43  public T Value { get; set; }
44  }
45 }