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