generic info loader, projectiles
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user