本文整理汇总了C#中MapId类的典型用法代码示例。如果您正苦于以下问题:C# MapId类的具体用法?C# MapId怎么用?C# MapId使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
MapId类属于命名空间,在下文中一共展示了MapId类的20个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的C#代码示例。
示例1: FinalizeDataHolder
public void FinalizeDataHolder()
{
RegionId = BattlegroundMgr.BattlemasterListReader.Entries[(int)Id].MapId;
RegionTemplate = World.GetRegionTemplate(RegionId);
if (RegionTemplate == null)
{
ContentMgr.OnInvalidDBData("BattlegroundTemplate had invalid RegionId: {0} (#{1})",
RegionId, (int)RegionId);
return;
}
if (BattlegroundMgr.Templates.Length <= (int)Id)
{
ContentMgr.OnInvalidDBData("BattlegroundTemplate had invalid BG-Id: {0} (#{1})",
Id, (int)Id);
return;
}
Difficulties = new PvPDifficultyEntry[BattlegroundMgr.PVPDifficultyReader.Entries.Values.Count(entry => (entry.mapId == RegionId))];
foreach (var entry in BattlegroundMgr.PVPDifficultyReader.Entries.Values)
{
if (entry.mapId == RegionId)
Difficulties[entry.bracketId] = entry;
}
RegionTemplate.MinLevel = Math.Max(1, MinLevel);
RegionTemplate.MaxLevel = Math.Max(MinLevel, MaxLevel);
BattlegroundMgr.Templates[(int)Id] = this;
CreateQueues();
SetStartPos();
}
开发者ID:NVN,项目名称:WCell,代码行数:35,代码来源:BattlegroundTemplate.cs
示例2: ExtractedWMOManager
public ExtractedWMOManager(string _baseDirectory, MapId _mapId)
{
this._baseDirectory = _baseDirectory;
this._mapId = _mapId;
_WMOs = new List<ExtractedWMO>();
_WMOM2s = new List<ExtractedM2>();
}
开发者ID:WCell,项目名称:WCell-Terrain,代码行数:7,代码来源:ExtractedWMOManager.cs
示例3: GetHeightAtPosition
/// <summary>
/// Get the height of the floor underneath the given position on the map with the given MapId.
/// </summary>
/// <param name="mapId">The <see cref="WCell.Constants.World.MapId"/> that corresponds to the desired map.</param>
/// <param name="pos">The position on the map to get the height at.</param>
/// <param name="height">The height of the floor at the given position on the map.</param>
/// <returns>True if the height retrieval was successful.</returns>
public bool GetHeightAtPosition(MapId mapId, Vector3 pos, out float height)
{
height = float.MinValue;
Map map;
return ((!TryGetMap(mapId, out map)) || (map.GetHeightAtPosition(pos, out height)));
}
开发者ID:WCell,项目名称:WCell-Terrain,代码行数:14,代码来源:World.cs
示例4: GetNearestWalkablePositon
/// <summary>
/// Gets the nearest walkable (i.e., not water, model, air, etc) position to the given position.
/// </summary>
/// <param name="mapId">The <see cref="WCell.Constants.World.MapId"/> that corresponds to the desired map.</param>
/// <param name="pos">The position to check against.</param>
/// <param name="walkablePos">The nearest walkable position to the given position.</param>
/// <returns>True if the check was successful.</returns>
public bool GetNearestWalkablePositon(MapId mapId, Vector3 pos, out Vector3 walkablePos)
{
walkablePos = Vector3.Zero;
Map map;
return ((!TryGetMap(mapId, out map)) || (map.GetNearestWalkablePosition(pos, out walkablePos)));
}
开发者ID:WCell,项目名称:WCell-Terrain,代码行数:14,代码来源:World.cs
示例5: GetNearestValidPosition
/// <summary>
/// Gets the nearest valid (i.e., not over a hole, outside map boundaries, etc) position to the given position.
/// </summary>
/// <param name="mapId">The <see cref="WCell.Constants.World.MapId"/> that corresponds to the desired map.</param>
/// <param name="pos">The position to check against.</param>
/// <param name="validPos">The nearest valid position to the given position.</param>
/// <returns>True if the check was successful.</returns>
public bool GetNearestValidPosition(MapId mapId, Vector3 pos, out Vector3 validPos)
{
validPos = Vector3.Zero;
Map map;
return ((!TryGetMap(mapId, out map)) || (map.GetNearestValidPosition(pos, out validPos)));
}
开发者ID:WCell,项目名称:WCell-Terrain,代码行数:14,代码来源:World.cs
示例6: HasLOS
public static bool HasLOS(MapId mapId, Vector3 startPos, Vector3 endPos)
{
float tMax;
var ray = CollisionHelper.CreateRay(startPos, endPos, out tMax);
var intTMax = (int)(tMax + 0.5f);
for (var t = 0; t < intTMax; t++)
{
var currentPos = ray.Position + ray.Direction * t;
TileCoord currentTileCoord;
ChunkCoord currentChunkCoord;
PointX2D currentPointX2D;
var currentHeightMapFraction = LocationHelper.GetFullInfoForPos(currentPos,
out currentTileCoord,
out currentChunkCoord,
out currentPointX2D);
var currentTile = GetTile(mapId, currentTileCoord);
if (currentTile == null)
{
// Can't check non-existant tiles.
return false;
}
var terrainHeight = currentTile.GetInterpolatedHeight(currentChunkCoord, currentPointX2D, currentHeightMapFraction);
if (terrainHeight < currentPos.Z) continue;
return false;
}
return true;
}
开发者ID:ray2006,项目名称:WCell,代码行数:33,代码来源:WorldMap.cs
示例7: 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;
}
开发者ID:WCell,项目名称:WCell-Terrain,代码行数:32,代码来源:ExtractedM2Parser.cs
示例8: FinalizeDataHolder
public void FinalizeDataHolder()
{
MapId = BattlegroundMgr.BattlemasterListReader.Entries[(int)Id].MapId;
MapTemplate = World.GetMapTemplate(MapId);
if (MapTemplate == null)
{
ContentMgr.OnInvalidDBData("BattlegroundTemplate had invalid MapId: {0} (#{1})",
MapId, (int)MapId);
return;
}
if (BattlegroundMgr.Templates.Length <= (int)Id)
{
ContentMgr.OnInvalidDBData("BattlegroundTemplate had invalid BG-Id: {0} (#{1})",
Id, (int)Id);
return;
}
MapTemplate.BattlegroundTemplate = this;
Difficulties = new PvPDifficultyEntry[BattlegroundMgr.PVPDifficultyReader.Entries.Values.Count(entry => (entry.mapId == MapId))];
foreach (var entry in BattlegroundMgr.PVPDifficultyReader.Entries.Values.Where(entry => (entry.mapId == MapId)))
{
Difficulties[entry.bracketId] = entry;
}
MinLevel = MapTemplate.MinLevel = Difficulties.First().minLevel;
MaxLevel = MapTemplate.MaxLevel = Difficulties.Last().maxLevel;
BattlegroundMgr.Templates[(int)Id] = this;
CreateQueues();
SetStartPos();
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:34,代码来源:BattlegroundTemplate.cs
示例9: FinalizeDataHolder
public void FinalizeDataHolder()
{
RegionId = BattlegroundMgr.BattlemasterListReader.Entries[(int)Id].MapId;
RegionInfo = World.GetRegionInfo(RegionId);
if (RegionInfo == null)
{
ContentHandler.OnInvalidDBData("BattlegroundTemplate had invalid RegionId: {0} (#{1})",
RegionId, (int)RegionId);
return;
}
if (BattlegroundMgr.Templates.Length <= (int)Id)
{
ContentHandler.OnInvalidDBData("BattlegroundTemplate had invalid BG-Id: {0} (#{1})",
Id, (int)Id);
return;
}
RegionInfo.MinLevel = Math.Max(1, MinLevel);
RegionInfo.MaxLevel = Math.Max(MinLevel, MaxLevel);
BattlegroundMgr.Templates[(int)Id] = this;
CreateQueues();
SetStartPos();
}
开发者ID:pallmall,项目名称:WCell,代码行数:27,代码来源:BattlegroundTemplate.cs
示例10: WorldState
public WorldState(MapId mapId, ZoneId zoneId, uint key, int value)
{
MapId = mapId;
ZoneId = zoneId;
Key = (WorldStateId)key;
DefaultValue = value;
}
开发者ID:remixod,项目名称:netServer,代码行数:7,代码来源:WorldState.cs
示例11: InstanceBinding
public InstanceBinding(uint id, MapId mapId, uint difficultyIndex)
{
BindTime = DateTime.Now;
DifficultyIndex = difficultyIndex;
InstanceId = id;
MapId = mapId;
}
开发者ID:remixod,项目名称:netServer,代码行数:7,代码来源:InstanceBinding.cs
示例12: 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;
}
开发者ID:WCell,项目名称:WCell-Terrain,代码行数:34,代码来源:Map.cs
示例13: ExtractedADTManager
public ExtractedADTManager(ExtractedTerrainManager terrainManager, string basePath, MapId mapId)
{
_mapId = mapId;
_terrainManager = terrainManager;
_basePath = basePath;
MapTiles = new List<ADTBase>();
}
开发者ID:WCell,项目名称:WCell-Terrain,代码行数:7,代码来源:ExtractedADTManager.cs
示例14: 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;
}
开发者ID:WCell,项目名称:WCell-Terrain,代码行数:32,代码来源:ExtractedWMOParser.cs
示例15: SendInstanceReset
/// <summary>
/// An instance has been reset
/// </summary>
public static void SendInstanceReset(IPacketReceiver client, MapId mapId)
{
using (var packet = new RealmPacketOut(RealmServerOpCode.SMSG_UPDATE_LAST_INSTANCE, 4))
{
packet.Write((int)mapId);
client.Send(packet);
}
}
开发者ID:ebakkedahl,项目名称:WCell,代码行数:11,代码来源:InstanceHandler.cs
示例16: LoadTile
/// <summary>
/// Creates a dummy Terrain and loads the given tile into it
/// </summary>
public static TerrainTile LoadTile(MapId map, int x, int y)
{
var terrain = new SimpleTerrain(map);
terrain.TileProfile[x, y] = true;
var tile = terrain.LoadTile(x, y);
terrain.Tiles[x, y] = tile;
return tile;
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:11,代码来源:SimpleTerrain.cs
示例17: WorldLocation
public WorldLocation(MapId region, Vector3 pos)
{
Position = pos;
Region = World.GetRegion(region);
if (Region == null)
{
throw new Exception("Invalid Region in WorldLocation: " + region);
}
}
开发者ID:NVN,项目名称:WCell,代码行数:9,代码来源:IWorldLocation.cs
示例18: CreateTerrain
public ITerrain CreateTerrain(MapId id)
{
if (!WorldMap.TerrainDataExists(id))
{
return new EmptyTerrain();
}
return new FullTerrain(id);
}
开发者ID:pallmall,项目名称:WCell,代码行数:9,代码来源:FullTerrainProvider.cs
示例19: WorldLocationStruct
public WorldLocationStruct(MapId map, Vector3 pos, uint phase = WorldObject.DefaultPhase)
{
m_Position = pos;
m_Map = World.GetNonInstancedMap(map);
if (m_Map == null)
{
throw new Exception("Invalid Map in WorldLocationStruct: " + map);
}
m_Phase = phase;
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:10,代码来源:IWorldLocation.cs
示例20: TeleportNode
public TeleportNode(string defaultName, MapId id, Vector3 pos)
{
DefaultName = defaultName;
Map = World.GetNonInstancedMap(id);
if (Map == null)
{
throw new ArgumentException("Map is not a continent: " + id);
}
Position = pos;
}
开发者ID:KroneckerX,项目名称:WCell,代码行数:10,代码来源:TeleportNode.cs
注:本文中的MapId类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论