-
Notifications
You must be signed in to change notification settings - Fork 32
Expand file tree
/
Copy pathItem.cs
More file actions
30 lines (25 loc) · 713 Bytes
/
Item.cs
File metadata and controls
30 lines (25 loc) · 713 Bytes
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
namespace Exercise
{
public abstract class Item : LibObject
{
public Item(int amount, int year)
{
AvailableAmount = amount;
ObjType = ObjectType.Item;
YearCreated = year;
}
}
public class Book : Item, IRegistarable
{
public Book(string author, string title, int year, int amount) : base(amount, year)
{
NameOrTitle = title;
Author = author;
}
public string Author { get; set; }
public RegisteredObject GetRegistrationInfo()
{
return new RegisteredObject() { AvailableAmount = AvailableAmount, Info = NameOrTitle };
}
}
}