本文整理汇总了C#中TileSet.Parse方法的典型用法代码示例。如果您正苦于以下问题:C# TileSet.Parse方法的具体用法?C# TileSet.Parse怎么用?C# TileSet.Parse使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类TileSet
的用法示例。
在下文中一共展示了TileSet.Parse方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TileRepository
public TileRepository(string filename)
{
isSolid[0] = false;
LoadingScreenForm loadingScreen = new LoadingScreenForm();
loadingScreen.setSubject("tileset");
loadingScreen.setMax(100);
loadingScreen.Show();
loadingScreen.Refresh();
if (!File.Exists(filename)) throw new ArgumentException("Tile file not found");
String basePath = System.IO.Path.GetDirectoryName(filename);
tileset = new TileSet();
tileset.Parse(filename);
// append a TileGroup (misc) with all tiles that are not yet in a TileGroup
TileGroup miscTiles = new TileGroup();
foreach (Tile tile in tileset.Tiles) {
if (tile == null) continue;
bool found = false;
foreach (TileGroup tileGroup in tileset.TileGroups) {
if (tileGroup.Tiles.Contains(tile.ID)) found = true;
}
if (found) continue;
miscTiles.Name = "(misc)";
miscTiles.Tiles.Add(tile.ID);
}
tileset.TileGroups.Add(miscTiles);
loadingScreen.setMax(tileset.Tiles.Count);
int progress = 0;
foreach (Tile tile in tileset.Tiles) {
progress++;
if (tile == null) continue;
addTile(tile, basePath);
loadingScreen.setProgress(progress);
}
loadingScreen.Close();
}
示例2: LoadTileSet
private void LoadTileSet(string file)
{
try {
tileset = new TileSet();
tileset.Parse(file);
tilesetfile = file;
tilesetdir = new FileInfo(file).Directory.ToString();
} catch(Exception exception) {
ShowException(exception);
}
Selection.Clear();
SelectionChanged();
FillTileGroupComboBox();
FillTileList();
}
示例3: LoadTileSet
private void LoadTileSet(string file) {
try {
tileset = new TileSet();
tileset.Parse(file);
tilesetfile = file;
tilesetdir = new FileInfo(file).Directory.ToString();
} catch(Exception exception) {
ShowException(exception);
}
Selection.Clear();
SelectionChanged();
FillTileGroupComboBox();
FillTileList();
useNewSyntax.Active = tileset.IsNew;
if (tileset.IsNew)
Console.WriteLine("Warning: new syntax of 0.3.x files \"More tiles in one image\" isn't currently supported for WRITING");
}