/// <summary> /// Adds the given component to this GameState. /// </summary> public void AddComponent(GameStateComponent Component) { if (_Components.Contains(Component)) { throw new ArgumentException("Component was already part of this GameState."); } this._Components.Add(Component); }
/// <summary> /// Removes the specified component from this collection. /// </summary> public void RemoveComponent(GameStateComponent Component) { bool result = this._Components.Remove(Component); if (!result) { throw new ArgumentException("Component was not in this GameState."); } }