Kill Unit trait; Radar signature tweaks
This commit is contained in:
@@ -38,7 +38,7 @@ namespace OpenRA.Traits
|
||||
public object Create(ActorInitializer init) { return new Building(init); }
|
||||
}
|
||||
|
||||
public class Building : INotifyDamage, IResolveOrder, IRenderModifier, IOccupySpace, IRadarSignature
|
||||
public class Building : INotifyDamage, IResolveOrder, IRenderModifier, IOccupySpace
|
||||
{
|
||||
readonly Actor self;
|
||||
public readonly BuildingInfo Info;
|
||||
@@ -113,19 +113,5 @@ namespace OpenRA.Traits
|
||||
{
|
||||
return Footprint.UnpathableTiles( self.Info.Name, Info, TopLeft );
|
||||
}
|
||||
|
||||
public IEnumerable<int2> RadarSignatureCells(Actor self)
|
||||
{
|
||||
return Footprint.Tiles(self);
|
||||
}
|
||||
|
||||
public Color RadarSignatureColor(Actor self)
|
||||
{
|
||||
var mod = self.traits.WithInterface<IRadarColorModifier>().FirstOrDefault();
|
||||
if (mod != null)
|
||||
return mod.RadarColorOverride(self);
|
||||
|
||||
return self.Owner.Color;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
@@ -17,7 +17,7 @@ using OpenRA.Traits.Activities;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
public class MobileInfo : ITraitInfo, ITraitPrerequisite<UnitInfo>
|
||||
public class MobileInfo : ITraitInfo
|
||||
{
|
||||
public readonly string[] TerrainTypes;
|
||||
public readonly float[] TerrainSpeeds;
|
||||
|
||||
@@ -1,38 +0,0 @@
|
||||
#region Copyright & License Information
|
||||
/*
|
||||
* Copyright 2007-2010 The OpenRA Developers (see AUTHORS)
|
||||
* This file is part of OpenRA, which is free software. It is made
|
||||
* available to you under the terms of the GNU General Public License
|
||||
* as published by the Free Software Foundation. For more information,
|
||||
* see LICENSE.
|
||||
*/
|
||||
#endregion
|
||||
|
||||
using System.Collections.Generic;
|
||||
using System.Drawing;
|
||||
using System.Linq;
|
||||
|
||||
namespace OpenRA.Traits
|
||||
{
|
||||
public class UnitInfo : ITraitInfo
|
||||
{
|
||||
public object Create( ActorInitializer init ) { return new Unit(); }
|
||||
}
|
||||
|
||||
public class Unit : IRadarSignature
|
||||
{
|
||||
public IEnumerable<int2> RadarSignatureCells(Actor self)
|
||||
{
|
||||
yield return self.Location;
|
||||
}
|
||||
|
||||
public Color RadarSignatureColor(Actor self)
|
||||
{
|
||||
var mod = self.traits.WithInterface<IRadarColorModifier>().FirstOrDefault();
|
||||
if (mod != null)
|
||||
return mod.RadarColorOverride(self);
|
||||
|
||||
return self.Owner.Color;
|
||||
}
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user