generic info loader, projectiles

This commit is contained in:
Chris Forbes
2009-10-14 18:55:34 +13:00
parent 6432ba8779
commit 60a24a5415
9 changed files with 119 additions and 123 deletions

View File

@@ -7,29 +7,6 @@ using OpenRa.Game.Graphics;
namespace OpenRa.Game.GameRules
{
class WarheadInfoLoader
{
readonly Dictionary<string, WarheadInfo> warheadInfos = new Dictionary<string, WarheadInfo>();
public WarheadInfoLoader(IniFile rules)
{
foreach (var s in Util.ReadAllLines(FileSystem.Open("warheads.txt")))
{
var unitName = s.Split(',')[0];
warheadInfos.Add(unitName.ToLowerInvariant(),
new WarheadInfo(rules.GetSection(unitName)));
}
}
public WarheadInfo this[string unitName]
{
get
{
return warheadInfos[unitName.ToLowerInvariant()];
}
}
}
class WarheadInfo
{
public readonly int Spread = 1;
@@ -39,10 +16,5 @@ namespace OpenRa.Game.GameRules
public readonly bool Ore = false;
public readonly int Explosion = 0;
public readonly int InfDeath = 0;
public WarheadInfo(IniSection ini)
{
FieldLoader.Load(this, ini);
}
}
}