本文整理汇总了C#中PyObject.Attribute方法的典型用法代码示例。如果您正苦于以下问题:C# PyObject.Attribute方法的具体用法?C# PyObject.Attribute怎么用?C# PyObject.Attribute使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类PyObject
的用法示例。
在下文中一共展示了PyObject.Attribute方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: DirectSystemScanResult
internal DirectSystemScanResult(DirectEve directEve, PyObject pyResult)
: base(directEve)
{
PyResult = pyResult;
Id = (string) pyResult.Attribute("id");
ScanGroupName = (string) pyResult.Attribute("scanGroupName").ToUnicodeString();
GroupName = (string) pyResult.Attribute("groupName").ToUnicodeString();
TypeName = (string) pyResult.Attribute("typeName").ToUnicodeString();
SignalStrength = (double) pyResult.Attribute("certainty");
Deviation = (double) pyResult.Attribute("deviation");
IsPointResult = (string) PyResult.Attribute("data").Attribute("__class__").Attribute("__name__") == "Vector3";
IsSpereResult = (string) PyResult.Attribute("data").Attribute("__class__").Attribute("__name__") == "float";
IsCircleResult = (!IsPointResult && !IsSpereResult);
if (IsPointResult)
{
X = (double?) pyResult.Attribute("data").Attribute("x");
Y = (double?) pyResult.Attribute("data").Attribute("y");
Z = (double?) pyResult.Attribute("data").Attribute("z");
}
else if (IsCircleResult)
{
X = (double?) pyResult.Attribute("data").Attribute("point").Attribute("x");
Y = (double?) pyResult.Attribute("data").Attribute("point").Attribute("y");
Z = (double?) pyResult.Attribute("data").Attribute("point").Attribute("z");
}
// If SphereResult: X,Y,Z is probe location
if (X.HasValue && Y.HasValue && Z.HasValue)
{
var myship = directEve.ActiveShip.Entity;
Distance = Math.Sqrt((X.Value - myship.X)*(X.Value - myship.X) + (Y.Value - myship.Y)*(Y.Value - myship.Y) + (Z.Value - myship.Z)*(Z.Value - myship.Z));
}
}
示例2: DirectMarketActionWindow
internal DirectMarketActionWindow(DirectEve directEve, PyObject pyWindow)
: base(directEve, pyWindow)
{
IsReady = (bool) pyWindow.Attribute("ready");
IsBuyAction = Name == "marketbuyaction";
IsSellAction = Name == "marketsellaction";
Item = new DirectItem(directEve);
Item.PyItem = pyWindow.Attribute("sr").Attribute("sellItem");
var order = pyWindow.Attribute("sr").Attribute("currentOrder");
Price = (double?) order.Attribute("price");
RemainingVolume = (double?) order.Attribute("volRemaining");
Range = (int?) order.Attribute("range");
OrderId = (long?) order.Attribute("orderID");
EnteredVolume = (int?) order.Attribute("volEntered");
MinimumVolume = (int?) order.Attribute("minVolume");
IsBid = (bool?) order.Attribute("bid");
Issued = (DateTime?) order.Attribute("issued");
Duration = (int?) order.Attribute("duration");
StationId = (long?) order.Attribute("stationID");
RegionId = (long?) order.Attribute("regionID");
SolarSystemId = (long?) order.Attribute("solarSystemID");
Jumps = (int?) order.Attribute("jumps");
}
示例3: DirectBookmarkFolder
internal DirectBookmarkFolder(DirectEve directEve, PyObject pyFolder)
: base(directEve)
{
Id = (long) pyFolder.Attribute("folderID");
Name = (string) pyFolder.Attribute("folderName");
OwnerId = (long) pyFolder.Attribute("ownerID");
CreatorId = (long?) pyFolder.Attribute("creatorID");
}
示例4: DirectConstellation
internal DirectConstellation(DirectEve directEve, PyObject pyo)
: base(directEve)
{
Id = (long) pyo.Attribute("constellationID");
Name = (string) DirectEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("evelocations").Call("Get", Id).Attribute("name");
RegionId = (long) pyo.Attribute("regionID");
FactionId = (long?) pyo.Attribute("factionID");
}
示例5: DirectSolarSystem
internal DirectSolarSystem(DirectEve directEve, PyObject pyo)
: base(directEve)
{
Id = (int) pyo.Attribute("solarSystemID");
Name = (string) DirectEve.PySharp.Import("__builtin__").Attribute("cfg").Attribute("evelocations").Call("Get", Id).Attribute("name");
ConstellationId = (long) pyo.Attribute("constellationID");
FactionId = (long?) pyo.Attribute("factionID");
Security = (double) pyo.Attribute("securityStatus");
IsWormholeSystem = ((long) directEve.Const.MapWormholeSystemMin < Id && Id < (long) directEve.Const.MapWormholeSystemMax);
}
示例6: DirectContainer
internal DirectContainer(DirectEve directEve, PyObject pyInventory, PyObject pyFlag)
: base(directEve)
{
_pyInventory = pyInventory;
_pyFlag = pyFlag;
TypeId = (int) pyInventory.Attribute("typeID");
if (!pyInventory.Attribute("listed").IsValid || pyInventory.Attribute("listed").IsNull || pyInventory.Attribute("listed").IsNone)
DirectItem.RefreshItems(directEve, pyInventory, pyFlag);
}
示例7: DirectContainerWindow
//private DirectEve DirectEve;
internal DirectContainerWindow(DirectEve directEve, PyObject pyWindow)
: base(directEve, pyWindow)
{
//IsReady = (bool) pyWindow.Attribute("startedUp");
IsOneWay = (bool) pyWindow.Attribute("oneWay");
ItemId = (long) pyWindow.Attribute("itemID");
LocationFlag = (int) pyWindow.Attribute("locationFlag");
HasCapacity = (bool) pyWindow.Attribute("hasCapacity");
currInvIdName = (string) PyWindow.Attribute("currInvID").ToList().First();
currInvIdItem = (long) PyWindow.Attribute("currInvID").ToList().Last();
}
示例8: DirectReprocessingQuote
internal DirectReprocessingQuote(DirectEve directEve, long itemId, PyObject quote)
: base(directEve)
{
ItemId = itemId;
QuantityToProcess = (long) quote.Attribute("quantityToProcess");
LeftOvers = (long) quote.Attribute("leftOvers");
PlayerStanding = (float) quote.Attribute("olayerStanding");
Recoverables = new List<DirectReprocessingQuoteRecoverable>();
foreach (var recoverable in quote.Attribute("recoverables").Attribute("lines").ToList())
Recoverables.Add(new DirectReprocessingQuoteRecoverable(DirectEve, recoverable));
}
示例9: DirectScannerWindow
internal DirectScannerWindow(DirectEve directEve, PyObject pyWindow)
: base(directEve, pyWindow)
{
var charId = DirectEve.Session.CharacterId;
var obj = PyWindow.Attribute("busy");
var analyseBtnEnabled = (bool)pyWindow.Attribute("sr").Attribute("analyzeBtn").Attribute("enabled");
//Log("obj type = " + obj.GetPyType().ToString());
//Log("obj value = " + ((bool) obj).ToString());
IsReady = charId != null && obj.IsValid && (bool)obj == false && analyseBtnEnabled;
}
示例10: DirectFitting
internal DirectFitting(DirectEve directEve, long ownerId, int fittingId, PyObject pyFitting)
: base(directEve)
{
_pyFitting = pyFitting;
OwnerId = ownerId;
FittingId = fittingId;
Name = (string) pyFitting.Attribute("name");
ShipTypeId = (int) pyFitting.Attribute("shipTypeID");
Modules = new List<DirectItem>();
foreach (var module in pyFitting.Attribute("fitData").ToList())
{
var item = new DirectItem(directEve);
item.TypeId = (int) module.Item(0);
item.FlagId = (int) module.Item(1);
item.Quantity = (int) module.Item(2);
item.OwnerId = (int) OwnerId;
Modules.Add(item);
}
}
示例11: DirectStation
internal DirectStation(DirectEve directEve, PyObject pyo)
: base(directEve)
{
Id = (int) pyo.Attribute("stationID");
Name = (string) pyo.Attribute("stationName");
X = (double) pyo.Attribute("x");
Y = (double) pyo.Attribute("y");
Z = (double) pyo.Attribute("z");
TypeId = (int) pyo.Attribute("stationTypeID");
SolarSystemId = (int) pyo.Attribute("solarSystemID");
}
示例12: DirectEntity
internal DirectEntity(DirectEve directEve, PyObject ballpark, PyObject ball, PyObject slimItem, long id)
: base(directEve)
{
_ballpark = ballpark;
_ball = ball;
_slimItem = slimItem;
Id = id;
TypeId = (int) slimItem.Attribute("typeID");
Attacks = new List<string>();
ElectronicWarfare = new List<string>();
}
示例13: DirectAgentMissionBookmark
internal DirectAgentMissionBookmark(DirectEve directEve, PyObject pyBookmark)
: base(directEve, pyBookmark)
{
AgentId = (long?) pyBookmark.Attribute("agentID");
IsDeadspace = (bool?) pyBookmark.Attribute("deadspace");
Flag = (int?) pyBookmark.Attribute("flag");
LocationNumber = (int?) pyBookmark.Attribute("locationNumber");
LocationType = (string) pyBookmark.Attribute("locationType");
Title = (string) pyBookmark.Attribute("hint");
SolarSystemId = (long?) pyBookmark.Attribute("solarsystemID");
}
示例14: DirectScannerProbe
internal DirectScannerProbe(DirectEve directEve, PyObject pyProbe)
: base(directEve)
{
PyProbe = pyProbe;
TypeId = (int) pyProbe.Attribute("typeID");
ProbeId = (long) pyProbe.Attribute("probeID");
X = (double) pyProbe.Attribute("pos").Attribute("x");
Y = (double) pyProbe.Attribute("pos").Attribute("y");
Z = (double) pyProbe.Attribute("pos").Attribute("z");
Expiry = new TimeSpan((long) pyProbe.Attribute("expire"));
RangeAu = (double) pyProbe.Attribute("scanRange")/(double) directEve.Const.AU;
AllRangesAu = DirectEve.GetLocalSvc("scanSvc").Call("GetScanRangeStepsByTypeID", TypeId).ToList<double>().Select(i => i/(double) directEve.Const.AU).ToList();
}
示例15: DirectWindow
internal DirectWindow(DirectEve directEve, PyObject pyWindow)
: base(directEve)
{
PyWindow = pyWindow;
Id = (int?) pyWindow.Attribute("windowID");
Type = (string) pyWindow.Attribute("__guid__");
Name = (string) pyWindow.Attribute("name");
IsKillable = (bool) pyWindow.Attribute("_killable");
IsDialog = (bool) pyWindow.Attribute("isDialog");
IsModal = (bool) pyWindow.Attribute("isModal");
Caption = (string) pyWindow.Call("GetCaption");
var paragraphs = pyWindow.Attribute("edit").Attribute("sr").Attribute("paragraphs").ToList();
var html = paragraphs.Aggregate("", (current, paragraph) => current + (string) paragraph.Attribute("text"));
if (String.IsNullOrEmpty(html))
html = (string) pyWindow.Attribute("edit").Attribute("sr").Attribute("currentTXT");
if (String.IsNullOrEmpty(html))
html = (string) pyWindow.Attribute("sr").Attribute("messageArea").Attribute("sr").Attribute("currentTXT");
Html = html;
ViewMode = (string) pyWindow.Attribute("viewMode");
}