private PyObject Load(byte[] data) { var s = new PyString(data); var ret = LoadFunc.Call(s); return(ret); }
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"); }
public bool ChangeAmmo(DirectItem charge) { if (charge.ItemId <= 0) { return(false); } if (charge.TypeId <= 0) { return(false); } if (charge.Stacksize <= 0) { return(false); } var realoadInfo = _pyModule.Call("GetChargeReloadInfo").ToList(); if (charge.TypeId == (int)realoadInfo[0]) { return(ReloadAmmo(charge)); } else { _pyModule.Attribute("stateManager").Call("ChangeAmmoTypeForModule", ItemId, charge.TypeId); return(ReloadAmmo(charge)); } }
internal void GetDamageState() { _shieldPct = 0; _armorPct = 0; _structurePct = 0; // Get damage state properties var damageState = _ballpark.Call("GetDamageState", Id).ToList(); if (damageState.Count == 3 ^ damageState.Count == 5) { _shieldPct = (double)damageState[0]; _armorPct = (double)damageState[1]; _structurePct = (double)damageState[2]; } }
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"); }
public PyObject Forward(Variable <T> x) { return(_maxPooling2D.Call(x, _kSize, _stride, _pad)); }
public PyObject Forward(PyObject x) { return(_swish.Call(x)); }
public PyObject Forward(Variable <T> x) { return(_localResponseNormalization.Call(x, n, k, alpha, beta)); }
public PyObject Forward(PyObject x0, PyObject x1) { return(_softmaxCrossEntropy.Call(x0, x1)); }
public PyObject Forward(params PyObject[] x) { return(_concat.Call(PyTuple.Pack(x), axis)); }
public PyObject[] Forward(PyObject x, PyArray <int> indices, int axis = 1) { return(PyTuple.UnPack(_splitAxis.Call(x, indices, axis))); }
public PyObject Forward(PyObject x0, PyObject x1) { return(_meanSquaredError.Call(x0, x1)); }