コード例 #1
0
 public FactPropertyDescriptor(int index, Value.Type baseType, byte type)
     : base(index.ToString(), new Attribute[0])
 {
     Index    = index;
     BaseType = baseType;
     Type     = type;
 }
コード例 #2
0
ファイル: Compiler.cs プロジェクト: christopherfowers/lslib
        private Value.Type IntrinsicTypeToCompatibilityType(Value.Type typeId)
        {
            switch ((Value.Type)typeId)
            {
                case Value.Type.Integer:
                case Value.Type.Integer64:
                case Value.Type.Float:
                    return Value.Type.Integer;

                case Value.Type.String:
                case Value.Type.GuidString:
                    return Value.Type.String;

                default:
                    throw new ArgumentException("Cannot check compatibility of unknown types");
            }
        }
コード例 #3
0
ファイル: Compiler.cs プロジェクト: christopherfowers/lslib
 /// <summary>
 /// Returns whether comparing the specified types is "risky",
 /// i.e. if there is unexpected behavior or side effects.
 /// </summary>
 private bool IsRiskyComparison(Value.Type type1, Value.Type type2)
 {
     return (type1 == Value.Type.String && type2 == Value.Type.GuidString)
         || (type1 == Value.Type.GuidString && type2 == Value.Type.String);
 }
コード例 #4
0
ファイル: Compiler.cs プロジェクト: christopherfowers/lslib
 private bool AreIntrinsicTypesCompatible(Value.Type type1, Value.Type type2)
 {
     Value.Type translatedType1 = IntrinsicTypeToCompatibilityType(type1),
         translatedType2 = IntrinsicTypeToCompatibilityType(type2);
     return translatedType1 == translatedType2;
 }
コード例 #5
0
ファイル: Compiler.cs プロジェクト: christopherfowers/lslib
 private string TypeToName(Value.Type typeId)
 {
     return TypeToName((uint)typeId);
 }