added Name to Sequence
This commit is contained in:
@@ -13,7 +13,6 @@ namespace OpenRa.Game.Graphics
|
||||
public Animation( string name )
|
||||
{
|
||||
this.name = name.ToLowerInvariant();
|
||||
// Play( "idle" );
|
||||
}
|
||||
|
||||
public Sprite Image
|
||||
|
||||
@@ -7,6 +7,7 @@ namespace OpenRa.Game.Graphics
|
||||
{
|
||||
readonly int start, length;
|
||||
|
||||
public readonly string Name;
|
||||
public int Start { get { return start; } }
|
||||
public int End { get { return start + length; } }
|
||||
public int Length { get { return length; } }
|
||||
@@ -14,6 +15,7 @@ namespace OpenRa.Game.Graphics
|
||||
public Sequence(string unit, XmlElement e)
|
||||
{
|
||||
string srcOverride = e.GetAttribute("src");
|
||||
Name = e.GetAttribute("name");
|
||||
|
||||
Range<int> src = UnitSheetBuilder.GetUnit(
|
||||
string.IsNullOrEmpty(srcOverride) ? unit : srcOverride);
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
using System.Collections.Generic;
|
||||
using System.Xml;
|
||||
using System.Linq;
|
||||
using OpenRa.FileFormats;
|
||||
|
||||
namespace OpenRa.Game.Graphics
|
||||
@@ -38,11 +39,11 @@ namespace OpenRa.Game.Graphics
|
||||
static void LoadSequencesForUnit(XmlElement eUnit)
|
||||
{
|
||||
string unitName = eUnit.GetAttribute("name");
|
||||
Dictionary<string, Sequence> sequences = new Dictionary<string, Sequence>();
|
||||
|
||||
foreach (XmlElement eSequence in eUnit.SelectNodes("./sequence"))
|
||||
sequences.Add(eSequence.GetAttribute("name"), new Sequence(unitName, eSequence));
|
||||
|
||||
|
||||
var sequences = eUnit.SelectNodes("./sequence").OfType<XmlElement>()
|
||||
.Select(e => new Sequence(unitName, e))
|
||||
.ToDictionary(s => s.Name);
|
||||
|
||||
units.Add(unitName, sequences);
|
||||
}
|
||||
|
||||
|
||||
@@ -22,10 +22,6 @@ namespace OpenRa.Game.Traits.Activities
|
||||
return;
|
||||
}
|
||||
|
||||
/* nothing to do here, either:
|
||||
* - return to base, if full, or
|
||||
* - seek out new ore, schedule a move there, and then this activity */
|
||||
|
||||
if (harv.IsFull)
|
||||
PlanReturnToBase(self, mobile);
|
||||
else
|
||||
|
||||
Reference in New Issue
Block a user