Пример #1
0
        public override bool ResolveLinks()
        {
            var result = base.ResolveLinks();

            Parameters     = new List <ME3Property>();
            LocalVariables = new List <ME3Property>();
            foreach (var variable in Variables)
            {
                if (variable.PropertyFlags.HasFlag(PropertyFlags.ReturnParm))
                {
                    ReturnValue = variable;
                }
                else if (variable.PropertyFlags.HasFlag(PropertyFlags.Parm))
                {
                    Parameters.Add(variable);
                }
                else
                {
                    LocalVariables.Add(variable);
                }
            }

            return(result);
        }
Пример #2
0
        private String GetPropertyType(ME3Property obj)
        {
            String typeStr = "UNKNOWN";
            if (obj is ME3ArrayProperty)
                typeStr = "array< " + GetPropertyType((obj as ME3ArrayProperty).InnerProperty) + " >";
            else if (obj is ME3BoolProperty)
                typeStr = "bool";
            else if (obj is ME3ByteProperty)
                typeStr = (obj as ME3ByteProperty).IsEnum ? (obj as ME3ByteProperty).Enum.Name : "byte";
            else if (obj is ME3ClassProperty)
                typeStr = "class";
            else if (obj is ME3ComponentProperty)
                typeStr = "ActorComponent"; // TODO: is this correct at all?
            else if (obj is ME3DelegateProperty)
                typeStr = "delegate< " + (obj as ME3DelegateProperty).FunctionName + " >";
            else if (obj is ME3FixedArrayProperty)
                typeStr = GetPropertyType((obj as ME3FixedArrayProperty).InnerProperty);
            else if (obj is ME3FloatProperty)
                typeStr = "float";
            else if (obj is ME3InterfaceProperty)
                typeStr = (obj as ME3InterfaceProperty).InterfaceName; // ?
            else if (obj is ME3IntProperty)
                typeStr = "int";
            else if (obj is ME3NameProperty)
                typeStr = "Name"; // ?
            else if (obj is ME3Object)
                typeStr = "object";
            else if (obj is ME3StrProperty)
                typeStr = "string";
            else if (obj is ME3StructProperty)
                typeStr = (obj as ME3StructProperty).Struct.Name;

            return typeStr;
        }
Пример #3
0
 public Variable ConvertVariable(ME3Property obj)
 {
     int size = -1;
     if (obj is ME3FixedArrayProperty)
         size = (obj as ME3FixedArrayProperty).ArraySize;
     return new Variable(new List<Specifier>(),
         new VariableIdentifier(obj.Name, null, null, size),
         new VariableType(GetPropertyType(obj), null, null), null, null);
 }