Beispiel #1
0
        public override string ToString()
        {
            StringBuilder builder = new StringBuilder();

            builder.AppendLine(string.Format("{0}: [{1} - {2}, {3} - {4}] ({5}, {6})", this.GetType().Name, MinX, MaxX, MinY, MaxY, Width, Height));

            builder.AppendLine("{");
            for (int y = MinY; y < MaxY; y++)
            {
                for (int x = MinX; x < MaxX; x++)
                {
                    BefungeCommand bc = this[x, y];
                    builder.Append(bc.GetCommandCode());
                }
                builder.AppendLine();
            }
            builder.AppendLine("}");

            List <TagLocation> tags = FindAllTags();

            foreach (TagLocation tag in tags)
            {
                builder.AppendFormat("[ ({0:000}|{1:000}):'{2}' := {3} ]{4}", tag.X, tag.Y, tag.Command.GetCommandCode(), tag.Tag, Environment.NewLine);
            }

            return(builder.ToString());
        }
Beispiel #2
0
        public string ToSimpleString()
        {
            StringBuilder builder = new StringBuilder();

            for (int y = MinY; y < MaxY; y++)
            {
                for (int x = MinX; x < MaxX; x++)
                {
                    BefungeCommand bc = this[x, y];
                    builder.Append(bc.GetCommandCode());
                }
                if (y < MaxY - 1)
                {
                    builder.AppendLine();
                }
            }
            return(builder.ToString());
        }