aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
diff options
context:
space:
mode:
authorTedd Hansen2008-01-01 14:56:12 +0000
committerTedd Hansen2008-01-01 14:56:12 +0000
commit7ef7caa2008d5122f02ae5bf6ee3e7052d031c58 (patch)
tree5169eb78647178e127ebaffbd829758ee6caadf2 /OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
parentprebuild.xml back to 2901 because of bug in prebuild on nant (diff)
downloadopensim-SC_OLD-7ef7caa2008d5122f02ae5bf6ee3e7052d031c58.zip
opensim-SC_OLD-7ef7caa2008d5122f02ae5bf6ee3e7052d031c58.tar.gz
opensim-SC_OLD-7ef7caa2008d5122f02ae5bf6ee3e7052d031c58.tar.bz2
opensim-SC_OLD-7ef7caa2008d5122f02ae5bf6ee3e7052d031c58.tar.xz
Temp removed new data types patch from Mantis #272, causing compile problems (nant)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/ScriptEngine/Common/LSL_Types.cs673
1 files changed, 337 insertions, 336 deletions
diff --git a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
index aee1f5a..5d3fcf1 100644
--- a/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
+++ b/OpenSim/Region/ScriptEngine/Common/LSL_Types.cs
@@ -36,7 +36,7 @@ namespace OpenSim.Region.ScriptEngine.Common
36 { 36 {
37 37
38 // Types are kept is separate .dll to avoid having to add whatever .dll it is in it to script AppDomain 38 // Types are kept is separate .dll to avoid having to add whatever .dll it is in it to script AppDomain
39 39
40 [Serializable] 40 [Serializable]
41 public struct Vector3 41 public struct Vector3
42 { 42 {
@@ -449,341 +449,342 @@ namespace OpenSim.Region.ScriptEngine.Common
449 // BELOW IS WORK IN PROGRESS... IT WILL CHANGE, SO DON'T USE YET! :) 449 // BELOW IS WORK IN PROGRESS... IT WILL CHANGE, SO DON'T USE YET! :)
450 // 450 //
451 451
452 452 //Temp commented out
453 453 //[15:26:57] <justincc> [csc] Compiling 5 files to '/home/caseyj/jc/it/v/virtual-worlds/second-life/servers/opensim/src/opensim-svn-nematode/OpenSim/Region/ScriptEngine/Common/bin/Debug/OpenSim.Region.ScriptEngine.Common.dll'.
454 454 //[15:26:57] <justincc> [csc] error CS0121: The call is ambiguous between the following methods or properties: `OpenSim.Region.ScriptEngine.Common.LSL_Types.list.LSLString.operator /(OpenSim.Region.ScriptEngine.Common.LSL_Types.list.LSLString, OpenSim.Region.ScriptEngine.Common.LSL_Types.list.LSLString)' and `string.operator /(string, string)'
455 455
456 456
457 public struct StringTest 457
458 { 458 //public struct StringTest
459 // Our own little string 459 //{
460 internal string actualString; 460 // // Our own little string
461 public static implicit operator bool(StringTest mString) 461 // internal string actualString;
462 { 462 // public static implicit operator bool(StringTest mString)
463 if (mString.actualString.Length == 0) 463 // {
464 return true; 464 // if (mString.actualString.Length == 0)
465 return false; 465 // return true;
466 } 466 // return false;
467 public override string ToString() 467 // }
468 { 468 // public override string ToString()
469 return actualString; 469 // {
470 } 470 // return actualString;
471 471 // }
472 } 472
473 473 //}
474 [Serializable] 474
475 public struct key 475 //[Serializable]
476 { 476 //public struct key
477 public string value; 477 //{
478 478 // public string value;
479 #region Constructors 479
480 public key(string s) 480 // #region Constructors
481 { 481 // public key(string s)
482 value = s; 482 // {
483 } 483 // value = s;
484 484 // }
485 #endregion 485
486 486 // #endregion
487 #region Methods 487
488 488 // #region Methods
489 static public bool Parse2Key(string s) 489
490 { 490 // static public bool Parse2Key(string s)
491 Regex isuuid = new Regex(@"^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$", RegexOptions.Compiled); 491 // {
492 if (isuuid.IsMatch(s)) 492 // Regex isuuid = new Regex(@"^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$", RegexOptions.Compiled);
493 { 493 // if (isuuid.IsMatch(s))
494 return true; 494 // {
495 } 495 // return true;
496 else 496 // }
497 { 497 // else
498 return false; 498 // {
499 } 499 // return false;
500 } 500 // }
501 501 // }
502 #endregion 502
503 503 // #endregion
504 #region Operators 504
505 505 // #region Operators
506 static public implicit operator System.Boolean(key k) 506
507 { 507 // static public implicit operator System.Boolean(key k)
508 if (k.value.Length == 0) 508 // {
509 { 509 // if (k.value.Length == 0)
510 return false; 510 // {
511 } 511 // return false;
512 512 // }
513 if (k.value == "00000000-0000-0000-0000-000000000000") 513
514 { 514 // if (k.value == "00000000-0000-0000-0000-000000000000")
515 return false; 515 // {
516 } 516 // return false;
517 Regex isuuid = new Regex(@"^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$", RegexOptions.Compiled); 517 // }
518 if (isuuid.IsMatch(k.value)) 518 // Regex isuuid = new Regex(@"^[0-9a-fA-F]{8}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{4}\-[0-9a-fA-F]{12}$", RegexOptions.Compiled);
519 { 519 // if (isuuid.IsMatch(k.value))
520 return true; 520 // {
521 } 521 // return true;
522 else 522 // }
523 { 523 // else
524 return false; 524 // {
525 } 525 // return false;
526 } 526 // }
527 527 // }
528 static public implicit operator key(string s) 528
529 { 529 // static public implicit operator key(string s)
530 return new key(s); 530 // {
531 } 531 // return new key(s);
532 532 // }
533 static public implicit operator System.String(key k) 533
534 { 534 // static public implicit operator System.String(key k)
535 return k.value; 535 // {
536 } 536 // return k.value;
537 537 // }
538 public static bool operator ==(key k1, key k2) 538
539 { 539 // public static bool operator ==(key k1, key k2)
540 return k1.value == k2.value; 540 // {
541 } 541 // return k1.value == k2.value;
542 public static bool operator !=(key k1, key k2) 542 // }
543 { 543 // public static bool operator !=(key k1, key k2)
544 return k1.value != k2.value; 544 // {
545 } 545 // return k1.value != k2.value;
546 546 // }
547 #endregion 547
548 548 // #endregion
549 #region Overriders 549
550 550 // #region Overriders
551 public override bool Equals(object o) 551
552 { 552 // public override bool Equals(object o)
553 if (o is String) 553 // {
554 { 554 // if (o is String)
555 string s = (string)o; 555 // {
556 return s == this.value; 556 // string s = (string)o;
557 } 557 // return s == this.value;
558 if (o is key) 558 // }
559 { 559 // if (o is key)
560 key k = (key)o; 560 // {
561 return this.value == k.value; 561 // key k = (key)o;
562 } 562 // return this.value == k.value;
563 return false; 563 // }
564 } 564 // return false;
565 565 // }
566 public override int GetHashCode() 566
567 { 567 // public override int GetHashCode()
568 return value.GetHashCode(); 568 // {
569 } 569 // return value.GetHashCode();
570 570 // }
571 #endregion 571
572 } 572 // #endregion
573 573 //}
574 [Serializable] 574
575 public struct LSLString 575 //[Serializable]
576 { 576 //public struct LSLString
577 public string m_string; 577 //{
578 #region Constructors 578 // public string m_string;
579 public LSLString(string s) 579 // #region Constructors
580 { 580 // public LSLString(string s)
581 m_string = s; 581 // {
582 } 582 // m_string = s;
583 #endregion 583 // }
584 584 // #endregion
585 #region Operators 585
586 static public implicit operator System.Boolean(LSLString s) 586 // #region Operators
587 { 587 // static public implicit operator System.Boolean(LSLString s)
588 if (s.m_string.Length == 0) 588 // {
589 { 589 // if (s.m_string.Length == 0)
590 return false; 590 // {
591 } 591 // return false;
592 else 592 // }
593 { 593 // else
594 return true; 594 // {
595 } 595 // return true;
596 } 596 // }
597 597 // }
598 static public implicit operator System.String(LSLString s) 598
599 { 599 // static public implicit operator System.String(LSLString s)
600 return s.m_string; 600 // {
601 } 601 // return s.m_string;
602 602 // }
603 static public implicit operator LSLString(string s) 603
604 { 604 // static public implicit operator LSLString(string s)
605 return new LSLString(s); 605 // {
606 } 606 // return new LSLString(s);
607 607 // }
608 public static bool operator ==(LSLString s1, LSLString s2) 608
609 { 609 // public static bool operator ==(LSLString s1, LSLString s2)
610 return s1.m_string == s2.m_string; 610 // {
611 } 611 // return s1.m_string == s2.m_string;
612 public static bool operator !=(LSLString s1, LSLString s2) 612 // }
613 { 613 // public static bool operator !=(LSLString s1, LSLString s2)
614 return s1.m_string != s2.m_string; 614 // {
615 } 615 // return s1.m_string != s2.m_string;
616 #endregion 616 // }
617 617 // #endregion
618 #region Overriders 618
619 public override bool Equals(object o) 619 // #region Overriders
620 { 620 // public override bool Equals(object o)
621 if (o is String) 621 // {
622 { 622 // if (o is String)
623 string s = (string)o; 623 // {
624 return s == this.m_string; 624 // string s = (string)o;
625 } 625 // return s == this.m_string;
626 if (o is key) 626 // }
627 { 627 // if (o is key)
628 key k = (key)o; 628 // {
629 return this.m_string == k.value; 629 // key k = (key)o;
630 } 630 // return this.m_string == k.value;
631 if (o is LSLString) 631 // }
632 { 632 // if (o is LSLString)
633 LSLString s = (string)o; 633 // {
634 return this.m_string == s; 634 // LSLString s = (string)o;
635 } 635 // return this.m_string == s;
636 return false; 636 // }
637 } 637 // return false;
638 638 // }
639 public override int GetHashCode() 639
640 { 640 // public override int GetHashCode()
641 return m_string.GetHashCode(); 641 // {
642 } 642 // return m_string.GetHashCode();
643 643 // }
644 #endregion 644
645 645 // #endregion
646 #region " Standard string functions " 646
647 //Clone,CompareTo,Contains 647 // #region " Standard string functions "
648 //CopyTo,EndsWith,Equals,GetEnumerator,GetHashCode,GetType,GetTypeCode 648 // //Clone,CompareTo,Contains
649 //IndexOf,IndexOfAny,Insert,IsNormalized,LastIndexOf,LastIndexOfAny 649 // //CopyTo,EndsWith,Equals,GetEnumerator,GetHashCode,GetType,GetTypeCode
650 //Length,Normalize,PadLeft,PadRight,Remove,Replace,Split,StartsWith,Substring,ToCharArray,ToLowerInvariant 650 // //IndexOf,IndexOfAny,Insert,IsNormalized,LastIndexOf,LastIndexOfAny
651 //ToString,ToUpper,ToUpperInvariant,Trim,TrimEnd,TrimStart 651 // //Length,Normalize,PadLeft,PadRight,Remove,Replace,Split,StartsWith,Substring,ToCharArray,ToLowerInvariant
652 public bool Contains(string value) { return m_string.Contains(value); } 652 // //ToString,ToUpper,ToUpperInvariant,Trim,TrimEnd,TrimStart
653 public int IndexOf(string value) { return m_string.IndexOf(value); } 653 // public bool Contains(string value) { return m_string.Contains(value); }
654 public int Length { get { return m_string.Length; } } 654 // public int IndexOf(string value) { return m_string.IndexOf(value); }
655 655 // public int Length { get { return m_string.Length; } }
656 656
657 #endregion 657
658 } 658 // #endregion
659 659 //}
660 [Serializable] 660
661 public struct LSLInteger 661 //[Serializable]
662 { 662 //public struct LSLInteger
663 public int value; 663 //{
664 664 // public int value;
665 #region Constructors 665
666 public LSLInteger(int i) 666 // #region Constructors
667 { 667 // public LSLInteger(int i)
668 value = i; 668 // {
669 } 669 // value = i;
670 670 // }
671 public LSLInteger(double d) 671
672 { 672 // public LSLInteger(double d)
673 value = (int)d; 673 // {
674 } 674 // value = (int)d;
675 675 // }
676 #endregion 676
677 static public implicit operator System.Int32(LSLInteger i) 677 // #endregion
678 { 678 // static public implicit operator System.Int32(LSLInteger i)
679 return i.value; 679 // {
680 } 680 // return i.value;
681 681 // }
682 static public implicit operator System.Boolean(LSLInteger i) 682
683 { 683 // static public implicit operator System.Boolean(LSLInteger i)
684 if (i.value == 0) 684 // {
685 { 685 // if (i.value == 0)
686 return false; 686 // {
687 } 687 // return false;
688 else 688 // }
689 { 689 // else
690 return true; 690 // {
691 } 691 // return true;
692 } 692 // }
693 693 // }
694 static public implicit operator LSLInteger(int i) 694
695 { 695 // static public implicit operator LSLInteger(int i)
696 return new LSLInteger(i); 696 // {
697 } 697 // return new LSLInteger(i);
698 698 // }
699 static public implicit operator LSLInteger(double d) 699
700 { 700 // static public implicit operator LSLInteger(double d)
701 return new LSLInteger(d); 701 // {
702 } 702 // return new LSLInteger(d);
703 703 // }
704 static public LSLInteger operator &(LSLInteger i1, LSLInteger i2) 704
705 { 705 // static public LSLInteger operator &(LSLInteger i1, LSLInteger i2)
706 int ret = i1.value & i2.value; 706 // {
707 return ret; 707 // int ret = i1.value & i2.value;
708 } 708 // return ret;
709 709 // }
710 710
711 //static public implicit operator System.Double(LSLInteger i) 711
712 //{ 712 // //static public implicit operator System.Double(LSLInteger i)
713 // return (double)i.value; 713 // //{
714 //} 714 // // return (double)i.value;
715 715 // //}
716 #region Overriders 716
717 717 // #region Overriders
718 public override string ToString() 718
719 { 719 // public override string ToString()
720 return this.value.ToString(); 720 // {
721 } 721 // return this.value.ToString();
722 722 // }
723 #endregion 723
724 } 724 // #endregion
725 725 //}
726 [Serializable] 726
727 public struct LSLFloat 727 //[Serializable]
728 { 728 //public struct LSLFloat
729 public double value; 729 //{
730 730 // public double value;
731 #region Constructors 731
732 public LSLFloat(int i) 732 // #region Constructors
733 { 733 // public LSLFloat(int i)
734 this.value = (double)i; 734 // {
735 } 735 // this.value = (double)i;
736 736 // }
737 public LSLFloat(double d) 737
738 { 738 // public LSLFloat(double d)
739 this.value = d; 739 // {
740 } 740 // this.value = d;
741 741 // }
742 #endregion 742
743 743 // #endregion
744 #region Operators 744
745 745 // #region Operators
746 static public implicit operator System.Double(LSLFloat f) 746
747 { 747 // static public implicit operator System.Double(LSLFloat f)
748 return f.value; 748 // {
749 } 749 // return f.value;
750 750 // }
751 //static public implicit operator System.Int32(LSLFloat f) 751
752 //{ 752 // //static public implicit operator System.Int32(LSLFloat f)
753 // return (int)f.value; 753 // //{
754 //} 754 // // return (int)f.value;
755 755 // //}
756 756
757 static public implicit operator System.Boolean(LSLFloat f) 757
758 { 758 // static public implicit operator System.Boolean(LSLFloat f)
759 if (f.value == 0) 759 // {
760 { 760 // if (f.value == 0)
761 return false; 761 // {
762 } 762 // return false;
763 else 763 // }
764 { 764 // else
765 return true; 765 // {
766 } 766 // return true;
767 } 767 // }
768 768 // }
769 static public implicit operator LSLFloat(int i) 769
770 { 770 // static public implicit operator LSLFloat(int i)
771 return new LSLFloat(i); 771 // {
772 } 772 // return new LSLFloat(i);
773 773 // }
774 static public implicit operator LSLFloat(double d) 774
775 { 775 // static public implicit operator LSLFloat(double d)
776 return new LSLFloat(d); 776 // {
777 } 777 // return new LSLFloat(d);
778 #endregion 778 // }
779 779 // #endregion
780 #region Overriders 780
781 public override string ToString() 781 // #region Overriders
782 { 782 // public override string ToString()
783 return this.value.ToString(); 783 // {
784 } 784 // return this.value.ToString();
785 #endregion 785 // }
786 } 786 // #endregion
787 //}
787 788
788 789
789 } 790 }