private void Op_Lneq() { LSLList rhs = (LSLList)_state.Operands.Pop(); LSLList lhs = (LSLList)_state.Operands.Pop(); SafeOperandsPush(lhs.Members.Count == rhs.Members.Count ? 0 : 1); }
private void Op_ListPrepend() { LSLList b = (LSLList)_state.Operands.Pop(); object a = (object)_state.Operands.Pop(); SafeOperandsPush(b.Prepend(a)); }
public void TestSetAndClearMaterialsForFaceClearsEntry() { var sop = SceneUtil.RandomSOP("Root", 1); sop.OwnerMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer | PermissionMask.Modify); var group = new SceneObjectGroup(sop); var lslSystemApi = new LSLSystemAPI(engine, sop, 0, UUID.Zero); // Check that its Zeroed var emptyResult = new LSLList(new List<object> { UUID.Zero.ToString(), new Vector3(1, 1, 0), new Vector3(0, 0, 0), 0 }); var rules = new LSLList(new List<object> { ScriptBaseClass.PRIM_NORMAL, 0 }); LSLList asList = lslSystemApi.llGetPrimitiveParams(rules); Assert.That(asList.ToString(), Is.EqualTo(emptyResult.ToString())); // Set a value and check it var textureId = UUID.Random(); var faceZeroData = new LSLList(new List<object> { textureId.ToString(), new Vector3(1, 1, 0), new Vector3(0, 0, 0), 0 }); var setMaterialsRequest = rules.Append(faceZeroData); lslSystemApi.llSetLinkPrimitiveParamsFast(0, setMaterialsRequest); LSLList setMaterialsResult = lslSystemApi.llGetLinkPrimitiveParams(0, rules); Assert.That(setMaterialsResult.ToString(), Is.EqualTo(faceZeroData.ToString())); // Clear it and Check thats its zeroed var clearMaterialsRequest = rules.Append(emptyResult); lslSystemApi.llSetLinkPrimitiveParamsFast(0, clearMaterialsRequest); LSLList clearMaterialsResult = lslSystemApi.llGetLinkPrimitiveParams(0, clearMaterialsRequest); Assert.That(clearMaterialsResult.ToString(), Is.EqualTo(emptyResult.ToString())); }
private void Op_ListAppend() { object b = _state.Operands.Pop(); LSLList a = (LSLList)_state.Operands.Pop(); SafeOperandsPush(a.Append(b)); }
public void TestJsonSimpleObjectWithNullInValue() { var expectedResult = new LSLList(new List <object> { "dummy", ScriptBaseClass.JSON_NULL }); var asList = lslSystemApi.llJson2List("{ \"dummy\" : null }"); Assert.IsTrue(expectedResult.Equals(asList)); }
public void TestJsonArrayWithNull() { var expectedResult = new LSLList(new List <object> { ScriptBaseClass.JSON_NULL }); var asList = lslSystemApi.llJson2List("[ null ]"); Assert.IsTrue(expectedResult.Equals(asList)); }
public void TestJsonSimpleObject() { var expectedResult = new LSLList(new List <object> { "dummy", "data" }); LSLList asList = lslSystemApi.llJson2List("{ \"dummy\" : \"data\" }"); Assert.IsTrue(expectedResult.Equals(asList)); }
public void TestGetMaterialsForFace() { var sop = SceneUtil.RandomSOP("Root", 1); var group = new SceneObjectGroup(sop); var lslSystemApi = new LSLSystemAPI(engine, sop, 0, UUID.Zero); var expectedResult = new LSLList(new List<object> { UUID.Zero.ToString(), new Vector3(1, 1, 0), new Vector3(0, 0, 0), 0 }); var rules = new LSLList(new List<object> { ScriptBaseClass.PRIM_NORMAL, 0 }); LSLList asList = lslSystemApi.llGetPrimitiveParams(rules); Assert.That(asList.ToString(), Is.EqualTo(expectedResult.ToString())); }
private void Op_Linit_g() { int gidx = this.GetIntOperand(); LSLList newVal = new LSLList(); _state.MemInfo.ReplaceStored(_state.Globals[gidx], newVal); _state.Globals[gidx] = newVal; }
private void Op_Linit_l() { int lidx = this.GetIntOperand(); LSLList newVal = new LSLList(); _state.MemInfo.ReplaceStored(_state.TopFrame.Locals[lidx], newVal); _state.TopFrame.Locals[lidx] = newVal; }
private string _LSLListToString(LSLList list) { StringBuilder contents = new StringBuilder(); for (int index = 0; index < list.Data.Length; ++index) { contents.Append(list.GetLSLStringItem(index)); } return(contents.ToString()); }
private string _LSLListToString(LSLList list) { StringBuilder contents = new StringBuilder(); foreach (object obj in list.Members) { contents.Append(_PrimitiveToString(obj)); } return(contents.ToString()); }
public void TestSetAndGetMaterialsForFaceForNoModSOP() { var sop = SceneUtil.RandomSOP("Root", 1); sop.OwnerMask = (uint)(PermissionMask.Copy | PermissionMask.Transfer); var group = new SceneObjectGroup(sop); var lslSystemApi = new LSLSystemAPI(engine, sop, 0, UUID.Zero); var textureId = UUID.Random(); var faceZeroData = new LSLList(new List<object> { textureId.ToString(), new Vector3(1, 1, 0), new Vector3(0, 0, 0), 0 }); var rules = new LSLList(new List<object> { ScriptBaseClass.PRIM_NORMAL, 0 }); var request = rules.Append(faceZeroData); lslSystemApi.llSetLinkPrimitiveParamsFast(0, request); LSLList result = lslSystemApi.llGetLinkPrimitiveParams(0, rules); Assert.That(result.ToString(), !Is.EqualTo(faceZeroData.ToString())); }
public void Normalize() { if (Args != null) { for (int i = 0; i < Args.Length; i++) { object obj = Args[i]; object[] objarr = obj as object[]; if (objarr != null) { Args[i] = new LSLList(objarr); } } } }
public void TestJsonSimpleObject() { var expectedResult = new LSLList(new List<object> { "dummy", "data" }); LSLList asList = lslSystemApi.llJson2List("{ \"dummy\" : \"data\" }"); Assert.IsTrue(expectedResult.Equals(asList)); }
public void TestJsonSimpleObjectWithNullInValue() { var expectedResult = new LSLList(new List<object>{ "dummy", ScriptBaseClass.JSON_NULL }); var asList = lslSystemApi.llJson2List("{ \"dummy\" : null }"); Assert.IsTrue(expectedResult.Equals(asList)); }
public void TestJsonArrayWithNull() { var expectedResult = new LSLList(new List<object> { ScriptBaseClass.JSON_NULL }); var asList = lslSystemApi.llJson2List("[ null ]"); Assert.IsTrue(expectedResult.Equals(asList)); }
private static LSLList ConvToLSLType(LSLList o) { return o; }
private string _LSLListToString(LSLList list) { StringBuilder contents = new StringBuilder(); foreach (object obj in list.Members) { contents.Append(_PrimitiveToString(obj)); } return contents.ToString(); }