Пример #1
0
        public string Serialize(ref int tier)
        {
            StringBuilder sb = new StringBuilder();

            Helpers.AppendTextRow(ref tier, ref sb, "camera");
            Helpers.AppendTextRow(ref tier, ref sb, "{");
            tier++;
            Helpers.AppendTextRow(ref tier, ref sb, "position", position.Serialize(ref tier));
            Helpers.AppendTextRow(ref tier, ref sb, "look", look.Serialize(ref tier));
            tier--;
            Helpers.AppendTextRow(ref tier, ref sb, "}");
            return(sb.ToString());
        }
Пример #2
0
        public string Serialize(ref int tier)
        {
            StringBuilder sb = new StringBuilder();

            Helpers.AppendTextRow(ref tier, ref sb, "world");
            Helpers.AppendTextRow(ref tier, ref sb, "{");
            tier++;
            Helpers.AppendTextRow(ref tier, ref sb, "id", id.ToString());
            Helpers.AppendTextRow(ref tier, ref sb, "classname", classname);
            Helpers.AppendTextRow(ref tier, ref sb, "spawnflags", spawnflags.ToString());
            if (connections != null || connections.Count > 0)
            {
                foreach (connections c in connections)
                {
                    sb.AppendLine("\tconnections");
                    sb.AppendLine(c.Serialize(ref tier));
                }
            }
            if (solid != null && solid.Count > 0)
            {
                foreach (solid s in solid)
                {
                    sb.Append(s.Serialize(ref tier));
                }
            }
            if (hidden != null && hidden.Count > 0)
            {
                foreach (hidden h in hidden)
                {
                    sb.Append(h.Serialize(ref tier));
                }
            }
            if (origin != null)
            {
                Helpers.AppendTextRow(ref tier, ref sb, "origin", origin.Serialize(ref tier));
            }
            if (editor != null && editor.Count > 0)
            {
                foreach (editor e in editor)
                {
                    sb.Append(e.Serialize(ref tier));
                }
            }
            sb.AppendLine("}");
            return(sb.ToString());
        }
Пример #3
0
        public string Serialize(ref int tier)
        {
            StringBuilder sb = new StringBuilder("");

            Helpers.AppendTextRow(ref tier, ref sb, "dispinfo");
            Helpers.AppendTextRow(ref tier, ref sb, "{");
            tier++;
            Helpers.AppendTextRow(ref tier, ref sb, "power", power.ToString());
            Helpers.AppendTextRow(ref tier, ref sb, "startposition", startposition.Serialize(ref tier));
            Helpers.AppendTextRow(ref tier, ref sb, "elevation", elevation.ToString("F"));
            Helpers.AppendBoolianRow(ref tier, ref sb, "subdiv", subdiv);

            //normals{}
            //distances{}
            //offsets{}
            //offset_normals{}
            //alphas{}
            //triangle_tags{}
            //allowed_verts{}
            tier--;
            Helpers.AppendTextRow(ref tier, ref sb, "}");
            return(sb.ToString());
        }