Some Mobile and Harvester clean-ups
Made Harvester interface implementations explicit. Made Mobile internal VisualMove activity private.
This commit is contained in:
@@ -76,9 +76,8 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public object Create(ActorInitializer init) { return new Harvester(init.Self, this); }
|
public object Create(ActorInitializer init) { return new Harvester(init.Self, this); }
|
||||||
}
|
}
|
||||||
|
|
||||||
public class Harvester : IIssueOrder, IResolveOrder, IPips,
|
public class Harvester : IIssueOrder, IResolveOrder, IPips, IExplodeModifier, IOrderVoice,
|
||||||
IExplodeModifier, IOrderVoice, ISpeedModifier, ISync, INotifyCreated,
|
ISpeedModifier, ISync, INotifyCreated, INotifyIdle, INotifyBlockingMove
|
||||||
INotifyIdle, INotifyBlockingMove
|
|
||||||
{
|
{
|
||||||
public readonly HarvesterInfo Info;
|
public readonly HarvesterInfo Info;
|
||||||
readonly Mobile mobile;
|
readonly Mobile mobile;
|
||||||
@@ -330,7 +329,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return Info.Resources.Contains(resType.Info.Type);
|
return Info.Resources.Contains(resType.Info.Type);
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<IOrderTargeter> Orders
|
IEnumerable<IOrderTargeter> IIssueOrder.Orders
|
||||||
{
|
{
|
||||||
get
|
get
|
||||||
{
|
{
|
||||||
@@ -341,7 +340,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
public Order IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued)
|
Order IIssueOrder.IssueOrder(Actor self, IOrderTargeter order, Target target, bool queued)
|
||||||
{
|
{
|
||||||
if (order.OrderID == "Deliver" || order.OrderID == "Harvest")
|
if (order.OrderID == "Deliver" || order.OrderID == "Harvest")
|
||||||
return new Order(order.OrderID, self, target, queued);
|
return new Order(order.OrderID, self, target, queued);
|
||||||
@@ -349,7 +348,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public string VoicePhraseForOrder(Actor self, Order order)
|
string IOrderVoice.VoicePhraseForOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
if (order.OrderString == "Harvest")
|
if (order.OrderString == "Harvest")
|
||||||
return Info.HarvestVoice;
|
return Info.HarvestVoice;
|
||||||
@@ -360,7 +359,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void ResolveOrder(Actor self, Order order)
|
void IResolveOrder.ResolveOrder(Actor self, Order order)
|
||||||
{
|
{
|
||||||
if (order.OrderString == "Harvest")
|
if (order.OrderString == "Harvest")
|
||||||
{
|
{
|
||||||
@@ -440,7 +439,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
return PipType.Transparent;
|
return PipType.Transparent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public IEnumerable<PipType> GetPips(Actor self)
|
IEnumerable<PipType> IPips.GetPips(Actor self)
|
||||||
{
|
{
|
||||||
var numPips = Info.PipCount;
|
var numPips = Info.PipCount;
|
||||||
|
|
||||||
|
|||||||
@@ -555,7 +555,7 @@ namespace OpenRA.Mods.Common.Traits
|
|||||||
public Activity ScriptedMove(CPos cell) { return new Move(self, cell); }
|
public Activity ScriptedMove(CPos cell) { return new Move(self, cell); }
|
||||||
public Activity MoveTo(Func<List<CPos>> pathFunc) { return new Move(self, pathFunc); }
|
public Activity MoveTo(Func<List<CPos>> pathFunc) { return new Move(self, pathFunc); }
|
||||||
|
|
||||||
public Activity VisualMove(Actor self, WPos fromPos, WPos toPos, CPos cell)
|
Activity VisualMove(Actor self, WPos fromPos, WPos toPos, CPos cell)
|
||||||
{
|
{
|
||||||
var speed = MovementSpeedForCell(self, cell);
|
var speed = MovementSpeedForCell(self, cell);
|
||||||
var length = speed > 0 ? (toPos - fromPos).Length / speed : 0;
|
var length = speed > 0 ? (toPos - fromPos).Length / speed : 0;
|
||||||
|
|||||||
Reference in New Issue
Block a user