Added IDisabledTrait & rewrote upgrade code using a level-based approach.
Upgradeable traits are notified whenever an upgrade of their declared types are granted or revoked. The traits maintain their own internal level counter, which is then used to enable or disable the trait functionality. A trait can register for multiple upgrade types which then all affect the internal level counter. IDisabledTrait for identifying (and filtering) disabled traits UpgradableTrait provides an abstract base for traits to support upgrade levels Added IDisabledTrait support to GlobalButtonOrderGenerator Includes rework by pchote with alterations.
This commit is contained in:
@@ -104,12 +104,6 @@ namespace OpenRA.Traits
|
||||
public interface INotifyInfiltrated { void Infiltrated(Actor self, Actor infiltrator); }
|
||||
public interface IDisableMove { bool MoveDisabled(Actor self); }
|
||||
|
||||
public interface IUpgradable
|
||||
{
|
||||
bool AcceptsUpgrade(string type);
|
||||
void UpgradeAvailable(Actor self, string type, bool available);
|
||||
}
|
||||
|
||||
public interface ISeedableResource { void Seed(Actor self); }
|
||||
|
||||
public interface IDemolishableInfo { bool IsValidTarget(ActorInfo actorInfo, Actor saboteur); }
|
||||
@@ -140,6 +134,7 @@ namespace OpenRA.Traits
|
||||
bool IsOwnerRowVisible { get; }
|
||||
}
|
||||
|
||||
public interface IDisabledTrait { bool IsTraitDisabled { get; } }
|
||||
public interface IDisable { bool Disabled { get; } }
|
||||
public interface IExplodeModifier { bool ShouldExplode(Actor self); }
|
||||
public interface IHuskModifier { string HuskActor(Actor self); }
|
||||
|
||||
Reference in New Issue
Block a user