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

@@ -6,29 +6,6 @@ using OpenRa.Game.Graphics;
namespace OpenRa.Game.GameRules
{
class WeaponInfoLoader
{
readonly Dictionary<string, WeaponInfo> weaponInfos = new Dictionary<string, WeaponInfo>();
public WeaponInfoLoader( IniFile rules )
{
foreach( var s in Util.ReadAllLines( FileSystem.Open( "weapons.txt" ) ) )
{
var unitName = s.Split( ',' )[ 0 ];
weaponInfos.Add( unitName.ToLowerInvariant(),
new WeaponInfo( rules.GetSection( unitName ) ) );
}
}
public WeaponInfo this[ string unitName ]
{
get
{
return weaponInfos[ unitName.ToLowerInvariant() ];
}
}
}
class WeaponInfo
{
public readonly string Anim = null;
@@ -44,10 +21,5 @@ namespace OpenRa.Game.GameRules
public readonly bool Supress = false;
public readonly bool TurboBoost = false;
public readonly string Warhead = null;
public WeaponInfo( IniSection ini )
{
FieldLoader.Load( this, ini );
}
}
}