Ejemplo n.º 1
0
        private void OutputField(Definition.FieldDef f)
        {
            //Summary(f.Brief);
            MakeIndent();

            if (f.Argument == null)
            {
                Res.AppendFormat("{2} {3}{0} {1}", GetTypeSpecifier(f.Type), f.Name, GetAccessLevel(f.AccessLevel), f.IsStatic ? "static " : "");

                if (f.Initializer != null)
                {
                    Res.AppendFormat(" = {0};\r\n", GetExpression(f.Initializer));
                }
                else
                {
                    Res.AppendLine(";");
                }
            }
            else
            {
                // 無理やりfixedArrayを再現
                var atype = (Definition.ArrayType)f.Type;

                Res.AppendFormat("{0} {1}{2} {3} = new {4}[{5}];\r\n",
                                 GetAccessLevel(f.AccessLevel),
                                 f.IsStatic ? "static " : "",
                                 GetTypeSpecifier(f.Type), f.Name,
                                 GetTypeSpecifier(atype.BaseType),
                                 f.Argument);
            }
        }
Ejemplo n.º 2
0
 private void OutputFieldInInterface(Definition.FieldDef f)
 {
     //Summary(f.Brief);
     MakeIndent();
     Res.AppendFormat("{0} {1};", GetTypeSpecifier(f.Type), f.Name);
 }