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