public void AddController(Controller controller) { Debug.Assert(!ControllerList.Contains(controller), "You are adding the same controller more than once."); controller.World = this; ControllerList.Add(controller); ControllerAdded?.Invoke(controller); }
public void RemoveController(Controller controller) { Debug.Assert(ControllerList.Contains(controller), "You are removing a controller that is not in the simulation."); if (ControllerList.Contains(controller)) { ControllerList.Remove(controller); ControllerRemoved?.Invoke(controller); } }