public bool AddVisibleMapId(uint visibleMapId, TerrainSwapInfo visibleMapInfo, int references = 1) { if (VisibleMapIds.ContainsKey(visibleMapId)) { return(false); } VisibleMapIds.Add(visibleMapId, new VisibleMapIdRef(references, visibleMapInfo)); return(true); }
public static void RemoveVisibleMapId(WorldObject obj, uint visibleMapId) { TerrainSwapInfo terrainSwapInfo = Global.ObjectMgr.GetTerrainSwapInfo(visibleMapId); bool changed = obj.GetPhaseShift().RemoveVisibleMapId(visibleMapId); foreach (uint uiWorldMapAreaIDSwap in terrainSwapInfo.UiMapPhaseIDs) { changed = obj.GetPhaseShift().RemoveUiMapPhaseId(uiWorldMapAreaIDSwap) || changed; } Unit unit = obj.ToUnit(); if (unit) { ForAllControlled(unit, controlled => { RemoveVisibleMapId(controlled, visibleMapId); }); } UpdateVisibilityIfNeeded(obj, false, changed); }
public VisibleMapIdRef(int references, TerrainSwapInfo visibleMapInfo) { References = references; VisibleMapInfo = visibleMapInfo; }
public bool AddVisibleMapId(uint visibleMapId, TerrainSwapInfo visibleMapInfo, int references = 1) { VisibleMapIds.Add(visibleMapId, new VisibleMapIdRef(references, visibleMapInfo)); return(true); //Tryadd? maybe Concurrent }