added BuildableInfo
This commit is contained in:
@@ -21,6 +21,8 @@ namespace OpenRa.Game.GameRules
|
||||
foreach (var x in my.Nodes)
|
||||
{
|
||||
var field = self.GetType().GetField(x.Key.Trim());
|
||||
if (field == null)
|
||||
throw new NotImplementedException("Missing field `{0}` on `{1}`".F(x.Key.Trim(), self.GetType().Name));
|
||||
field.SetValue(self, GetValue(field.FieldType, x.Value.Value.Trim()));
|
||||
}
|
||||
}
|
||||
|
||||
@@ -5,6 +5,18 @@ using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class BuildableInfo : ITraitInfo
|
||||
{
|
||||
public readonly int TechLevel = -1;
|
||||
public readonly string Tab = null;
|
||||
public readonly string[] Prerequisites = { };
|
||||
public readonly Race[] Owner = { };
|
||||
public readonly int Cost = 0;
|
||||
public readonly string Description = "";
|
||||
public readonly string LongDesc = "";
|
||||
public object Create(Actor self) { return new Buildable(self); }
|
||||
}
|
||||
|
||||
class Buildable
|
||||
{
|
||||
public Buildable( Actor self ) { }
|
||||
|
||||
@@ -7,9 +7,9 @@ namespace OpenRa.Game.Traits
|
||||
{
|
||||
class MobileInfo : ITraitInfo
|
||||
{
|
||||
public readonly int Sight;
|
||||
public readonly int ROT;
|
||||
public readonly int Speed;
|
||||
public readonly int Sight = 0;
|
||||
public readonly int ROT = 0;
|
||||
public readonly int Speed = 0;
|
||||
public object Create(Actor self) { return new Mobile(self); }
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user