我有一个创建如下的列表。它使用第三方包装器来管理从电脑游戏下载 xml 信息:-
List<EveAI.Live.Asset> lst_eveai_characterabc_assets = eve_api.GetCharacterAssets();
Asset 的类定义是:-
namespace EveAI.Live
{
[TypeConverter(typeof(ExpandableObjectConverter))]
public class Asset
{
public Asset();
public ContainerType Container { get; set; }
public List<Asset> Contents { get; set; }
public double ContentsVolume { get; }
public bool IsSingleton { get; set; }
public long ItemID { get; set; }
[Obsolete("Will be removed in a future version, use LocationStation or
LocationSolarsystem or LocationConquerableStation instead")]
public Station Location { get; set; }
public ConquerableStation LocationConquerableStation { get; set; }
public int LocationID { get; set; }
public SolarSystem LocationSolarsystem { get; set; }
public Station LocationStation { get; set; }
public long Quantity { get; set; }
public int RawQuantity { get; set; }
public ProductType Type { get; set; }
public int TypeID { get; set; }
public override string ToString();
}
}
我想将列表 lst_eveai_characterabc_assets 复制到使用类 AssetUniverseIDs 的新列表 - 继承类 EveAI.Live.Asset 类似:-
public class AssetUniverseIDs : EveAI.Live.Asset
{
public Int32 stationID {get;set;}
public Int32 stationTypeID { get; set; }
public Int32 corporationID { get; set; }
public Int32 solarSystemID { get; set; }
public string solarSystemName { get; set; }
public double security { get; set; }
public string securityClass { get; set; }
public Int32 constellationID { get; set; }
public Int32 regionID { get; set; }
public string regionName { get; set; }
public string stationName { get; set; }
}
但到目前为止,我无法将 lst_eveai_characterabc_assets 复制到使用继承类 Assets 的类 AssetUniverseIDs 的新列表中。请问我怎么能做到这一点。