/// <summary> /// Adds all props found in the client for this region. /// </summary> protected void LoadClientEvents() { foreach (var areaData in this.Data.Areas) { foreach (var clientEventData in areaData.Events.Values) { var clientEvent = new ClientEvent(clientEventData, this.Data.Name, areaData.Name); this.AddClientEvent(clientEvent); } } }
/// <summary> /// Adds client event to region. /// </summary> /// <param name="clientEvent"></param> private void AddClientEvent(ClientEvent clientEvent) { _clientEventsRWLS.EnterWriteLock(); try { if (_clientEvents.ContainsKey(clientEvent.EntityId)) throw new ArgumentException("A client event with id '" + clientEvent.EntityId.ToString("X16") + "' already exists."); _clientEvents.Add(clientEvent.EntityId, clientEvent); } finally { _clientEventsRWLS.ExitWriteLock(); } // Add collisions this.Collisions.Add(clientEvent); }
/// <summary> /// Adds all props found in the client for this region. /// </summary> protected void LoadClientEvents() { foreach (var area in this.RegionInfoData.Areas) { foreach (var clientEvent in area.Events.Values) { var add = new ClientEvent(clientEvent.Id, clientEvent); this.AddClientEvent(add); } } }