本文整理汇总了C#中MapId.ToString方法的典型用法代码示例。如果您正苦于以下问题:C# MapId.ToString方法的具体用法?C# MapId.ToString怎么用?C# MapId.ToString使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类MapId
的用法示例。
在下文中一共展示了MapId.ToString方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: TryLoad
internal static bool TryLoad(MapId mapId, out Map map)
{
map = null;
var basePath = TerrainDisplayConfig.MapDir;
var mapPath = Path.Combine(basePath, mapId.ToString());
var fileName = string.Format("{0}{1}", mapId, Extension);
var filePath = Path.Combine(mapPath, fileName);
if (!Directory.Exists(mapPath))
{
log.Warn("Unable to find requested .map dir: {0}", mapPath);
return false;
}
if (!File.Exists(filePath))
{
log.Warn("Unable to find requested .map file: {0}", filePath);
return false;
}
using(var file = File.OpenRead(filePath))
{
map = ReadWDTInfo(file);
file.Close();
if (map == null)
{
log.Warn("Unable to load the requested .map file: {0}", filePath);
return false;
}
}
map.MapId = mapId;
return true;
}
示例2: Process
public static ExtractedM2 Process(string basePath, MapId mapId, string path)
{
basePath = Path.Combine(basePath, mapId.ToString());
var filePath = Path.Combine(basePath, path);
filePath = Path.ChangeExtension(filePath, ".m2x");
if (!File.Exists(filePath))
{
throw new FileNotFoundException("Extracted M2 file not found: {0}", filePath);
}
var m2 = new ExtractedM2();
using(var file = File.OpenRead(filePath))
using(var br = new BinaryReader(file))
{
var type = br.ReadString();
if (type != fileType)
{
br.Close();
throw new InvalidDataException(string.Format("M2x file in invalid format: {0}", filePath));
}
m2.Extents = br.ReadBoundingBox();
m2.BoundingVertices = br.ReadVector3List();
m2.BoundingTriangles = br.ReadIndex3List();
br.Close();
}
return m2;
}
示例3: Process
public static ExtractedWMO Process(string basePath, MapId mapId, string path)
{
basePath = Path.Combine(basePath, mapId.ToString());
var filePath = Path.Combine(basePath, path);
filePath = Path.ChangeExtension(filePath, ".wmo");
if (!File.Exists(filePath))
{
throw new FileNotFoundException("Extracted M2 file not found: {0}", filePath);
}
var wmo = new ExtractedWMO();
using (var file = File.OpenRead(filePath))
using (var br = new BinaryReader(file))
{
var type = br.ReadString();
if (type != fileType)
{
br.Close();
throw new InvalidDataException(string.Format("WMO file in invalid format: {0}", filePath));
}
wmo.Extents = br.ReadBoundingBox();
wmo.WMOId = br.ReadUInt32();
ReadWMODoodadDefs(br, wmo);
ReadWMOGroups(br, wmo);
}
return wmo;
}
示例4: MapTreeNode
public MapTreeNode(MapId map, TreeNode[] arr)
: base(map.ToString(), arr)
{
Map = map;
}