Paradox Game Engine  v1.0.0 beta06
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Properties Events Macros Pages
IGame.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 using SiliconStudio.Core;
6 using SiliconStudio.Paradox.Games.Time;
7 using SiliconStudio.Paradox.Graphics;
8 using SiliconStudio.Core.Serialization.Assets;
9 
10 namespace SiliconStudio.Paradox.Games
11 {
12  public interface IGame
13  {
14  /// <summary>
15  /// Occurs when [activated].
16  /// </summary>
17  event EventHandler<EventArgs> Activated;
18 
19  /// <summary>
20  /// Occurs when [deactivated].
21  /// </summary>
22  event EventHandler<EventArgs> Deactivated;
23 
24  /// <summary>
25  /// Occurs when [exiting].
26  /// </summary>
27  event EventHandler<EventArgs> Exiting;
28 
29  /// <summary>
30  /// Occurs when [window created].
31  /// </summary>
32  event EventHandler<EventArgs> WindowCreated;
33 
34  /// <summary>
35  /// Gets the current game time.
36  /// </summary>
37  /// <value>The current game time.</value>
38  GameTime UpdateTime { get; }
39 
40  /// <summary>
41  /// Gets the current draw time.
42  /// </summary>
43  /// <value>The current draw time.</value>
44  GameTime DrawTime { get; }
45 
46  /// <summary>
47  /// Gets the draw interpolation factor, which is (<see cref="UpdateTime"/> - <see cref="DrawTime"/>) / <see cref="TargetElapsedTime"/>.
48  /// If <see cref="IsFixedTimeStep"/> is false, it will be 0 as <see cref="UpdateTime"/> and <see cref="DrawTime"/> will be equal.
49  /// </summary>
50  /// <value>
51  /// The draw interpolation factor.
52  /// </value>
53  float DrawInterpolationFactor { get; }
54 
55  /// <summary>
56  /// Gets the play time, can be changed to match to the time of the current rendering scene.
57  /// </summary>
58  /// <value>The play time.</value>
59  TimerTick PlayTime { get; }
60 
61  /// <summary>
62  /// Gets or sets the <see cref="AssetManager"/>.
63  /// </summary>
64  /// <value>The content manager.</value>
65  AssetManager Asset { get; }
66 
67  /// <summary>
68  /// Gets the game components registered by this game.
69  /// </summary>
70  /// <value>The game components.</value>
71  GameSystemCollection GameSystems { get; }
72 
73  /// <summary>
74  /// Gets the game context.
75  /// </summary>
76  /// <value>The game context.</value>
77  GameContext Context { get; }
78 
79  /// <summary>
80  /// Gets the graphics device.
81  /// </summary>
82  /// <value>The graphics device.</value>
84 
85  /// <summary>
86  /// Gets or sets the inactive sleep time.
87  /// </summary>
88  /// <value>The inactive sleep time.</value>
89  TimeSpan InactiveSleepTime { get; set; }
90 
91  /// <summary>
92  /// Gets a value indicating whether this instance is active.
93  /// </summary>
94  /// <value><c>true</c> if this instance is active; otherwise, <c>false</c>.</value>
95  bool IsActive { get; }
96 
97  /// <summary>
98  /// Gets or sets a value indicating whether this instance is fixed time step.
99  /// </summary>
100  /// <value><c>true</c> if this instance is fixed time step; otherwise, <c>false</c>.</value>
101  bool IsFixedTimeStep { get; set; }
102 
103  /// <summary>
104  /// Gets or sets a value indicating whether draw can happen as fast as possible, even when <see cref="IsFixedTimeStep"/> is set.
105  /// </summary>
106  /// <value><c>true</c> if this instance allows desychronized drawing; otherwise, <c>false</c>.</value>
107  bool IsDrawDesynchronized { get; set; }
108 
109  /// <summary>
110  /// Gets or sets a value indicating whether the mouse should be visible.
111  /// </summary>
112  /// <value><c>true</c> if the mouse should be visible; otherwise, <c>false</c>.</value>
113  bool IsMouseVisible { get; set; }
114 
115  /// <summary>
116  /// Gets the launch parameters.
117  /// </summary>
118  /// <value>The launch parameters.</value>
120 
121  /// <summary>
122  /// Gets a value indicating whether is running.
123  /// </summary>
124  bool IsRunning { get; }
125 
126  /// <summary>
127  /// Gets the service container.
128  /// </summary>
129  /// <value>The service container.</value>
130  ServiceRegistry Services { get; }
131 
132  /// <summary>
133  /// Gets or sets the target elapsed time.
134  /// </summary>
135  /// <value>The target elapsed time.</value>
136  TimeSpan TargetElapsedTime { get; set; }
137 
138  /// <summary>
139  /// Gets the abstract window.
140  /// </summary>
141  /// <value>The window.</value>
143 
144  /// <summary>
145  /// Gets or sets the state.
146  /// </summary>
147  /// <value>The state.</value>
148  GameState State { get; set; }
149  }
150 }
EventHandler< EventArgs > WindowCreated
Occurs when [window created].
Definition: IGame.cs:32
This provides timing information similar to System.Diagnostics.Stopwatch but an update occuring only ...
Definition: TimerTick.cs:31
EventHandler< EventArgs > Exiting
Occurs when [exiting].
Definition: IGame.cs:27
Performs primitive-based rendering, creates resources, handles system-level variables, adjusts gamma ramp levels, and creates shaders. See The+GraphicsDevice+class to learn more about the class.
Current timing used for variable-step (real time) or fixed-step (game time) games.
Definition: GameTime.cs:31
EventHandler< EventArgs > Activated
Occurs when [activated].
Definition: IGame.cs:17
Contains context used to render the game (Control for WinForm, a DrawingSurface for WP8...
Definition: GameContext.cs:31
Parameters used when launching an application.
Base implementation for IServiceRegistry
EventHandler< EventArgs > Deactivated
Occurs when [deactivated].
Definition: IGame.cs:22