-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathLibrary.cs
32 lines (29 loc) · 901 Bytes
/
Library.cs
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
using System.Collections.Generic;
namespace ConsoleApp1
{
/// <summary>
/// Represents a library that stores various items.
/// </summary>
public class Library
{
// List to store library items
private List<object> _items = new List<object>();
/// <summary>
/// Adds a new item to the library.
/// </summary>
/// <typeparam name="T">The type of the item being added.</typeparam>
/// <param name="item">The library item to add.</param>
public void AddItem<T>(LibraryItem<T> item)
{
_items.Add(item);
}
/// <summary>
/// Retrieves all the items stored in the library.
/// </summary>
/// <returns>An enumerable collection of all library items.</returns>
public IEnumerable<object> GetAllItems()
{
return _items;
}
}
}