private void WriteTileImages(LispWriter writer, string ListName, ArrayList ImagesList) { if (ImagesList.Count > 0) { writer.StartList(ListName); foreach (ImageRegion region in ImagesList) { if (region.Region.Width != 0) { writer.WriteVerbatimLine( String.Format("(region \"{0}\" {1} {2} {3} {4})", region.ImageFile, region.Region.Left, region.Region.Top, region.Region.Width, region.Region.Height)); } else { writer.WriteVerbatimLine( "\"" + region.ImageFile + "\""); } } writer.EndList(ListName); } else { Console.WriteLine("no images on tile " + ID); } }
private void WriteTileImages(LispWriter writer, string ListName, ArrayList ImagesList) { if(ImagesList.Count > 0) { writer.StartList(ListName); foreach(ImageRegion region in ImagesList) { if(region.Region.Width != 0) { writer.WriteVerbatimLine( String.Format("(region \"{0}\" {1} {2} {3} {4})", region.ImageFile, region.Region.Left, region.Region.Top, region.Region.Width, region.Region.Height)); } else { writer.WriteVerbatimLine( "\"" + region.ImageFile + "\""); } } writer.EndList(ListName); } else { Console.WriteLine("no images on tile " + ID); } }
public void Write(LispWriter writer) { writer.StartList("tile"); writer.Write("id", ID); if(Images.Count > 0) { writer.StartList("images"); foreach(ImageRegion region in Images) { if(region.Region.Width != 0) { writer.WriteVerbatimLine( String.Format("(region \"{0}\" {1} {2} {3} {4})", region.ImageFile, region.Region.Left, region.Region.Top, region.Region.Width, region.Region.Height)); } else { writer.WriteVerbatimLine( "\"" + region.ImageFile + "\""); } } writer.EndList("images"); } else { Console.WriteLine("no images on tile " + ID); } if(Solid) writer.Write("solid", true); if(UniSolid) writer.Write("unisolid", true); if(Ice) writer.Write("ice", true); if(Water) writer.Write("water", true); if(Slope) writer.Write("slope-type", Data); if(Hurts) writer.Write("hurts", true); if(Hidden) writer.Write("hidden", true); if(Coin) writer.Write("coin", true); if(FullBox) writer.Write("fullbox", true); if(Brick) writer.Write("brick", true); if(NextTile >= 0) writer.Write("next-tile", NextTile); if(Goal) writer.Write("goal", true); if(EditorImage != null) writer.Write("editor-images", EditorImage); if(Data != 0) writer.Write("data", Data); if(Images.Count > 1) { if(AnimFps == 1.0) AnimFps = 40; writer.Write("anim-fps", AnimFps); } writer.EndList("tile"); }
public void Write(LispWriter writer) { writer.StartList("tile"); writer.Write("id", ID); if (Images.Count > 0) { writer.StartList("images"); foreach (ImageRegion region in Images) { if (region.Region.Width != 0) { writer.WriteVerbatimLine( String.Format("(region \"{0}\" {1} {2} {3} {4})", region.ImageFile, region.Region.Left, region.Region.Top, region.Region.Width, region.Region.Height)); } else { writer.WriteVerbatimLine( "\"" + region.ImageFile + "\""); } } writer.EndList("images"); } else { Console.WriteLine("no images on tile " + ID); } if (Solid) { writer.Write("solid", true); } if (UniSolid) { writer.Write("unisolid", true); } if (Ice) { writer.Write("ice", true); } if (Water) { writer.Write("water", true); } if (Slope) { writer.Write("slope-type", Data); } if (Hurts) { writer.Write("hurts", true); } if (Hidden) { writer.Write("hidden", true); } if (Coin) { writer.Write("coin", true); } if (FullBox) { writer.Write("fullbox", true); } if (Brick) { writer.Write("brick", true); } if (NextTile >= 0) { writer.Write("next-tile", NextTile); } if (Goal) { writer.Write("goal", true); } if (EditorImage != null) { writer.Write("editor-images", EditorImage); } if (Data != 0) { writer.Write("data", Data); } if (Images.Count > 1) { if (AnimFps == 1.0) { AnimFps = 40; } writer.Write("anim-fps", AnimFps); } writer.EndList("tile"); }