Revamp cloak model

This commit is contained in:
Paul Chote
2010-08-15 04:53:23 +12:00
parent 499613f105
commit 7f191887ec
9 changed files with 74 additions and 34 deletions

View File

@@ -14,13 +14,23 @@ using System.Linq;
namespace OpenRA.Traits
{
public class TargetableInfo : TraitInfo<Targetable>
public class TargetableInfo : ITraitInfo
{
public readonly string[] TargetTypes = {};
public object Create( ActorInitializer init ) { return new Targetable(this); }
}
public class Targetable
public class Targetable : ITargetable
{
TargetableInfo Info;
public Targetable(TargetableInfo info)
{
Info = info;
}
public string[] TargetTypes
{
get { return Info.TargetTypes;}
}
}
}

View File

@@ -37,6 +37,7 @@ namespace OpenRA.Traits
public interface IResolveOrder { void ResolveOrder(Actor self, Order order); }
public interface IOrderCursor { string CursorForOrder(Actor self, Order order); }
public interface IOrderVoice { string VoicePhraseForOrder(Actor self, Order order); }
public interface ITargetable { string[] TargetTypes { get; } }
public interface INotifySold { void Selling( Actor self ); void Sold( Actor self ); }
public interface INotifyDamage { void Damaged(Actor self, AttackInfo e); }