1 #region Copyright & License Information
2 /*
3  * Copyright 2007-2020 The OpenRA Developers (see AUTHORS)
4  * This file is part of OpenRA, which is free software. It is made
5  * available to you under the terms of the GNU General Public License
6  * as published by the Free Software Foundation, either version 3 of
7  * the License, or (at your option) any later version. For more
8  * information, see COPYING.
9  */
10 #endregion
11 
12 using System.Collections.Generic;
13 
14 namespace OpenRA
15 {
16 	public class GameSpeed
17 	{
18 		[Translate]
19 		public readonly string Name = "Default";
20 		public readonly int Timestep = 40;
21 		public readonly int OrderLatency = 3;
22 	}
23 
24 	public class GameSpeeds : IGlobalModData
25 	{
26 		[FieldLoader.LoadUsing("LoadSpeeds")]
27 		public readonly Dictionary<string, GameSpeed> Speeds;
28 
LoadSpeeds(MiniYaml y)29 		static object LoadSpeeds(MiniYaml y)
30 		{
31 			var ret = new Dictionary<string, GameSpeed>();
32 			foreach (var node in y.Nodes)
33 				ret.Add(node.Key, FieldLoader.Load<GameSpeed>(node.Value));
34 
35 			return ret;
36 		}
37 	}
38 }
39