Refactor Traits.fake into a Tags interface for primary production structures +mods
This commit is contained in:
@@ -1,14 +1,16 @@
|
||||
using System;
|
||||
using System.Collections.Generic;
|
||||
using System.Linq;
|
||||
using System.Text;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class Fake
|
||||
class Fake : ITags
|
||||
{
|
||||
|
||||
public Fake(Actor self){}
|
||||
|
||||
public Fake(Actor self){}
|
||||
|
||||
public IEnumerable<TagType> GetTags()
|
||||
{
|
||||
yield return TagType.Fake;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -1,9 +1,10 @@
|
||||
using OpenRa.Game.GameRules;
|
||||
using System.Linq;
|
||||
using System.Collections.Generic;
|
||||
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
class Production : IProducer
|
||||
class Production : IProducer, ITags
|
||||
{
|
||||
public Production( Actor self ) { }
|
||||
|
||||
@@ -50,6 +51,11 @@ namespace OpenRa.Game.Traits
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
public IEnumerable<TagType> GetTags()
|
||||
{
|
||||
yield return (true) ? TagType.Primary : TagType.None;
|
||||
}
|
||||
}
|
||||
|
||||
class ProductionSurround : Production
|
||||
|
||||
@@ -6,7 +6,10 @@ using System.Drawing;
|
||||
namespace OpenRa.Game.Traits
|
||||
{
|
||||
enum DamageState { Normal, Half, Dead };
|
||||
|
||||
// depends on the order of pips in WorldRenderer.cs!
|
||||
enum PipType { Transparent, Green, Yellow, Red, Gray };
|
||||
enum TagType { None, Fake, Primary };
|
||||
|
||||
interface ITick { void Tick(Actor self); }
|
||||
interface IRender { IEnumerable<Tuple<Sprite, float2, int>> Render(Actor self); }
|
||||
@@ -25,4 +28,5 @@ namespace OpenRa.Game.Traits
|
||||
interface IDamageModifier { float GetDamageModifier(); }
|
||||
interface ISpeedModifier { float GetSpeedModifier(); }
|
||||
interface IPips { IEnumerable<PipType> GetPips(); }
|
||||
interface ITags { IEnumerable<TagType> GetTags(); }
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user