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