コード例 #1
0
        public void TestCastLSLStringItemToLSLString()
        {
            LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello there");
            LSL_Types.list      testList  = new LSL_Types.list(testValue);

            Assert.AreEqual(testValue, (LSL_Types.LSLString)testList.Data[0]);
        }
コード例 #2
0
        public void TestGetLSLStringItemForLSLStringItem()
        {
            LSL_Types.LSLString testValue = new LSL_Types.LSLString("hello all");
            LSL_Types.list      testList  = new LSL_Types.list(testValue);

            Assert.AreEqual(testValue, testList.GetLSLStringItem(0));
        }
コード例 #3
0
        public bool PostScriptEvent(UUID itemID, string name, Object[] p)
        {
            Object[] lsl_p = new Object[p.Length];
            for (int i = 0; i < p.Length; i++)
            {
                if (p[i] is int)
                {
                    lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
                }
                else if (p[i] is string)
                {
                    lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
                }
                else if (p[i] is Vector3)
                {
                    lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
                }
                else if (p[i] is Quaternion)
                {
                    lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
                }
                else if (p[i] is float)
                {
                    lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
                }
                else
                {
                    lsl_p[i] = p[i];
                }
            }

            return(PostScriptEvent(itemID, new EventParams(name, lsl_p, new DetectParams[0])));
        }
コード例 #4
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLString s1 = "this is a string.";
     LSL_Types.LSLString s2 = "this is a string " + "with an escaped \" inside it.";
     s1 = s2 + " and this " + "is a string with // comments.";
     LSL_Types.LSLString onemore   = "[\^@]";
     LSL_Types.LSLString multiline = "Good evening Sir,\n        my name is Steve.\n        I come from a rough area.\n        I used to be addicted to crack\n        but now I am off it and trying to stay clean.\n        That is why I am selling magazine subscriptions.";
 }
コード例 #5
0
        public void TestGetLSLStringItemForKeyItem()
        {
            LSL_Types.key testValue
                = new LSL_Types.key("98000000-0000-2222-3333-100000001000");
            LSL_Types.LSLString testStringValue = new LSL_Types.LSLString(testValue);
            LSL_Types.list      testList        = new LSL_Types.list(testValue);

            Assert.AreEqual(testStringValue, testList.GetLSLStringItem(0));
        }
コード例 #6
0
 public GLOBALS()
 {
     this.V_listThx            = (new LSL_Types.list());
     this.V_notecard           = "TEMPLATE_THX";
     this.V_indexLigneNotecard = new LSL_Types.LSLInteger(0);
     this.V_length             = 0;
     this.V_getReadRequest     = "";
     this.V_getLength          = "";
 }
コード例 #7
0
ファイル: LSLScript.cs プロジェクト: Fabber181/camera_control
 public GLOBALS()
 {
     this.V_gNotecard      = "Config";
     this.V_gLineRequestID = "";
     this.V_gReadRequestID = "";
     this.V_gLineTotal     = 0;
     this.V_gLineIndex     = 0;
     this.V_gDataLines     = new LSL_Types.list();
     this.V_gStatus        = "";
 }
コード例 #8
0
        public void TestConstructFromLSLFloat()
        {
            LSL_Types.LSLString testString;

            foreach (KeyValuePair <double, string> number in m_doubleStringSet)
            {
                testString = new LSL_Types.LSLString(new LSL_Types.LSLFloat(number.Key));
                Assert.AreEqual(number.Value, testString.m_string);
            }
        }
コード例 #9
0
        public void TestExplicitCastLSLStringToQuaternion()
        {
            string quaternionString = "<0.00000, 0.70711, 0.00000, 0.70711>";

            LSL_Types.LSLString quaternionLSLString = new LSL_Types.LSLString(quaternionString);

            LSL_Types.Quaternion expectedQuaternion  = new LSL_Types.Quaternion(0.0, 0.70711, 0.0, 0.70711);
            LSL_Types.Quaternion stringQuaternion    = (LSL_Types.Quaternion)quaternionString;
            LSL_Types.Quaternion LSLStringQuaternion = (LSL_Types.Quaternion)quaternionLSLString;

            Assert.AreEqual(expectedQuaternion, stringQuaternion);
            Assert.AreEqual(expectedQuaternion, LSLStringQuaternion);
        }
コード例 #10
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLString  s = "";
     LSL_Types.LSLInteger x = 1;
     s = (LSL_Types.LSLString)(x++);
     s = (LSL_Types.LSLString)(x);
     s = (LSL_Types.LSLString)(new LSL_Types.Vector3(0.0, 0.0, 0.0));
     s = (LSL_Types.LSLString)(new LSL_Types.Quaternion(1.0, 1.0, 1.0, 1.0));
     s = (LSL_Types.LSLInteger)("1");
     s = (LSL_Types.LSLString)(llSomethingThatReturnsInteger());
     s = (LSL_Types.LSLString)(134);
     s = (LSL_Types.LSLString)(x ^ y | (z && l)) + (LSL_Types.LSLString)(x + y - 13);
     llOwnerSay("s is: " + s);
 }
コード例 #11
0
        public void TestConcatenateString()
        {
            LSL_Types.list testList = new LSL_Types.list(new LSL_Types.LSLInteger(1), new LSL_Types.LSLInteger('a'), new LSL_Types.LSLString("test"));
            testList += new LSL_Types.LSLString("addition");

            Assert.AreEqual(4, testList.Length);
            Assert.AreEqual(new LSL_Types.LSLString("addition"), testList.Data[3]);
            Assert.AreEqual(typeof(LSL_Types.LSLString), testList.Data[3].GetType());

            LSL_Types.list secondTestList = testList + new LSL_Types.LSLString("more");

            Assert.AreEqual(5, secondTestList.Length);
            Assert.AreEqual(new LSL_Types.LSLString("more"), secondTestList.Data[4]);
            Assert.AreEqual(typeof(LSL_Types.LSLString), secondTestList.Data[4].GetType());
        }
コード例 #12
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLInteger i = 0;
     LSL_Types.LSLInteger j = 14;
     LSL_Types.LSLFloat   f = 0.0;
     LSL_Types.LSLFloat   g = 14.0;
     LSL_Types.LSLString  s = "";
     LSL_Types.LSLString  t = "Hi there";
     LSL_Types.list       l = new LSL_Types.list();
     LSL_Types.list       m = new LSL_Types.list(1, 2, 3);
     LSL_Types.Vector3    v = new LSL_Types.Vector3(0.0, 0.0, 0.0);
     LSL_Types.Vector3    w = new LSL_Types.Vector3(1.0, 0.1, 0.5);
     LSL_Types.Quaternion r = new LSL_Types.Quaternion(0.0, 0.0, 0.0, 0.0);
     LSL_Types.Quaternion u = new LSL_Types.Quaternion(0.8, 0.7, 0.6, llSomeFunc());
     LSL_Types.LSLString  k = "";
     LSL_Types.LSLString  n = "ping";
 }
コード例 #13
0
        public bool PostObjectEvent(UUID itemID, string name, Object[] p)
        {
            SceneObjectPart part = m_Scene.GetSceneObjectPart(itemID);

            if (part == null)
            {
                return(false);
            }

            Object[] lsl_p = new Object[p.Length];
            for (int i = 0; i < p.Length; i++)
            {
                if (p[i] is int)
                {
                    lsl_p[i] = new LSL_Types.LSLInteger((int)p[i]);
                }
                else if (p[i] is string)
                {
                    lsl_p[i] = new LSL_Types.LSLString((string)p[i]);
                }
                else if (p[i] is Vector3)
                {
                    lsl_p[i] = new LSL_Types.Vector3(((Vector3)p[i]).X, ((Vector3)p[i]).Y, ((Vector3)p[i]).Z);
                }
                else if (p[i] is Quaternion)
                {
                    lsl_p[i] = new LSL_Types.Quaternion(((Quaternion)p[i]).X, ((Quaternion)p[i]).Y, ((Quaternion)p[i]).Z, ((Quaternion)p[i]).W);
                }
                else if (p[i] is float)
                {
                    lsl_p[i] = new LSL_Types.LSLFloat((float)p[i]);
                }
                else
                {
                    lsl_p[i] = p[i];
                }
            }

            return(PostObjectEvent(part.LocalId, new EventParams(name, lsl_p, new DetectParams[0])));
        }
コード例 #14
0
 public static bool ToBool(LSL_Types.LSLString str)
 {
     return(str.Length != 0);
 }
コード例 #15
0
 LSL_Types.LSLString onefunc()
 {
     globalString = " ...and the global!";
     return("Hi " + "from " + "onefunc()!" + globalString);
 }
コード例 #16
0
ファイル: 013_expected.cs プロジェクト: Belxjander/Asuna
 LSL_Types.LSLString onefunc()
 {
     globalString = " ...and the global!";
     return "Hi " + "from " + "onefunc()!" + globalString;
 }
コード例 #17
0
ファイル: 014_expected.cs プロジェクト: Belxjander/Asuna
 LSL_Types.LSLString onefunc(LSL_Types.LSLString addition)
 {
     globalInt -= 2;
     globalString += addition;
     return "Hi " + "from " + "onefunc()! " + globalString;
 }
コード例 #18
0
 public void default_event_touch_start(LSL_Types.LSLInteger num_detected)
 {
     LSL_Types.LSLString  y = "";
     LSL_Types.LSLInteger x = 14;
     y = "Hello";
 }
コード例 #19
0
 void twofunc(LSL_Types.LSLString s)
 {
     llSay(1000, s);
 }
コード例 #20
0
 LSL_Types.LSLString onefunc(LSL_Types.LSLString addition)
 {
     globalInt    -= 2;
     globalString += addition;
     return("Hi " + "from " + "onefunc()! " + globalString);
 }