/// <summary> /// Checks if a given active entity should be unloaded. /// </summary> /// <param name="ent">The entity to check.</param> /// <param name="activeList">The list for loaded entities.</param> /// <param name="inactiveList">The list for unloaded entities.</param> /// <param name="p3">Not used.</param> /// <returns>Not used.</returns> public bool CheckActive(Entity ent, object activeList, object inactiveList, object p3) { // Cast lists ThreadDictionary <UInt64, Entity> alist = (ThreadDictionary <UInt64, Entity>)activeList; ThreadDictionary <UInt64, Entity> ilist = (ThreadDictionary <UInt64, Entity>)inactiveList; // Check if entity is outside the loadport bounds if (ent.Position.X + ent.Radius < Location.X || ent.Position.Y + ent.Radius < Location.Y || ent.Position.X - ent.Radius > Location.X + Size.X || ent.Position.Y - ent.Radius > Location.Y + Size.Y) { // If it's a temporary entity we just delete it instead of unloading it if (ent.Temporary) { ent.Dispose(); return(true); } if (ent as Crosshair != null) { return(true); } alist.Remove(ent.ID); // Remove entity from loaded list ilist.Add(ent.ID, ent); // Add entity to unloaded list } return(true); }
/// <summary> /// Checks if a given inactive entity should be loaded. /// </summary> /// <param name="ent">The entity to check.</param> /// <param name="activeList">The list for loaded entities.</param> /// <param name="inactiveList">The list for unloaded entities.</param> /// <param name="p3">Not used.</param> /// <returns>Not used.</returns> public bool CheckInactive(Entity ent, object activeList, object inactiveList, object p3) { // Cast lists ThreadDictionary <UInt64, Entity> alist = (ThreadDictionary <UInt64, Entity>)activeList; ThreadDictionary <UInt64, Entity> ilist = (ThreadDictionary <UInt64, Entity>)inactiveList; // Check if entity is within loadport bounds if (!(ent.Position.X + ent.Radius < Location.X || ent.Position.Y + ent.Radius < Location.Y || ent.Position.X - ent.Radius > Location.X + Size.X || ent.Position.Y - ent.Radius > Location.Y + Size.Y)) { ilist.Remove(ent.ID); // Remove the entity from the inactive list alist.Add(ent.ID, ent); // Add the entity to the active list } return(true); }
/// <summary> /// Removes the screen with the specified name from the game. /// </summary> /// <param name="screen_name">The screen name of the screen to be removed.</param> public virtual void RemoveScreen(string screen_name) { _Screens.Remove(screen_name); DepthCheck(); }
/// <summary> /// Removes a binding from the list. /// </summary> /// <param name="name">The name of the bind to be removed.</param> public virtual void RemoveBind(String name) { _Binds.Remove(name); }